From 62ae021ac443324692e68e5cf710a5f34daf3af1 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 28 Feb 2024 14:17:46 +0800 Subject: [PATCH] =?UTF-8?q?#=E7=A9=BA=E6=8C=87=E9=92=88bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/main/service/impl/HydropowerServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 796f347..266387d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -1549,10 +1549,13 @@ public class HydropowerServiceImpl implements HydropowerService { // 天气区间 hydropower.setMaxTemp(this.intervalTemp(weekWeather,station.getCode(),true)); hydropower.setMinTemp(this.intervalTemp(weekWeather,station.getCode(),false)); + if(CollectionUtil.isEmpty(reals)){ + return hydropower; + } // 装机容量 - hydropower.setCapacity(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); + hydropower.setCapacity(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept()) && !ObjectUtil.isEmpty(real.getInstalledCapacity())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); // 负荷 - hydropower.setLoad(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum()); + hydropower.setLoad(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept()) && !ObjectUtil.isEmpty(real.getActivePower())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum()); // 出力 if(Math.abs(hydropower.getCapacity()) > 0){ hydropower.setOutput(BigDecimal.valueOf(hydropower.getLoad() / hydropower.getCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());