houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
提交 | 用户 | 时间
a6de49 1 package com.iailab.module.job.task;
H 2
3 import com.iailab.module.watch.WatchConstant;
4 import com.iailab.module.watch.WatchDog;
5 import lombok.extern.slf4j.Slf4j;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
8 import javax.annotation.Resource;
9 import org.springframework.stereotype.Component;
10
11 /**
12  * 智能压风
13  * ZX1
14  *
15  * 0/2 * * * * ?
16  *
17  * @author PanZhibao
18  * @Description
19  * @createTime 2024年06月07日
20  */
21 @Slf4j
22 @Component("watchControllerOn6Task")
23 public class WatchControllerOn6Task implements ITask {
24     private Logger logger = LoggerFactory.getLogger(getClass());
25
26     @Resource
27     private WatchDog watchDog;
28
29     @Override
30     public void run(String params) {
31         // logger.info("WatchControllerOn6Task定时任务正在执行,参数为:{}", params);
32         try {
33             if (!watchDog.isConnect(WatchConstant.ZX1_STATUS)) {
34                 log.info("通讯异常,投入智能化状态复位!");
35                 watchDog.stopControllerSts(WatchConstant.CONTROLLER_ONSTS_6);
36                 return;
37             }
38             if (watchDog.isUse(WatchConstant.CONTROLLER_USE_6)) {
39                 watchDog.startControllerSts(WatchConstant.CONTROLLER_ONSTS_6);
40             } else {
41                 watchDog.stopControllerSts(WatchConstant.CONTROLLER_ONSTS_6);
42             }
43         } catch (Exception ex) {
44             logger.error("WatchControllerOn6Task运行异常");
45             ex.printStackTrace();
46         }
47         logger.info("WatchControllerOn6Task运行完成");
48
49     }
50 }