|
|
@ -501,24 +501,43 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),DateUtil.PATTERN_DATE)); |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),DateUtil.PATTERN_DATE)); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(winds)){ |
|
|
|
if(CollectionUtil.isNotEmpty(winds)){ |
|
|
|
|
|
|
|
areaDuty.setSpeed(winds.stream().mapToDouble(WindEntity::getPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setSurfPower(winds.stream().mapToDouble(WindEntity::getSurfPower).sum()); |
|
|
|
|
|
|
|
areaDuty.setBelowPower(winds.stream().mapToDouble(WindEntity::getBelowPower).sum()); |
|
|
|
|
|
|
|
areaDuty.setAvailable(winds.stream().mapToDouble(WindEntity::getAvailable).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setComprehensivePower(winds.stream().mapToDouble(WindEntity::getComprehensivePower).sum()); |
|
|
|
|
|
|
|
areaDuty.setPeakPower(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setFaultHours(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<WindEntity> windMons = windService.list(new LambdaQueryWrapper<WindEntity>() {{ |
|
|
|
|
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
|
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy-MM")); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(windMons)){ |
|
|
|
|
|
|
|
areaDuty.setGenerateMon(windMons.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
|
|
|
|
// 月计划发电量
|
|
|
|
|
|
|
|
areaDuty.setPlanMon(windMons.stream().mapToDouble(WindEntity::getPlan).sum()); |
|
|
|
|
|
|
|
// 月发电量完成率
|
|
|
|
|
|
|
|
if(Math.abs(areaDuty.getGenerateMon()) > 0 && Math.abs(areaDuty.getPlanMon()) > 0){ |
|
|
|
|
|
|
|
areaDuty.setCompleteMonRate(BigDecimal.valueOf(areaDuty.getGenerateMon() / areaDuty.getPlanMon() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
areaDuty.setAvailable(windMons.stream().mapToDouble(WindEntity::getAvailable).average().getAsDouble()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<WindEntity> windYears = windService.list(new LambdaQueryWrapper<WindEntity>() {{ |
|
|
|
|
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
|
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
if(CollectionUtil.isEmpty(windYears)){ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
areaDuty.setPlan(winds.stream().mapToDouble(WindEntity::getPlan).sum()); |
|
|
|
areaDuty.setPlan(windYears.stream().mapToDouble(WindEntity::getPlan).sum()); |
|
|
|
areaDuty.setGenerate(winds.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
areaDuty.setGenerate(windYears.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
// 发电量完成率
|
|
|
|
// 发电量完成率
|
|
|
|
if(Math.abs(areaDuty.getPlan()) > 0 && Math.abs(areaDuty.getGenerate()) > 0){ |
|
|
|
if(Math.abs(areaDuty.getPlan()) > 0 && Math.abs(areaDuty.getGenerate()) > 0){ |
|
|
|
areaDuty.setGenerateComplete(BigDecimal.valueOf(areaDuty.getGenerate() / areaDuty.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
areaDuty.setGenerateComplete(BigDecimal.valueOf(areaDuty.getGenerate() / areaDuty.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
areaDuty.setSpeed(winds.stream().mapToDouble(WindEntity::getPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setSurfPower(winds.stream().mapToDouble(WindEntity::getSurfPower).sum()); |
|
|
|
|
|
|
|
areaDuty.setBelowPower(winds.stream().mapToDouble(WindEntity::getBelowPower).sum()); |
|
|
|
|
|
|
|
areaDuty.setAvailable(winds.stream().mapToDouble(WindEntity::getAvailable).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setComprehensivePower(winds.stream().mapToDouble(WindEntity::getComprehensivePower).sum()); |
|
|
|
|
|
|
|
areaDuty.setPeakPower(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setFaultHours(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setAccuracy(winds.stream().mapToDouble(WindEntity::getAccuracy).average().orElse(0.0)); |
|
|
|
|
|
|
|
areaDuty.setUltraShortAccuracy(winds.stream().mapToDouble(WindEntity::getUltraShortAccuracy).average().orElse(0.0)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|