|
@@ -67,13 +67,14 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
|
@PostMapping("check")
|
|
|
@ApiOperation("检查")
|
|
|
public R check(@RequestBody @Validated DeviceAlgorithmChargingDto.Check check) {
|
|
|
+ int yyyyMM = Integer.valueOf(DataTime.getSring("yyyyMM"));
|
|
|
DeviceInfoDto.Vo deviceInfo = deviceInfoService.obj(new DeviceInfoDto.Obj().setDeviceId(check.getDeviceId())).getData();
|
|
|
List<DeviceAlgorithmCharging> deviceAlgorithmChargings = list(new LambdaQueryWrapper<DeviceAlgorithmCharging>()
|
|
|
.eq(DeviceAlgorithmCharging::getDeviceId, deviceInfo.getDeviceId())
|
|
|
.eq(DeviceAlgorithmCharging::getAlgorithmId, deviceInfo.getAlgorithmId())
|
|
|
.gt(DeviceAlgorithmCharging::getUnusedSize, 0)
|
|
|
- .gt(DeviceAlgorithmCharging::getTimeout, 0)
|
|
|
- .in(DeviceAlgorithmCharging::getBeginTime, Arrays.asList(DataTime.getSring("yyyyMM"), -1))
|
|
|
+ .ge(DeviceAlgorithmCharging::getTimeout, yyyyMM)
|
|
|
+ .in(DeviceAlgorithmCharging::getBeginTime, Arrays.asList(yyyyMM, -1))
|
|
|
);
|
|
|
if (!Emptys.check(deviceAlgorithmChargings)) {
|
|
|
throw new CommRuntimeException(R.Enum.ALGORITHM_CHARGING.getCode(), R.Enum.ALGORITHM_CHARGING.getMsg());
|