|
@@ -57,6 +57,26 @@ public class DataStatisticsUtil {
|
|
|
return LocalDateTime.of(LocalDateTime.now().getYear(), 1, 1, 0, 0, 0);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @description 获取当前年份的最开始的时间
|
|
|
+ * @date 2020/2/4 3:37 下午
|
|
|
+ */
|
|
|
+ public static LocalDateTime getYearFirstTime(int year) {
|
|
|
+ return LocalDateTime.of(year, 1, 1, 0, 0, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @description 获取指定年的最后一天
|
|
|
+ * @date 2020/5/25 11:13 上午
|
|
|
+ */
|
|
|
+ public static LocalDateTime getYearLastTime(int year) {
|
|
|
+ return LocalDateTime.of(year, 12, 31, 0, 0, 0);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param localDateTime 时间数据
|
|
|
* @return
|
|
@@ -129,6 +149,19 @@ public class DataStatisticsUtil {
|
|
|
commonRequest.setEndTimeDate(LocalDateTime.now());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @description 给请求类设置年初到现在的时间
|
|
|
+ * @date 2020/2/7 3:51 下午
|
|
|
+ */
|
|
|
+ public static void setBeginYearToNow(int year, CommonRequest commonRequest) {
|
|
|
+ //年初时间
|
|
|
+ commonRequest.setStartTimeDate(getYearFirstTime(year));
|
|
|
+ //当前时间
|
|
|
+ commonRequest.setEndTimeDate(LocalDateTime.now());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param bigDecimalValue
|
|
|
* @return
|