Przeglądaj źródła

2023-3-7 恢复一体机消息推送。

chaiyunlong 2 lat temu
rodzic
commit
4ca8cbe66d

+ 14 - 14
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mqtt/service/impl/SubMessageSendManager.java

@@ -124,20 +124,20 @@ public class SubMessageSendManager {
         MessageBody messageBody = getMessageBody(subFunction);
         logger.error("消息推送一体机开始");
         //仅发送一次
-//        commonSend.send(getFunctionSubTopic(subId), messageBody, SendMode.ONCE);
-        int count = 0;
-        List<SensorFunctionStatus> sensorFunctionStatusList = subFunction.getFunctionStatuses();
-        for (SensorFunctionStatus sensorFunc : sensorFunctionStatusList) {
-            if (redisService.getCacheObject(sensorFunc.getFunNum()+""+sensorFunc.getDescribe())==null){
-                logger.error("消息推送funNum存入redis:::"+sensorFunc.getFunNum()+""+sensorFunc.getDescribe());
-                redisService.setCacheObject(sensorFunc.getFunNum()+""+sensorFunc.getDescribe(),sensorFunc.getFunNum(),15L, TimeUnit.SECONDS);
-                count++;
-            }
-        }
-        if(count>0){
-            logger.error("消息推送中.......");
-            commonSend.send(getFunctionSubTopic(subId), messageBody, SendMode.ONCE);
-        }
+        commonSend.send(getFunctionSubTopic(subId), messageBody, SendMode.ONCE);
+//        int count = 0;
+//        List<SensorFunctionStatus> sensorFunctionStatusList = subFunction.getFunctionStatuses();
+//        for (SensorFunctionStatus sensorFunc : sensorFunctionStatusList) {
+//            if (redisService.getCacheObject(sensorFunc.getFunNum()+""+sensorFunc.getDescribe())==null){
+//                logger.error("消息推送funNum存入redis:::"+sensorFunc.getFunNum()+""+sensorFunc.getDescribe());
+//                redisService.setCacheObject(sensorFunc.getFunNum()+""+sensorFunc.getDescribe(),sensorFunc.getFunNum(),15L, TimeUnit.SECONDS);
+//                count++;
+//            }
+//        }
+//        if(count>0){
+//            logger.error("消息推送中.......");
+//            commonSend.send(getFunctionSubTopic(subId), messageBody, SendMode.ONCE);
+//        }
     }
 
     /**