DS
潘志宝
2024-08-23 0fbd01c6fe5386e454d4053df161b01e8b42f423
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 com.iailab.module.data.job.task;
 
import com.iailab.module.data.point.collection.PointCollector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
 
import java.time.LocalDateTime;
import java.util.Calendar;
 
/**
 * Point采集器10s
 * 0/10 * * * * ?
 *
 * @author PanZhibao
 * @Description
 * @createTime 2023年05月05日 11:49:00
 */
@Component("pointCollectTaskNet10")
public class PointCollectTaskNet10 implements ITask {
    private Logger logger = LoggerFactory.getLogger(getClass());
 
    private final String NET = "NET10";
 
    @Resource
    private PointCollector pointCollector;
 
    @Override
    public void run(String params){
        logger.debug("PointCollectTaskNet10定时任务正在执行,参数为:{}", params);
        try {
            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.MILLISECOND, 0);
            pointCollector.collect(calendar.getTime(), NET);
            logger.info("PointCollectTaskNet10定时任务完成时间:" + LocalDateTime.now());
        } catch (Exception ex) {
            ex.printStackTrace();
            logger.error("PointCollectTaskNet10定时任务失败时间:" + LocalDateTime.now());
        }
 
    }
}