lius
2023-07-25 c45790a3da8fa480091be24e0775e9f8dbab927c
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.IMdcEquipmentStatisticalShiftInfoService;
import org.quartz.*;
 
import javax.annotation.Resource;
 
/**
 * @Description: 定时统计单日班次数据任务
 * @author: LiuS
 * @create: 2023-07-24 10:26
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
@Slf4j
public class RunningAllEquipmentShiftStatisticalProcessJob implements Job {
 
    /**
     * 若参数变量名修改 QuartzJobController中也需对应修改  时间: yyyyMMdd 例: 20230414
     */
    private String parameter;
 
    public void setParameter(String parameter) {
        this.parameter = parameter;
    }
 
    @Resource
    private IMdcEquipmentStatisticalShiftInfoService mdcEquipmentStatisticalShiftInfoService;
 
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info(String.format("定时统计单日班次数据任务 param: %s RunningAllEquipmentShiftStatisticalProcessJob start!  时间:" + DateUtils.now(), this.parameter));
        try {
            mdcEquipmentStatisticalShiftInfoService.runningAllEquipmentShiftStatisticalProcess(this.parameter);
            log.info("定时统计单日班次数据任务 RunningAllEquipmentShiftStatisticalProcessJob 执行成功!");
        } catch (Exception e) {
            log.error("定时统计单日班次数据任务 RunningAllEquipmentShiftStatisticalProcessJob 执行失败!");
            log.error(e.getMessage(), e);
        }
    }
}