From a3b34f9f092e1aeacfe6bd4c9e80b7464dcd5912 Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Tue, 07 Nov 2023 16:45:07 +0800 Subject: [PATCH] fix:小程序添加流程状态变更 --- screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java | 65 ++++++++++++++++++++++++++++++-- 1 files changed, 61 insertions(+), 4 deletions(-) diff --git a/screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java b/screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java index 8a272b3..4c7b3a7 100644 --- a/screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java +++ b/screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java @@ -5,17 +5,24 @@ import com.moral.api.service.HistoryDailyService; import com.moral.api.service.HistoryFiveMinutelyService; +import com.moral.api.service.HistoryHourlyService; import com.moral.api.service.HistoryMonthlyService; import com.moral.api.service.HistoryWeeklyService; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.handler.annotation.XxlJob; +import javax.xml.crypto.Data; +import java.util.Date; + @Component public class HistoryTableInsertTask { @Autowired private HistoryFiveMinutelyService historyFiveMinutelyService; + + @Autowired + private HistoryHourlyService historyHourlyService; @Autowired private HistoryDailyService historyDailyService; @@ -33,7 +40,7 @@ historyFiveMinutelyService.insertHistoryFiveMinutely(); } catch (Exception e) { XxlJobHelper.log(e.getMessage()); - return ReturnT.FAIL; + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); } return ReturnT.SUCCESS; } @@ -42,7 +49,8 @@ @XxlJob("insertHistoryDaily") public ReturnT insertHistoryDaily() { try { - historyDailyService.insertHistoryDaily(); + Date now = new Date(); + historyDailyService.insertHistoryDaily(null); } catch (Exception e) { XxlJobHelper.log(e.getMessage()); return ReturnT.FAIL; @@ -57,7 +65,7 @@ historyWeeklyService.insertHistoryWeekly(); } catch (Exception e) { XxlJobHelper.log(e.getMessage()); - return ReturnT.FAIL; + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); } return ReturnT.SUCCESS; } @@ -69,8 +77,57 @@ historyMonthlyService.insertHistoryMonthly(); } catch (Exception e) { XxlJobHelper.log(e.getMessage()); - return ReturnT.FAIL; + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); } return ReturnT.SUCCESS; } + + //������������������������ + @XxlJob("historyHourlySupplement") + public ReturnT historyHourlySupplement() { + try { + historyHourlyService.insertHistoryHourly(); + } catch (Exception e) { + XxlJobHelper.log(e.getMessage()); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + return ReturnT.SUCCESS; + } + + //��������������������������������������������������������������� + @XxlJob("insertHistoryHourlyComplete") + public ReturnT insertHistoryHourlyComplete(){ + try { + historyHourlyService.insertHistoryHourlyComplete(); + } catch (Exception e) { + e.printStackTrace(); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + return ReturnT.SUCCESS; + } + + @XxlJob("dateToChangShu") + public ReturnT dateToChangShu(){ + try { + historyHourlyService.dateToChangShu(null); + } catch (Exception e) { + e.printStackTrace(); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + return ReturnT.SUCCESS; + } + + //������������������������ + @XxlJob("dateInsertHistoryHourlyAvg") + public ReturnT dateInsertHistoryHourlyAvg(){ + try { + historyHourlyService.dateInsertHistoryHourlyAvg(); + } catch (Exception e) { + e.printStackTrace(); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + return ReturnT.SUCCESS; + } + + } -- Gitblit v1.8.0