Quellcode durchsuchen

工业库同步数据 按小时记录 增加顺序

wangmiaomiao vor 10 Monaten
Ursprung
Commit
2d775f58ee
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

+ 3 - 3
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -89,7 +89,7 @@ public class RyTask
         // 循环按小时分割
         // 循环按小时分割
         LocalDateTime currentHour = startTime;
         LocalDateTime currentHour = startTime;
         //最终获取的数据
         //最终获取的数据
-        Map<String, TXinyiIndustry> needMap = new HashMap<>();
+        Map<String, TXinyiIndustry> needMap = new LinkedHashMap<>();
         while (currentHour.isBefore(endTime)) {
         while (currentHour.isBefore(endTime)) {
             String begin = currentHour.format(formatter);
             String begin = currentHour.format(formatter);
             String end = currentHour.plusMinutes(5).format(formatter);
             String end = currentHour.plusMinutes(5).format(formatter);
@@ -409,13 +409,13 @@ public class RyTask
 
 
         // 每个小时的时间格式
         // 每个小时的时间格式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        LocalDateTime startTime = LocalDateTime.parse("2024-05-17T12:00:00");
+        LocalDateTime startTime = LocalDateTime.parse("2024-05-18T00:00:00");
         LocalDateTime endTime =  LocalDateTime.now();
         LocalDateTime endTime =  LocalDateTime.now();
 
 
         // 循环按小时分割
         // 循环按小时分割
         LocalDateTime currentHour = startTime;
         LocalDateTime currentHour = startTime;
         //最终获取的数据
         //最终获取的数据
-        Map<String, TXinyiIndustry> needMap = new HashMap<>();
+        Map<String, TXinyiIndustry> needMap = new LinkedHashMap<>();
         while (currentHour.isBefore(endTime)) {
         while (currentHour.isBefore(endTime)) {
             String begin = currentHour.format(formatter);
             String begin = currentHour.format(formatter);
             String end = currentHour.plusMinutes(5).format(formatter);
             String end = currentHour.plusMinutes(5).format(formatter);