瀏覽代碼

日统计月统计bug修改

丁治程 8 月之前
父節點
當前提交
fc18017624

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockjob/DayStatisticsJob.java

@@ -65,7 +65,7 @@ public class DayStatisticsJob implements Job {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         String currentDay = DateUtils.getDate("yyyy-MM-dd HH:mm:ss");  // 当前日期
         LocalDate yesterDate = LocalDate.now().minusDays(1);  // 当前 00:00:00 执行定时任务 减一天获取昨天的日期
-        String yesterday = yesterDate.format(formatter); // 昨天的日期
+        String yesterday = yesterDate.atStartOfDay().format(formatter); // 昨天的日期
         //String yesterday = "2024-06-28 00:00:00"; // 测试模拟的昨天日期
 
         // 统计健康等级 count_type = 0

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockjob/MonthStatisticsJob.java

@@ -53,7 +53,7 @@ public class MonthStatisticsJob implements Job {
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
         LocalDate yesterDate = LocalDate.now().minusMonths(1);  // 当前 00:00:00 执行定时任务 减一天获取昨天的日期
-        String lastmonth = yesterDate.format(formatter); // 上个月的月份
+        String lastmonth = yesterDate.atStartOfDay().format(formatter); // 上个月的月份
         //String lastmonth = "2024-06"; // 测试模拟上个月的月份
         String year = lastmonth.split("-")[0];