|
|
@ -201,7 +201,7 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
power.setYear(localDate.getYear()); |
|
|
|
power.setYear(localDate.getYear()); |
|
|
|
power.setStrMonth(localDate.getMonthValue() > 9 ? String.valueOf(localDate.getMonthValue()) : "0" + localDate.getMonthValue()); |
|
|
|
power.setStrMonth(localDate.getMonthValue() > 9 ? String.valueOf(localDate.getMonthValue()) : "0" + localDate.getMonthValue()); |
|
|
|
power.setPlanPower((float) plans.stream().filter(o->o.getDateTime().contains(power.getYear() + power.getStrMonth())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
power.setPlanPower((float) plans.stream().filter(o->o.getDateTime().contains(power.getYear() + "-" + power.getStrMonth())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
power.setPower((float) winds.stream().filter(o->o.getFillDate().contains(localDate.getYear() + "-" + power.getStrMonth())).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
power.setPower((float) winds.stream().filter(o->o.getFillDate().contains(localDate.getYear() + "-" + power.getStrMonth())).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
return power; |
|
|
|
return power; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
@ -261,6 +261,8 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
// 集团发电占比
|
|
|
|
// 集团发电占比
|
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(winds.stream().mapToDouble(WindEntity::getPower).sum()) > 0){ |
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(winds.stream().mapToDouble(WindEntity::getPower).sum()) > 0){ |
|
|
|
subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / winds.stream().mapToDouble(WindEntity::getPower).sum() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / winds.stream().mapToDouble(WindEntity::getPower).sum() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
subordinate.setGenerationRate(0.0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 计划发电量查询
|
|
|
|
// 计划发电量查询
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
@ -268,18 +270,24 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
// 发电完成率
|
|
|
|
// 发电完成率
|
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(plan) > 0){ |
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(plan) > 0){ |
|
|
|
subordinate.setGenerationComplete(BigDecimal.valueOf(subordinate.getGeneration() / plan * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
subordinate.setGenerationComplete(BigDecimal.valueOf(subordinate.getGeneration() / plan * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
subordinate.setGenerationComplete(0.0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 风机利用率 : (总时间 - 故障时间) / 总时间
|
|
|
|
// 风机利用率 : (总时间 - 故障时间) / 总时间
|
|
|
|
double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum(); |
|
|
|
double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum(); |
|
|
|
double use = piece.stream().mapToDouble(WindEntity::getAvailable).sum(); |
|
|
|
double use = piece.stream().mapToDouble(WindEntity::getAvailable).sum(); |
|
|
|
if(Math.abs(fault) > 0 ){ |
|
|
|
if(Math.abs(fault) > 0 ){ |
|
|
|
subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
subordinate.setFanUse(0.0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 厂用电率 : (发电量-上网电量+下网电量)/发电量
|
|
|
|
// 厂用电率 : (发电量-上网电量+下网电量)/发电量
|
|
|
|
double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum(); |
|
|
|
double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum(); |
|
|
|
double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum(); |
|
|
|
double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum(); |
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(surf + below) > 0){ |
|
|
|
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()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
subordinate.setFactoryUse(0.0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return subordinate; |
|
|
|
return subordinate; |
|
|
@ -504,7 +512,7 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
areaDuty.setSpeed(winds.stream().mapToDouble(WindEntity::getSpeed).average().orElse(0.0)); |
|
|
|
areaDuty.setSpeed(winds.stream().mapToDouble(WindEntity::getSpeed).average().orElse(0.0)); |
|
|
|
areaDuty.setSurfPower(winds.stream().mapToDouble(WindEntity::getSurfPower).sum()); |
|
|
|
areaDuty.setSurfPower(winds.stream().mapToDouble(WindEntity::getSurfPower).sum()); |
|
|
|
areaDuty.setBelowPower(winds.stream().mapToDouble(WindEntity::getBelowPower).sum()); |
|
|
|
areaDuty.setBelowPower(winds.stream().mapToDouble(WindEntity::getBelowPower).sum()); |
|
|
|
areaDuty.setAvailable(winds.stream().mapToDouble(WindEntity::getAvailable).average().orElse(0.0)); |
|
|
|
areaDuty.setAvailable(winds.stream().mapToDouble(WindEntity::getAvailable).sum()); |
|
|
|
areaDuty.setComprehensivePower(winds.stream().mapToDouble(WindEntity::getComprehensivePower).sum()); |
|
|
|
areaDuty.setComprehensivePower(winds.stream().mapToDouble(WindEntity::getComprehensivePower).sum()); |
|
|
|
areaDuty.setPeakPower(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
areaDuty.setPeakPower(winds.stream().mapToDouble(WindEntity::getPeakPower).average().orElse(0.0)); |
|
|
|
areaDuty.setFaultHours(winds.stream().mapToDouble(WindEntity::getFaultHours).average().orElse(0.0)); |
|
|
|
areaDuty.setFaultHours(winds.stream().mapToDouble(WindEntity::getFaultHours).average().orElse(0.0)); |
|
|
@ -524,7 +532,7 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
if(Math.abs(areaDuty.getGenerateMon()) > 0 && Math.abs(areaDuty.getPlanMon()) > 0){ |
|
|
|
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.setCompleteMonRate(BigDecimal.valueOf(areaDuty.getGenerateMon() / areaDuty.getPlanMon() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
areaDuty.setAvailable(windMons.stream().mapToDouble(WindEntity::getAvailable).average().getAsDouble()); |
|
|
|
areaDuty.setAvailableMon(windMons.stream().mapToDouble(WindEntity::getAvailable).sum()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<WindEntity> windYears = windService.list(new LambdaQueryWrapper<WindEntity>() {{ |
|
|
|
List<WindEntity> windYears = windService.list(new LambdaQueryWrapper<WindEntity>() {{ |
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
|
in(WindEntity::getStationCode,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) |
|
|
@ -976,11 +984,14 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
return new ArrayList<>(); |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> monList = this.mons(1,12,false); |
|
|
|
List<String> monList = this.mons(1,12,false); |
|
|
|
|
|
|
|
// 计划发电量查询
|
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(Collections.singletonList(station.getCode()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
return monList.stream().map(mon->{ |
|
|
|
return monList.stream().map(mon->{ |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
WindGenerationVo generation = new WindGenerationVo(); |
|
|
|
WindGenerationVo generation = new WindGenerationVo(); |
|
|
|
generation.setYear(localDate.getYear()); |
|
|
|
generation.setYear(localDate.getYear()); |
|
|
|
generation.setMon(localDate.getMonthValue() > 9 ? String.valueOf(localDate.getMonthValue()) : "0" + localDate.getMonthValue()); |
|
|
|
generation.setMon(localDate.getMonthValue() > 9 ? String.valueOf(localDate.getMonthValue()) : "0" + localDate.getMonthValue()); |
|
|
|
|
|
|
|
generation.setPlan(plans.stream().filter(o->o.getDateTime().contains(generation.getYear() + "-" + generation.getMon())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
generation.setGeneration(winds.stream().filter(o->o.getFillDate().contains(generation.getYear() + "-" + generation.getMon())).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
generation.setGeneration(winds.stream().filter(o->o.getFillDate().contains(generation.getYear() + "-" + generation.getMon())).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
return generation; |
|
|
|
return generation; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|