diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java index b0a24f1..5450ff6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java @@ -228,7 +228,7 @@ public class HydroelectricServiceImpl implements HydroelectricService { // 容量 area.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); // 负荷 - area.setLoad(reals.stream().mapToDouble(o->{ + area.setLoad(stationReals.stream().mapToDouble(o->{ if("MW".equalsIgnoreCase(o.getPowerUnit())){ return o.getActivePower() * 1000; } @@ -246,13 +246,13 @@ public class HydroelectricServiceImpl implements HydroelectricService { List targets = (List) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY); if (CollectionUtil.isNotEmpty(targets)) { List stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(targets)) { + if (CollectionUtil.isNotEmpty(stationTargets)) { // 年发电量 - area.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); + area.setGenerateYear(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); // 月发电量 - area.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); + area.setGenerateMon(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); // 日发电量 - area.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); + area.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); // 年计划发电量 area.setGeneratePlanYear(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); if(area.getGeneratePlanYear() <= 0 || area.getGenerateYear() <= 0){ @@ -322,7 +322,7 @@ public class HydroelectricServiceImpl implements HydroelectricService { // 容量 group.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); // 负荷 - group.setLoad(reals.stream().mapToDouble(o->{ + group.setLoad(stationReals.stream().mapToDouble(o->{ if("MW".equalsIgnoreCase(o.getPowerUnit())){ return o.getActivePower() * 1000; } @@ -340,13 +340,13 @@ public class HydroelectricServiceImpl implements HydroelectricService { List targets = (List) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY); if (CollectionUtil.isNotEmpty(targets)) { List stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(targets)) { + if (CollectionUtil.isNotEmpty(stationTargets)) { // 年发电量 - group.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); + group.setGenerateYear(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); // 月发电量 - group.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); + group.setGenerateMon(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); // 日发电量 - group.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); + group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); // 年计划发电量 group.setGeneratePlanYear(planClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy"))); if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){