Parcourir la source

当阳数据实时数据与历史数据逻辑变更 增加定制同步机制

1037015548@qq.com il y a 9 mois
Parent
commit
c120be938b

+ 3 - 3
dc3-gateway/src/main/java/io/github/pnoker/gateway/comtool/ThreadDinzhiHistoryTask.java

@@ -51,7 +51,7 @@ public class ThreadDinzhiHistoryTask implements Runnable{
             LocalDateTime now = LocalDateTime.now().withSecond(0);
 
             // 使用提取的值构造新的LocalDateTime对象
-            LocalDateTime firstDayOfMonthWithCurrentTime = now.minusDays(2);
+            LocalDateTime firstDayOfMonthWithCurrentTime = now.minusDays(2).withHour(0).withMinute(0).withSecond(0);
 
 //            days.add(now);//测试用
 
@@ -65,8 +65,8 @@ public class ThreadDinzhiHistoryTask implements Runnable{
                             paramRealtime.put("deviceCode", String.valueOf(map.get("deviceCode")));
 //                        paramRealtime.put("pageNo", String.valueOf(pageNo));
 //                        paramRealtime.put("pageSize", String.valueOf(pageSize));
-                            paramRealtime.put("startTime", now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-                            paramRealtime.put("endTime", firstDayOfMonthWithCurrentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                            paramRealtime.put("startTime", firstDayOfMonthWithCurrentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                            paramRealtime.put("endTime", now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
                             paramRealtime.put("interval", String.valueOf((collectionFrequency < 60 ? 60 : collectionFrequency)));
                             Map<String, String> headers = new HashMap<>();
                             headers.put("Authorization", "Bearer " + KprDangyangWaterBizFun.dangyangToken);