Browse Source

'修改mqtt推送字段值'

james 9 months ago
parent
commit
cc6f7570f0

+ 5 - 5
data-protocol-http/data-protocol-http-biz/src/main/java/com/usky/http/service/impl/TcAepCommandServiceImpl.java

@@ -110,7 +110,7 @@ public class TcAepCommandServiceImpl extends AbstractCrudService<TcAepCommandMap
                     String deviceStatus = "0";
                     String battery = dataMap.get("battery_value").toString();
                     String signal = dataMap.get("signalPower").toString();
-                    String temperature = "";
+                    String temperature = "0.0";
                     String smoke = dataMap.get("smoke_value").toString();
                     String deviceAlarmData = "{\"devId\":\""+deviceId+"\",\"connType\":\"N\""+",\"deviceName\":\""+deviceName+"\",\"alarams\":[{\"dp\":[{\"property\":\"烟雾报警\",\"serial\":\"311\",\"value\":\"报警\",\"status\":\"0\" }],\"deviceName\":\""+
                             deviceName+"\",\"timeStamp\":\""+timestamp+"\",\"deviceModel\":\"\",\"deviceType\":\""+deviceType+"\",\"devId\":\""+deviceId+"\"}],\"type\":\"ALARM\",\"timeStamp\":\""+timestamp+"\"}";
@@ -123,7 +123,7 @@ public class TcAepCommandServiceImpl extends AbstractCrudService<TcAepCommandMap
                 String deviceStatus = "0";
                 String battery = dataMap.get("battery_value").toString();
                 String signal = dataMap.get("rsrp").toString();
-                String temperature = "";
+                String temperature = "0.0";
                 String smoke = "0";
                 String deviceInfoData = "{\"devId\":\""+deviceId+"\",\"connType\":\"N\""+",\"deviceName\":\""+deviceName+"\",\"devs\":[{\"dp\":[{\"property\":\"状态\",\"serial\":\"301\",\"value\":\""
                         +deviceStatus+"\"},{\"property\":\"剩余电量\",\"serial\":\"302\",\"value\":\""+battery+"\"},{\"property\":\"无线信号\",\"serial\":\"303\",\"value\":\""+signal+
@@ -162,10 +162,10 @@ public class TcAepCommandServiceImpl extends AbstractCrudService<TcAepCommandMap
         if(messageType.equals("dataReport")){ //info
             Map<String,Object> dataMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("payload")));
             String deviceStatus = "0";
-            String battery = "";
+            String battery = "0.0";
             String signal = dataMap.get("rsrp").toString();
-            String temperature = "";
-            String smoke = "";
+            String temperature = "0.0";
+            String smoke = "0";
             String deviceInfoData = "{\"devId\":\""+deviceId+"\",\"connType\":\"N\""+",\"deviceName\":\""+deviceName+"\",\"devs\":[{\"dp\":[{\"property\":\"状态\",\"serial\":\"301\",\"value\":\""
                     +deviceStatus+"\"},{\"property\":\"剩余电量\",\"serial\":\"302\",\"value\":\""+battery+"\"},{\"property\":\"无线信号\",\"serial\":\"303\",\"value\":\""+signal+
                     "\"},{\"property\":\"温度\",\"serial\":\"304\",\"value\":\""+temperature+"\"},{\"property\":\"浓度\",\"serial\":\"305\",\"value\":\""+smoke+"\"}],\"deviceName\":\""+deviceName+"\",\"timeStamp\":\""+timestamp+"\",\"deviceModel\":\"\",\"deviceType\":\""+deviceType+"\",\"devId\":\""+deviceId+"\"}],\"type\":\"INFO\",\"timeStamp\":\""+timestamp+"\"}";

BIN
data-protocol-http/data-protocol-http-biz/target/classes/com/usky/http/service/impl/TcAepCommandServiceImpl.class