|  |  | 
 |  |  |  | 
 |  |  | import com.dy.common.mw.core.CoreTask; | 
 |  |  | import com.dy.common.queue.Node; | 
 |  |  | import com.dy.rtuMw.server.mqtt.DevStatusDealer; | 
 |  |  | import com.dy.rtuMw.server.mqtt.MqttSubMsgCache; | 
 |  |  | import com.dy.rtuMw.server.mqtt.MqttSubMsgNode; | 
 |  |  | import org.apache.logging.log4j.LogManager; | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public Integer execute() { | 
 |  |  |         try{ | 
 |  |  |             dealOneline() ; | 
 |  |  |         }catch(Exception e){ | 
 |  |  |             log.error("更新RTU会话上报数据时刻时发生集合操作异常,此异常并不影响系统正常运行", e); | 
 |  |  |         } | 
 |  |  |         try{ | 
 |  |  |             dealMqMsg() ; | 
 |  |  |         }catch(Exception e){ | 
 |  |  |             log.error(e); | 
 |  |  |         } | 
 |  |  |         return MqttSubMsgCache.size()>0?0:1 ; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private void dealOneline(){ | 
 |  |  |         DevStatusDealer.updateOnLineState(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 处理MQTT订阅的消息 | 
 |  |  |      */ | 
 |  |  |     public void dealMqMsg() { | 
 |  |  |     private void dealMqMsg() { | 
 |  |  |         Node first = MqttSubMsgCache.getFirstQueueNode() ; | 
 |  |  |         if(first != null){ | 
 |  |  |             Node last = MqttSubMsgCache.getLastQueueNode() ; |