|
|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|