|
|
|
@ -109,10 +109,7 @@ public class WindHomeServiceImpl implements WindHomeService {
|
|
|
|
|
@Override |
|
|
|
|
public WindScoreVo KPIs(Long deptId) { |
|
|
|
|
// 查询风电站
|
|
|
|
|
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ |
|
|
|
|
eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE); |
|
|
|
|
eq(StationEntity::getType,HomePageConstant.WIND_POWER); |
|
|
|
|
}}); |
|
|
|
|
List<StationEntity> 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; |
|
|
|
|