|
|
|
@ -501,15 +501,7 @@ public class WindHomeServiceImpl implements WindHomeService {
|
|
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),DateUtil.PATTERN_DATE)); |
|
|
|
|
}}); |
|
|
|
|
if(CollectionUtil.isEmpty(winds)){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
areaDuty.setPlan(winds.stream().mapToDouble(WindEntity::getPlan).sum()); |
|
|
|
|
areaDuty.setGenerate(winds.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
|
// 发电量完成率
|
|
|
|
|
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()); |
|
|
|
|
} |
|
|
|
|
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()); |
|
|
|
@ -517,8 +509,35 @@ public class WindHomeServiceImpl implements WindHomeService {
|
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
areaDuty.setPlan(windYears.stream().mapToDouble(WindEntity::getPlan).sum()); |
|
|
|
|
areaDuty.setGenerate(windYears.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
|
// 发电量完成率
|
|
|
|
|
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()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|