Browse Source

#关联值班功率单位问题修复

zhongwei
yang_shj 10 months ago
parent
commit
18b805d7ad
  1. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -870,7 +870,12 @@ public class TargetServiceImpl implements TargetService {
if(CollectionUtil.isEmpty(reals)){
hydropower.setPower(0.0);
}else{
hydropower.setPower(reals.stream().filter(real->real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum());
hydropower.setPower(reals.stream().filter(real->real.getDeptId().equals(station.getRefDept())).mapToDouble(real->{
if("MW".equalsIgnoreCase(real.getPowerUnit())){
return real.getActivePower() * 1000;
}
return real.getActivePower();
}).sum());
}
return hydropower;
})/*.filter(hydropower -> Math.abs(hydropower.getPower()) > 0)*/.sorted(Comparator.comparing(HydropowerTargetVo::getPower).reversed()).collect(Collectors.toList());

Loading…
Cancel
Save