package com.iailab.module.job.task; import com.iailab.module.watch.WatchConstant; import com.iailab.module.watch.WatchDog; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Resource; import org.springframework.stereotype.Component; /** * 监听旋流器浓缩智能控制器状态 * ZX2 * * 0/2 * * * * ? * * @author PanZhibao * @Description * @createTime 2024年06月05日 */ @Slf4j @Component("watchControllerOn3Task") public class WatchControllerOn3Task implements ITask { private Logger logger = LoggerFactory.getLogger(getClass()); @Resource private WatchDog watchDog; @Override public void run(String params) { // logger.info("WatchControllerOn3Task定时任务正在执行,参数为:{}", params); try { if (!watchDog.isConnect(WatchConstant.ZX2_STATUS)) { log.info("通讯异常,投入智能化状态复位!"); watchDog.stopControllerSts(WatchConstant.CONTROLLER_ONSTS_3); return; } if (watchDog.isUse(WatchConstant.CONTROLLER_USE_3)) { watchDog.startControllerSts(WatchConstant.CONTROLLER_ONSTS_3); } else { watchDog.stopControllerSts(WatchConstant.CONTROLLER_ONSTS_3); } } catch (Exception ex) { logger.error("WatchControllerOn3Task运行异常"); ex.printStackTrace(); } logger.info("WatchControllerOn3Task运行完成"); } }