houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
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
package com.iailab.module.job.task;
 
import com.iailab.module.device.service.DeviceStatUsageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
 
/**
 * 同步中选设备运行时间
 * 计算设备使用率
 * 每天8:00执行
 * 0 0 8 * * ?
 */
@Component("syncDeviceStatUsageTask")
public class SyncDeviceStatUsageTask implements ITask {
    private Logger logger = LoggerFactory.getLogger(getClass());
 
    @Resource
    private DeviceStatUsageService deviceStatUsageService;
 
 
    @Override
    public void run(String params) {
        try {
            logger.info("SyncDeviceStatUsageTask 开始");
 
            deviceStatUsageService.syncData();
            logger.info("SyncDeviceStatUsageTask 完成");
        } catch (Exception ex) {
            logger.info("SyncDeviceStatUsageTask 异常");
            ex.printStackTrace();
        }
    }
}