Browse Source

#开关机告警修改

zhongwei
yang_shj 7 months ago
parent
commit
aebdd02573
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -1384,7 +1384,7 @@ public class RealTargetServiceImpl implements RealTargetService {
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
// 开始日期
calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 24);
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) {
return new ArrayList<>();
@ -1396,7 +1396,7 @@ public class RealTargetServiceImpl implements RealTargetService {
load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0"));
return load;
}).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList());
}).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList());
}
/**

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

@ -280,9 +280,10 @@ public class HzimsDataServiceImpl implements HzimsDataService {
return maps.entrySet().stream().map(entry->{
ActivePowerVo activePower = new ActivePowerVo();
activePower.setHour(entry.getKey());
activePower.setStrHour(entry.getValue().get(0).getStrHour());
activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum()));
return activePower;
}).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList());
}).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList());
}
/**

Loading…
Cancel
Save