|
|
@@ -33,6 +33,7 @@ import org.springframework.integration.mqtt.support.MqttHeaders;
|
|
|
import org.springframework.messaging.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -268,6 +269,8 @@ public class MqttConfig {
|
|
|
TerminalRouter.routerMap.get("HxpLockService").offLine(relayCode);
|
|
|
}
|
|
|
}}else if(receivedTopic.startsWith(MqttConstants.TOPIC_FIRE_DEVICE_RECEIVE)){
|
|
|
+ String messageStrTest = byte2Hex(message.getPayload().toString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ logger.info("灭火消息返回,"+messageStrTest);
|
|
|
logger.info("灭火消息消费,receivedTopic:" + receivedTopic + " messageStr:" + messageStr);
|
|
|
//返回非指令时不向下执行
|
|
|
if(receivedTopic!=null && receivedTopic.length()<30){
|
|
|
@@ -283,6 +286,7 @@ public class MqttConfig {
|
|
|
redisService.setCacheObject(receivedTopic, jsonObject, 1L, TimeUnit.MINUTES);
|
|
|
//redis存值 灭火主机响应时间
|
|
|
redisService.setCacheObject(CacheConstants.FIRE_DEVICE_RESPOND_TIME+receivedTopic, System.currentTimeMillis(), 1L, TimeUnit.MINUTES);
|
|
|
+ logger.info("灭火消息,redis存值完毕========");
|
|
|
|
|
|
Integer fireNumber = Integer.valueOf(jsonObject.get("fireNumber").toString());
|
|
|
//灭火主机发生预警
|
|
|
@@ -319,6 +323,7 @@ public class MqttConfig {
|
|
|
}
|
|
|
|
|
|
public static String byte2Hex(byte[] bytes) {
|
|
|
+ logger.info("byte长度:"+bytes.length);
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
String temp;
|
|
|
for (byte aByte : bytes) {
|