|
@@ -76,11 +76,7 @@ public class MqttMsgService {
|
|
private void handleOrderEventMessage(String topic, String mqttMessageStr) {
|
|
private void handleOrderEventMessage(String topic, String mqttMessageStr) {
|
|
|
|
|
|
try {
|
|
try {
|
|
- //处理心跳,放入redis
|
|
|
|
- if (Constants.DEV_HEARTBEAT_MESSAGE.equals(mqttMessageStr)) {
|
|
|
|
- redisUtil.hset(RedisKeyConstant.MQTT_DEV_HEARBEAT_INFO, topic, "1", RedisKeyConstant.MQTT_DEV_HEARBEAT_INFO_TIME);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
Map map = JSON.parseObject(mqttMessageStr);
|
|
Map map = JSON.parseObject(mqttMessageStr);
|
|
String type = (String) map.get("type");
|
|
String type = (String) map.get("type");
|
|
@@ -89,6 +85,12 @@ public class MqttMsgService {
|
|
logger.error("不是正确格式的消息");
|
|
logger.error("不是正确格式的消息");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ //处理心跳,放入redis
|
|
|
|
+ if ("HeartBeat".equals(type)) {
|
|
|
|
+ redisUtil.hset(RedisKeyConstant.MQTT_DEV_HEARBEAT_INFO, topic, "1", RedisKeyConstant.MQTT_DEV_HEARBEAT_INFO_TIME);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if(!"BreathHeartRate".equals(type) && !"FallDown".equals(type) && !"StayTooLong".equals(type)){
|
|
if(!"BreathHeartRate".equals(type) && !"FallDown".equals(type) && !"StayTooLong".equals(type)){
|
|
// logger.error("不是要处理的消息");
|
|
// logger.error("不是要处理的消息");
|
|
return;
|
|
return;
|