liu 2 лет назад
Родитель
Сommit
1ab50e6298

+ 4 - 4
src/main/java/com/template/services/impl/SmartRelationServiceImpl.java

@@ -62,8 +62,8 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
         if (scheduleConfig.getIsOpen().equals("1")) {
             DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             LocalDateTime now = LocalDateTime.now();
-            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(8);
-            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(8);
+            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
+            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
             String format = start.format(pattern);
 //            找到昨天的所有数据
             List<SmartAccess> accessList = smartAccessService.toDatelist(start, end);
@@ -125,8 +125,8 @@ public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, S
         if (scheduleConfig.getIsOpen().equals("1")) {
             DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             LocalDateTime now = LocalDateTime.now();
-            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(8);
-            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(8);
+            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
+            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
 
             String format = start.format(pattern);