|
@@ -218,7 +218,7 @@ public class OnlineMonitorImpl implements OnlineMonitorService {
|
|
|
MonitorDataEntity monitorDataEntity = (MonitorDataEntity) ByteArrayUtils.bytesToObject(bytes).get();
|
|
|
SimpleDateFormat formatdate = new SimpleDateFormat("YYYY-MM-dd");//日期算换格式
|
|
|
//计算今日数据
|
|
|
- if(formatdate.format(new Date()).equals(monitorDataEntity.getCollectDate())) {
|
|
|
+ if(formatdate.format(new Date()).equals(formatdate.format(monitorDataEntity.getCollectDate()))) {
|
|
|
//筛选该设备相同属性的值
|
|
|
List<MonitorDataValueEntity> attributeEntities = monitorDataEntity.getDataValues().stream().filter((MonitorDataValueEntity m)
|
|
|
-> m.getAttributeId().equals(monitorData.getAttributeId())).collect(Collectors.toList());
|
|
@@ -275,7 +275,7 @@ public class OnlineMonitorImpl implements OnlineMonitorService {
|
|
|
monitorData.setUnit(attributeEntity.getUnit());
|
|
|
SimpleDateFormat formatdate = new SimpleDateFormat("YYYY-MM-dd");//日期算换格式
|
|
|
//计算今日数据
|
|
|
- if(formatdate.format(new Date()).equals(monitorDataEntity.getCollectDate())) {
|
|
|
+ if(formatdate.format(new Date()).equals(formatdate.format(monitorDataEntity.getCollectDate()))) {
|
|
|
Double attributeValue =0d;
|
|
|
if(attributeEntity.getDataValue() != null && monitorData.getLatestValue() != null){
|
|
|
attributeValue=attributeEntity.getDataValue() - monitorData.getLatestValue();
|