添加空值过滤
This commit is contained in:
parent
f3e6002e17
commit
c09c63313f
|
@ -86,11 +86,13 @@ public class BusinessMessageHandlerListener implements BatchMessageListener {
|
|||
String wellStatusKey = getWellStatusKey(device);
|
||||
//比对新旧数据,看开关状态是否一致
|
||||
if (Objects.nonNull(oldObject.getString(wellStatusKey)) && !Objects.equals(oldObject.getString(wellStatusKey), newObject.getString(wellStatusKey))) {
|
||||
deviceWellStatusMap.put(Long.valueOf(deviceId), getWellStatusValue(device, newObject, wellStatusKey));
|
||||
|
||||
if (Objects.isNull(newObject.getInteger(wellStatusKey))) {
|
||||
Integer wellStatusValue = getWellStatusValue(device, newObject, wellStatusKey);
|
||||
if (Objects.isNull(wellStatusValue)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
deviceWellStatusMap.put(Long.valueOf(deviceId), wellStatusValue);
|
||||
|
||||
//记录开关井状态及对应的套压油压数据
|
||||
SwitchStatusExport switchStatusExport = new SwitchStatusExport();
|
||||
switchStatusExport.setId(snowflakeConfig.snowflakeId());
|
||||
|
@ -100,7 +102,7 @@ public class BusinessMessageHandlerListener implements BatchMessageListener {
|
|||
switchStatusExport.setOilPressure(newObject.getString("oilPressure"));
|
||||
switchStatusExport.setBlockId(device.getGasWell().getBlockId());
|
||||
if (newObject.getInteger(wellStatusKey) != null) {
|
||||
switchStatusExport.setSwitchStatus(getWellStatusValue(device, newObject, wellStatusKey) == 1 ? "开井" : "关井");
|
||||
switchStatusExport.setSwitchStatus(wellStatusValue == 1 ? "开井" : "关井");
|
||||
}
|
||||
switchStatusExportList.add(switchStatusExport);
|
||||
}
|
||||
|
@ -127,12 +129,8 @@ public class BusinessMessageHandlerListener implements BatchMessageListener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue