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 * @return
*/ */
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) { private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
Calendar calendar = Calendar.getInstance(); String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
calendar.add(Calendar.HOUR_OF_DAY,-24);
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) { 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<>(); return new ArrayList<>();
} }
List<ActivePowerVo> actives = 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)){ if(CollectionUtil.isEmpty(actives)){
return new ArrayList<>(); return new ArrayList<>();
} }
@ -282,7 +282,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
activePower.setHour(entry.getKey()); activePower.setHour(entry.getKey());
activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum())); activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum()));
return activePower; return activePower;
}).collect(Collectors.toList()); }).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList());
} }
/** /**

Loading…
Cancel
Save