Browse Source

Merge remote-tracking branch 'origin/prod' into prod

zhongwei
tyty 1 year ago
parent
commit
2e6d7d01d4
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

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

@ -1149,7 +1149,7 @@ public class HydropowerServiceImpl implements HydropowerService {
long on = reals.stream().filter(real -> entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId()) && real.getState()).count(); long on = reals.stream().filter(real -> entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId()) && real.getState()).count();
long sum = reals.stream().filter(real->entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).count(); long sum = reals.stream().filter(real->entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).count();
if(Math.abs(sum) > 0){ if(Math.abs(sum) > 0){
scale.setDeviceUse(BigDecimal.valueOf(on / sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); scale.setDeviceUse(BigDecimal.valueOf(on / (double)sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
} }
} }
return scale; return scale;

Loading…
Cancel
Save