From 33dfcc079135b22b7a82015d320505dc1b80efcf Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 31 Jul 2023 10:56:53 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=A3=8E=E7=94=B5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/main/service/impl/WindHomeServiceImpl.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java index 55da5b5..7f22d06 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java @@ -109,10 +109,7 @@ public class WindHomeServiceImpl implements WindHomeService { @Override public WindScoreVo KPIs(Long deptId) { // 查询风电站 - List stations = stationService.list(new LambdaQueryWrapper() {{ - eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE); - eq(StationEntity::getType,HomePageConstant.WIND_POWER); - }}); + List stations = stationService.getHomeStationList(deptId,Collections.singletonList(HomePageConstant.WIND_POWER),HomePageConstant.HYDROPOWER_SERVETYPE); if(CollectionUtil.isEmpty(stations)){ return new WindScoreVo(); } @@ -268,14 +265,15 @@ public class WindHomeServiceImpl implements WindHomeService { } // 风机利用率 : (总时间 - 故障时间) / 总时间 double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum(); + double use = piece.stream().mapToDouble(WindEntity::getAvailable).sum(); if(Math.abs(fault) > 0 ){ - subordinate.setFanUse(BigDecimal.valueOf(fault / (30 * 24) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); } // 厂用电率 : (发电量-上网电量+下网电量)/发电量 double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum(); double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum(); if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(surf + below) > 0){ - subordinate.setFactoryUse(BigDecimal.valueOf(subordinate.getGeneration() - surf + below / subordinate.getGeneration() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setFactoryUse(BigDecimal.valueOf((subordinate.getGeneration() - surf + below) / subordinate.getGeneration() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); } } return subordinate;