src/main/java/com/yssh/config/ScheduleConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/yssh/service/WarningAnalyseService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/yssh/service/XlsExportService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/yssh/config/ScheduleConfig.java
@@ -10,10 +10,7 @@ import com.yssh.entity.DictRecord; import com.yssh.entity.SuYuan; import com.yssh.entity.VocVals; import com.yssh.service.DictRecordService; import com.yssh.service.SuYuanService; import com.yssh.service.VocValsService; import com.yssh.service.WarningAnalyseService; import com.yssh.service.*; import com.yssh.utils.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,19 +29,22 @@ protected final Logger logger = LoggerFactory.getLogger(this.getClass()); @Resource private VocValsService vocValsService; VocValsService vocValsService; @Resource private SuYuanService suYuanService; SuYuanService suYuanService; @Resource private CsvFilePathConfig csvFilePathConfig; CsvFilePathConfig csvFilePathConfig; @Resource private DictRecordService dictRecordService; DictRecordService dictRecordService; @Resource private WarningAnalyseService warningAnalyseService; WarningAnalyseService warningAnalyseService; @Resource XlsExportService xlsExportService; @Value("${csv.voc_max}") private int vocMax = 96; @@ -188,4 +188,28 @@ } warningAnalyseService.warningOperationStorage(date); } /** * 创建日报:每日0时1分 */ @Scheduled(cron = "0 1 0 * * ?") public void createDayReport() { xlsExportService.createDayReport(new Date()); } /** * 创建周报:每周一0时5分 */ @Scheduled(cron = "0 5 0 ? * MON") public void createWeekReport() { xlsExportService.createWeekReport(new Date()); } /** * 创建月报:每月1日0时9分 */ @Scheduled(cron = "0 9 0 1 * ?") public void createMonthReport() { xlsExportService.createMonthReport(new Date()); } } src/main/java/com/yssh/service/WarningAnalyseService.java
@@ -237,7 +237,9 @@ return null; } // 已废弃 * /** * 存储告警/预警信息 */ public void warningOperationStorage(Date date) { List<WarningDetail> allData = new ArrayList<>(); List<WarningDetail> alarms = this.getAlarmWarnAnalyse(date, false); @@ -260,7 +262,9 @@ } } // 已废弃 * /** * 获取告警/预警分析 */ private List<WarningDetail> getAlarmWarnAnalyse(Date date, boolean isWarn) { List<String> ids = CalculateUtils.assembleId(commonService.getCheckPoints3d()); src/main/java/com/yssh/service/XlsExportService.java
@@ -12,10 +12,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.*; /** * Excel导出服务类 @@ -65,7 +62,7 @@ /** * 创建日报 */ public void createDayReport() { public void createDayReport(Date date) { try { String type = "day"; List<DayExcel> list = new ArrayList<>(); @@ -86,7 +83,7 @@ /** * 创建周报 */ public void createWeekReport() { public void createWeekReport(Date date) { try { String type = "week"; List<WeekExcel> list = new ArrayList<>(); @@ -107,7 +104,7 @@ /** * 创建月报 */ public void createMonthReport() { public void createMonthReport(Date date) { try { String type = "month"; List<MonthExcel> list = new ArrayList<>();