Explorar el Código

处理月度汇总的时候 日期额外处理一下

wangmiaomiao hace 9 meses
padre
commit
c349d0e497

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

@@ -745,8 +745,11 @@ public class RyTask
         TXinyiBigTableMonth xinyiBigTableMonth = this.xinyiBigTableMonthMapper.selectAvgByMonth(begin, end);
         //保存到插入对象
         //插入到数据库
-        if(!Objects.isNull(xinyiBigTableMonth))
+        if(!Objects.isNull(xinyiBigTableMonth)){
+            //先把日期处理一下 处理成只要月份的
+            xinyiBigTableMonth.setTestDate(xinyiBigTableMonth.getTestDate().substring(0, 7));
             this.xinyiBigTableMonthMapper.insertTXinyiBigTableMonth(xinyiBigTableMonth);
+        }
     }
 
     private void predictorSpecial(List<TXinyiIndustry> tXinyiIndustries6, List<TXinyiRobot> tXinyiRobots6) {
@@ -1672,6 +1675,9 @@ public class RyTask
         System.out.println(DateUtils.parseDate("2024-06-25 10", DateUtils.YYYY_MM_DD_HH));
         String yesterdayStr = LocalDateTimeUtil.getCurrentDate().plusDays(-1).format(DateTimeFormatter.ofPattern(DateUtils.YYYYMMDD_TS));//昨天
         System.out.println(yesterdayStr);
+
+
+        System.out.println("2024/07/07 12".substring(0, 7));
     }