|
@@ -12,6 +12,8 @@ import org.jeecg.modules.history.service.IInterlockDetailHistoryService;
|
|
|
import org.jeecg.modules.history.service.IInterlockSummaryHistoryService;
|
|
|
import org.jeecg.modules.interlockCountDay.entity.InterlockCountDay;
|
|
|
import org.jeecg.modules.interlockCountDay.service.IInterlockCountDayService;
|
|
|
+import org.jeecg.modules.interlockSummaryDay.entity.InterlockSummaryDay;
|
|
|
+import org.jeecg.modules.interlockSummaryDay.service.IInterlockSummaryDayService;
|
|
|
import org.quartz.Job;
|
|
|
import org.quartz.JobExecutionContext;
|
|
|
import org.quartz.JobExecutionException;
|
|
@@ -59,21 +61,27 @@ public class DayStatisticsJob implements Job {
|
|
|
@SuppressWarnings("all")
|
|
|
private IInterlockBaseHyService baseHyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ private IInterlockSummaryDayService summaryDayService;
|
|
|
+
|
|
|
@Override
|
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
|
// 日统计的定时任务 统计 每个系统下的每个联锁 健康等级(A/B/C/D)、联锁状态,每个联锁条件的仪表状态 的个数
|
|
|
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.atStartOfDay().format(formatter); // 昨天的日期
|
|
|
+ //LocalDate yesterDate = LocalDate.now().minusDays(1); // 当前 00:00:00 执行定时任务 减一天获取昨天的日期
|
|
|
+ //String yesterday = currentDate.atStartOfDay().format(formatter); // 昨天的日期
|
|
|
//String yesterday = "2024-06-28 00:00:00"; // 测试模拟的昨天日期
|
|
|
|
|
|
+ List<InterlockSummaryDay> currentDayList = summaryHistoryService.getCurrentDaySummaryInterlock();
|
|
|
+ summaryDayService.saveBatch(currentDayList);
|
|
|
+
|
|
|
// 统计健康等级 count_type = 0
|
|
|
/** 从历史数据中获取 */
|
|
|
//List<InterlockCountDay> loopHealthLevelList = summaryHistoryService.getLoopHealthLevelByTagTime(yesterday);
|
|
|
|
|
|
- /** 从每天第一次导出的日报表数据中获取 */
|
|
|
- List<InterlockCountDay> loopHealthLevelList = summaryHistoryService.getLoopHealthLevelByTagTimeFromDay(yesterday);
|
|
|
+ List<InterlockCountDay> loopHealthLevelList = summaryHistoryService.getLoopHealthLevelByTagTimeNew(currentDay);
|
|
|
|
|
|
HashMap<String, List<InterlockCountDay>> loopHealthLevelMap = new HashMap<>();
|
|
|
for (InterlockCountDay item:loopHealthLevelList) {
|
|
@@ -110,7 +118,8 @@ public class DayStatisticsJob implements Job {
|
|
|
interlockCount.setCountName(d);
|
|
|
interlockCount.setCountNum("0");
|
|
|
interlockCount.setCountType("0");
|
|
|
- interlockCount.setTime(yesterday);
|
|
|
+ //interlockCount.setTime(yesterday);
|
|
|
+ interlockCount.setTime(currentDay);
|
|
|
sonList.add(interlockCount);
|
|
|
}
|
|
|
}
|
|
@@ -121,7 +130,7 @@ public class DayStatisticsJob implements Job {
|
|
|
//countService.saveBatch(loopHealthLevelResultList);
|
|
|
|
|
|
// 统计联锁状态(投用/未投用) count_type = 1
|
|
|
- List<InterlockCountDay> interlockStatusList = summaryHistoryService.getInterlockStatusByTagTime(yesterday);
|
|
|
+ List<InterlockCountDay> interlockStatusList = summaryHistoryService.getInterlockStatusByTagTimeNew(currentDay);
|
|
|
|
|
|
HashMap<String, List<InterlockCountDay>> interlockStatusMap = new HashMap<>();
|
|
|
for (InterlockCountDay item:interlockStatusList) {
|
|
@@ -160,7 +169,8 @@ public class DayStatisticsJob implements Job {
|
|
|
interlockCount.setCountName(d);
|
|
|
interlockCount.setCountNum("0");
|
|
|
interlockCount.setCountType("1");
|
|
|
- interlockCount.setTime(yesterday);
|
|
|
+ //interlockCount.setTime(yesterday);
|
|
|
+ interlockCount.setTime(currentDay);
|
|
|
sonList.add(interlockCount);
|
|
|
}
|
|
|
}
|
|
@@ -214,7 +224,8 @@ public class DayStatisticsJob implements Job {
|
|
|
interlockCount.setCountName("投用率");
|
|
|
interlockCount.setCountNum(String.valueOf(tyl));
|
|
|
interlockCount.setCountType("2");
|
|
|
- interlockCount.setTime(yesterday);
|
|
|
+ //interlockCount.setTime(yesterday);
|
|
|
+ interlockCount.setTime(currentDay);
|
|
|
tylResultList.add(interlockCount);
|
|
|
}
|
|
|
|
|
@@ -304,7 +315,7 @@ public class DayStatisticsJob implements Job {
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
QueryWrapper<InterlockCountDay> queryWapper = new QueryWrapper<>();
|
|
|
- queryWapper.eq("time",yesterday);
|
|
|
+ queryWapper.eq("time",currentDay);
|
|
|
boolean b = countService.remove(queryWapper);
|
|
|
countService.saveBatch(list);
|
|
|
log.info("日统计任务执行成功!");
|