Browse Source

#功率统计

zhongwei
yang_shj 8 months ago
parent
commit
c9c5b931d6
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  2. 4
      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

@ -1123,9 +1123,7 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return
*/
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY,-24);
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) {

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

@ -272,7 +272,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
return new ArrayList<>();
}
List<ActivePowerVo> actives = new ArrayList<>();
targetList.stream().filter(o->o.getDeptId().equals(refDept)).map(HydropowerUnitTargetVo::getActivePowerVoList).collect(Collectors.toList()).forEach(actives::addAll);
targetList.stream().filter(o-> CollectionUtil.isNotEmpty(o.getActivePowerVoList()) && ObjectUtil.isNotEmpty(o.getDeptId()) && o.getDeptId().equals(refDept)).map(HydropowerUnitTargetVo::getActivePowerVoList).collect(Collectors.toList()).forEach(actives::addAll);
if(CollectionUtil.isEmpty(actives)){
return new ArrayList<>();
}
@ -282,7 +282,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
activePower.setHour(entry.getKey());
activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum()));
return activePower;
}).collect(Collectors.toList());
}).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList());
}
/**

Loading…
Cancel
Save