|
|
@@ -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);
|