Browse Source

#风电修改

zhongwei
yang_shj 1 year ago
parent
commit
08eb420319
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java
  2. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

@ -972,7 +972,7 @@ public class HomePageServiceImpl implements IHomePageService {
}
int faInvestment = otherList.stream().mapToInt(OtherEntity::getFaQuantity).sum();
distributionNetworkVo.setFaInvestment(faInvestment);
double onlineRate = otherList.stream().mapToDouble(o-> Double.valueOf(o.getOnlineRate())).average().getAsDouble();;
double onlineRate = otherList.stream().mapToDouble(o-> Double.parseDouble(o.getOnlineRate())).average().getAsDouble();
if(Math.abs(onlineRate) <= 0){
distributionNetworkVo.setOnlineRate("0.0");
countDownLatch.countDown();

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

@ -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());
// 日发电量

Loading…
Cancel
Save