From 18b805d7ad5d5c85e351aad17b702e6087b27b25 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 8 Apr 2024 09:06:54 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=85=B3=E8=81=94=E5=80=BC=E7=8F=AD=E5=8A=9F?= =?UTF-8?q?=E7=8E=87=E5=8D=95=E4=BD=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/census/service/impl/TargetServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index e3c106d..b6d9698 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -870,7 +870,12 @@ public class TargetServiceImpl implements TargetService { if(CollectionUtil.isEmpty(reals)){ hydropower.setPower(0.0); }else{ - hydropower.setPower(reals.stream().filter(real->real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum()); + hydropower.setPower(reals.stream().filter(real->real.getDeptId().equals(station.getRefDept())).mapToDouble(real->{ + if("MW".equalsIgnoreCase(real.getPowerUnit())){ + return real.getActivePower() * 1000; + } + return real.getActivePower(); + }).sum()); } return hydropower; })/*.filter(hydropower -> Math.abs(hydropower.getPower()) > 0)*/.sorted(Comparator.comparing(HydropowerTargetVo::getPower).reversed()).collect(Collectors.toList());