模拟数据上报修改
This commit is contained in:
parent
4bcd42fa26
commit
a6feb63e48
@ -240,6 +240,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
||||
JsonNode jsonNode = data.getData();
|
||||
String deviceId = jsonNode.get("deviceId").asText();
|
||||
JsonNode values = jsonNode.get("values");
|
||||
JsonNode archiveValues = jsonNode.get("archiveValues");
|
||||
Long dataTime = jsonNode.get("dataTime").asLong();
|
||||
Map<String, Object> keyValueMap = new HashMap<>();
|
||||
String modelCode = dataService.deviceModelMap.get(deviceId);
|
||||
@ -254,6 +255,12 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
||||
String fieldName = keysHigh.next();
|
||||
String key = String.format("RT:%s:%s", deviceId, fieldName.toLowerCase());
|
||||
keyValueMap.put(key, values.get(fieldName));
|
||||
}
|
||||
Iterator<String> archiveKeys = archiveValues.fieldNames();
|
||||
while (archiveKeys.hasNext()) {
|
||||
String fieldName = archiveKeys.next();
|
||||
String key = String.format("RT:%s:%s", deviceId, fieldName.toLowerCase());
|
||||
keyValueMap.put(key, values.get(fieldName));
|
||||
if (highKey.contains(fieldName)) {
|
||||
highSpeedValueMap.put(fieldName, values.get(fieldName));
|
||||
}
|
||||
@ -261,8 +268,6 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
||||
lowSpeedValueMap.put(fieldName, values.get(fieldName));
|
||||
}
|
||||
}
|
||||
adminRedisTemplate.mSet(keyValueMap);
|
||||
if (jsonNode.get("isStore") != null && jsonNode.get("isStore").asBoolean()) {
|
||||
//更新td
|
||||
if (!highSpeedValueMap.isEmpty()) {
|
||||
List<RTData> highSpeedData = new ArrayList<>();
|
||||
@ -277,7 +282,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
||||
lowSpeedData.add(rtLowData);
|
||||
tdEngineService.updateYCLowValues(lowSpeedData, modelCode);
|
||||
}
|
||||
}
|
||||
adminRedisTemplate.mSet(keyValueMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user