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;