lius
2023-06-08 534aec7a687ceca8120ba798ad20d80d7058ffe6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.jeecg.modules.mdc.job;
 
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalInfoService;
import org.quartz.*;
 
import javax.annotation.Resource;
 
/**
 * @Description: 定时统计单日数据任务
 * @author: LiuS
 * @create: 2023-04-14 13:53
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
@Slf4j
public class RunningAllEquipmentStatisticalProcessJob implements Job {
 
    /**
     * 若参数变量名修改 QuartzJobController中也需对应修改  时间: yyyyMMdd 例: 20230414
     */
    private String parameter;
 
    public void setParameter(String parameter) {
        this.parameter = parameter;
    }
 
    @Resource
    private IMdcEquipmentStatisticalInfoService mdcEquipmentStatisticalInfoService;
 
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info(String.format("定时统计单日数据任务 param: %s RunningAllEquipmentStatisticalProcessJob start!  时间:" + DateUtils.now(), this.parameter));
        try {
            mdcEquipmentStatisticalInfoService.runningAllEquipmentStatisticalProcess(this.parameter);
            log.info("定时统计单日数据任务 RunningAllEquipmentStatisticalProcessJob 执行成功!");
        } catch (Exception e) {
            log.error("定时统计单日数据任务 RunningAllEquipmentStatisticalProcessJob 执行失败!");
            log.error(e.getMessage(), e);
        }
    }
}