jinpengyong
2022-04-08 fdbef2a3293e536be6b119e4e1e67cc8cc9842f0
screen-job/src/main/java/com/moral/api/task/HistoryTableInsertTask.java
@@ -5,6 +5,7 @@
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;
@@ -16,6 +17,9 @@
    @Autowired
    private HistoryFiveMinutelyService historyFiveMinutelyService;
    @Autowired
    private HistoryHourlyService historyHourlyService;
    @Autowired
    private HistoryDailyService historyDailyService;
@@ -33,7 +37,7 @@
            historyFiveMinutelyService.insertHistoryFiveMinutely();
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
            return ReturnT.FAIL;
            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
        }
        return ReturnT.SUCCESS;
    }
@@ -57,7 +61,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,7 +73,31 @@
            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;
    }