|
|
@ -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; |
|
|
|