|
@@ -36,12 +36,15 @@ public class Info implements MqttStrategy {
|
|
|
|
|
|
public String disposeMessage(MqttBaseVO mqttBaseVO) {
|
|
|
try {
|
|
|
+ String[] topics = mqttBaseVO.getTopic().toString().split("/");
|
|
|
+ String topic_deviceUUID = topics[3];
|
|
|
Map<String, String> tags = new HashMap<>();
|
|
|
Map<String, Object> fields = new HashMap<>();
|
|
|
Map map_data = JsonUtils.fromJson(mqttBaseVO.getData().toString(), Map.class);
|
|
|
String productCode = map_data.get("productCode").toString().toLowerCase();
|
|
|
|
|
|
long timestamp = Long.valueOf(map_data.get("timestamp").toString());
|
|
|
+ String deviceUuid = map_data.get("deviceUuid").toString();
|
|
|
|
|
|
Object tg = JSONObject.toJSONString(map_data.get("tags"));
|
|
|
JSONObject tag = JSON.parseObject(tg.toString());
|
|
@@ -56,7 +59,7 @@ public class Info implements MqttStrategy {
|
|
|
}
|
|
|
|
|
|
DeviceDataWriteVO deviceDataWriteVO = new DeviceDataWriteVO();
|
|
|
- deviceDataWriteVO.setDeviceUUId("");
|
|
|
+ deviceDataWriteVO.setDeviceUUId(deviceUuid);
|
|
|
deviceDataWriteVO.setProductCode(productCode);
|
|
|
deviceDataWriteVO.setTimestamp(timestamp);
|
|
|
deviceDataWriteVO.setTags(tags);
|