Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
3eb790acdb
@ -240,6 +240,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
JsonNode jsonNode = data.getData();
|
JsonNode jsonNode = data.getData();
|
||||||
String deviceId = jsonNode.get("deviceId").asText();
|
String deviceId = jsonNode.get("deviceId").asText();
|
||||||
JsonNode values = jsonNode.get("values");
|
JsonNode values = jsonNode.get("values");
|
||||||
|
JsonNode archiveValues = jsonNode.get("archiveValues");
|
||||||
Long dataTime = jsonNode.get("dataTime").asLong();
|
Long dataTime = jsonNode.get("dataTime").asLong();
|
||||||
Map<String, Object> keyValueMap = new HashMap<>();
|
Map<String, Object> keyValueMap = new HashMap<>();
|
||||||
String modelCode = dataService.deviceModelMap.get(deviceId);
|
String modelCode = dataService.deviceModelMap.get(deviceId);
|
||||||
@ -254,6 +255,12 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
String fieldName = keysHigh.next();
|
String fieldName = keysHigh.next();
|
||||||
String key = String.format("RT:%s:%s", deviceId, fieldName.toLowerCase());
|
String key = String.format("RT:%s:%s", deviceId, fieldName.toLowerCase());
|
||||||
keyValueMap.put(key, values.get(fieldName));
|
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)) {
|
if (highKey.contains(fieldName)) {
|
||||||
highSpeedValueMap.put(fieldName, values.get(fieldName));
|
highSpeedValueMap.put(fieldName, values.get(fieldName));
|
||||||
}
|
}
|
||||||
@ -261,8 +268,6 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
lowSpeedValueMap.put(fieldName, values.get(fieldName));
|
lowSpeedValueMap.put(fieldName, values.get(fieldName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adminRedisTemplate.mSet(keyValueMap);
|
|
||||||
if (jsonNode.get("isStore") != null && jsonNode.get("isStore").asBoolean()) {
|
|
||||||
//更新td
|
//更新td
|
||||||
if (!highSpeedValueMap.isEmpty()) {
|
if (!highSpeedValueMap.isEmpty()) {
|
||||||
List<RTData> highSpeedData = new ArrayList<>();
|
List<RTData> highSpeedData = new ArrayList<>();
|
||||||
@ -277,7 +282,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
lowSpeedData.add(rtLowData);
|
lowSpeedData.add(rtLowData);
|
||||||
tdEngineService.updateYCLowValues(lowSpeedData, modelCode);
|
tdEngineService.updateYCLowValues(lowSpeedData, modelCode);
|
||||||
}
|
}
|
||||||
}
|
adminRedisTemplate.mSet(keyValueMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user