|
|
|
@ -137,7 +137,7 @@ public class WindHomeServiceImpl implements WindHomeService {
|
|
|
|
|
score.setPlanYear(yearPlans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
|
// 年发电完成率
|
|
|
|
|
if(Math.abs(score.getGenerateYear()) > 0 && Math.abs(score.getPlanYear()) > 0){ |
|
|
|
|
score.setCompleteRate(BigDecimal.valueOf(score.getGenerateYear() / score.getPlanYear() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
score.setCompleteRate(BigDecimal.valueOf(score.getGenerateYear() / score.getPlanYear() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
|
} |
|
|
|
|
// 月发电量
|
|
|
|
|
score.setGenerateMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
@ -145,10 +145,13 @@ public class WindHomeServiceImpl implements WindHomeService {
|
|
|
|
|
score.setPlanMon(yearPlans.stream().filter(o->o.getDateTime().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
|
// 月发电量完成率
|
|
|
|
|
if(Math.abs(score.getGenerateMon()) > 0 && Math.abs(score.getPlanMon()) > 0){ |
|
|
|
|
score.setCompleteMonRate(BigDecimal.valueOf(score.getGenerateMon() / score.getPlanMon() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
|
score.setCompleteMonRate(BigDecimal.valueOf(score.getGenerateMon() / score.getPlanMon() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
|
} |
|
|
|
|
// 月平均风速
|
|
|
|
|
score.setSpeedRate(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average().getAsDouble()); |
|
|
|
|
OptionalDouble speed = winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average();; |
|
|
|
|
if(speed.isPresent()){ |
|
|
|
|
score.setSpeedRate(speed.getAsDouble()); |
|
|
|
|
} |
|
|
|
|
// 月利用小时
|
|
|
|
|
score.setAvailableMon(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getAvailable).sum()); |
|
|
|
|
// 日发电量
|
|
|
|
|