模拟量数据上报修改
This commit is contained in:
parent
41d3be9e1a
commit
4dce76070f
@ -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,18 +255,19 @@ 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));
|
||||
if(fieldName.toLowerCase().equals("iwindspeed")){
|
||||
log.info("风速更新redis数据key:{},value:{}",key,values.get(fieldName));
|
||||
}
|
||||
adminRedisTemplate.mSet(keyValueMap);
|
||||
Iterator<String> archiveKeys = archiveValues.fieldNames();
|
||||
while (archiveKeys.hasNext()) {
|
||||
String fieldName = keysHigh.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));
|
||||
}
|
||||
if (lowKey.contains(fieldName)){
|
||||
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<>();
|
||||
|
Loading…
Reference in New Issue
Block a user