|
@@ -219,13 +219,12 @@ public class OnlineMonitorImpl implements OnlineMonitorService {
|
|
|
-> m.getAttributeId().equals(monitorData.getAttributeId())).collect(Collectors.toList());
|
|
|
MonitorDataValueEntity attributeEntity=attributeEntities.size()>0?attributeEntities.get(0):null;
|
|
|
if (attributeEntity != null) {
|
|
|
- Double attributeDiffValue =0d;
|
|
|
+ Double attributeValue =0d;
|
|
|
if(attributeEntity.getDataValue() != null && monitorData.getLatestValue() != null){
|
|
|
- attributeDiffValue=attributeEntity.getDataValue() - monitorData.getLatestValue();
|
|
|
+ attributeValue=attributeEntity.getDataValue() - monitorData.getLatestValue();
|
|
|
}else if(attributeEntity.getDataValue() != null && monitorData.getLatestValue() == null) {
|
|
|
- attributeDiffValue=attributeEntity.getDataValue();
|
|
|
+ attributeValue=attributeEntity.getDataValue();
|
|
|
}
|
|
|
- Double attributeValue = monitorData.getSumValue() != null ? monitorData.getSumValue() + attributeDiffValue : attributeDiffValue;
|
|
|
switch (monitorData.getAttributeType()) {
|
|
|
case "3":
|
|
|
monDataCol.setYieldWaterUsage(monDataCol.getYieldWaterUsage() != null ? monDataCol.getYieldWaterUsage() + attributeValue : attributeValue);
|
|
@@ -267,13 +266,12 @@ public class OnlineMonitorImpl implements OnlineMonitorService {
|
|
|
-> m.getAttributeId().equals(monitorData.getAttributeId())).collect(Collectors.toList());
|
|
|
MonitorDataValueEntity attributeEntity=attributeEntities.size()>0?attributeEntities.get(0):null;
|
|
|
if (attributeEntity != null) {
|
|
|
- Double attributeDiffValue =0d;
|
|
|
+ Double attributeValue =0d;
|
|
|
if(attributeEntity.getDataValue() != null && monitorData.getLatestValue() != null){
|
|
|
- attributeDiffValue=attributeEntity.getDataValue() - monitorData.getLatestValue();
|
|
|
+ attributeValue=attributeEntity.getDataValue() - monitorData.getLatestValue();
|
|
|
}else if(attributeEntity.getDataValue() != null && monitorData.getLatestValue() == null) {
|
|
|
- attributeDiffValue=attributeEntity.getDataValue();
|
|
|
+ attributeValue=attributeEntity.getDataValue();
|
|
|
}
|
|
|
- Double attributeValue = monitorData.getSumValue() != null ? monitorData.getSumValue() + attributeDiffValue : attributeDiffValue;
|
|
|
//实时数据
|
|
|
monitorData.setDataValue(attributeEntity.getDataValue());
|
|
|
monitorData.setUnit(attributeEntity.getUnit());
|