Browse Source

#站点修改测试

zhongwei
yang_shj 1 year ago
parent
commit
cc238b5d54
  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