|
@@ -74,7 +74,9 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
|
deviceIds.forEach(deviceId -> {
|
|
|
DeviceAlgorithmChargingDto.CountVo countVo = new DeviceAlgorithmChargingDto.CountVo()
|
|
|
.setDeviceId(deviceId)
|
|
|
- .setCount(0);
|
|
|
+ .setCount(0)
|
|
|
+ .setSize(0)
|
|
|
+ .setArrearageBalance(0);
|
|
|
countVos.add(countVo);
|
|
|
});
|
|
|
JMap<Long, DeviceAlgorithmChargingDto.CountVo> cover = countVos.toMap(DeviceAlgorithmChargingDto.CountVo::getDeviceId).cover();
|
|
@@ -91,7 +93,15 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
|
.le(DeviceAlgorithmCharging::getBeginTime, thisTime)
|
|
|
);
|
|
|
JMap<Long, List<DeviceAlgorithmCharging>> group = new JArrayList<>(list).toMap(DeviceAlgorithmCharging::getDeviceId).group();
|
|
|
- group.forEach((deviceId, deviceAlgorithmChargings) -> cover.get(deviceId).setCount(deviceAlgorithmChargings.size()));
|
|
|
+ group.forEach((deviceId, deviceAlgorithmChargings) -> {
|
|
|
+ DeviceAlgorithmChargingDto.CountVo countVo = cover.get(deviceId);
|
|
|
+ countVo.setCount(deviceAlgorithmChargings.size());
|
|
|
+ int size = 0;
|
|
|
+ for (DeviceAlgorithmCharging deviceAlgorithmCharging : deviceAlgorithmChargings) {
|
|
|
+ size += deviceAlgorithmCharging.getUnusedSize();
|
|
|
+ }
|
|
|
+ countVo.setSize(size);
|
|
|
+ });
|
|
|
return R.ok(countVos);
|
|
|
}
|
|
|
|