Bladeren bron

Merge branch 'dev' of http://192.168.1.43:3000/v2/zd-parents into dev

chaiyunlong 3 jaren geleden
bovenliggende
commit
3fcb3ddcb0

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHardwareController.java

@@ -260,6 +260,7 @@ public class LabHardwareController extends BaseController {
         List<Long> ids = new ArrayList<>();
         ids.add(1L);//电源开关
         ids.add(2L);//智能通风
+        ids.add(10L);//一键灭火
         ytjVo.setIds(ids);
         List<LabHardware> listkzsb=labHardwareService.selectNewLabHardwareByTypes(ytjVo);
 

+ 6 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mqtt/config/MqttConfig.java

@@ -272,6 +272,11 @@ public class MqttConfig {
                     receivedTopic = receivedTopic.substring(receivedTopic.lastIndexOf("/") + 1, receivedTopic.length());
                     //根据状态指令获取主机状态
                     JSONObject jsonObject = FireLaborUtil.getFireStatus(messageStr);
+                    //redis存值 采集器编号:主机状态json
+                    redisService.setCacheObject(receivedTopic, jsonObject, 1L, TimeUnit.MINUTES);
+                    //redis存值 灭火主机响应时间
+                    redisService.setCacheObject(CacheConstants.FIRE_DEVICE_RESPOND_TIME, System.currentTimeMillis(), 1L, TimeUnit.MINUTES);
+
                     Integer fireNumber = Integer.valueOf(jsonObject.get("fireNumber").toString());
                     //灭火主机发生预警
                     if (fireNumber > 0) {
@@ -291,11 +296,7 @@ public class MqttConfig {
                             }
                         }
                     }
-                    //redis存值 采集器编号:主机状态json
-                    redisService.setCacheObject(receivedTopic, jsonObject, 1L, TimeUnit.MINUTES);
-                    //redis存值 灭火主机响应时间
-                    redisService.setCacheObject(CacheConstants.FIRE_DEVICE_RESPOND_TIME, System.currentTimeMillis(), 1L, TimeUnit.MINUTES);
-                }
+                  }
 
                 // TODO
 //                MessageBody messageBody = JSONObject.parseObject(messageStr, MessageBody.class);