From 60bc9b94d032730af165fa6e44552f9a971f5109 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 21 Aug 2024 15:00:41 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=A6=96=E9=A1=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HydroelectricServiceImpl.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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){