Преглед изворни кода

Merge branch 'activation' into test

李进 пре 1 година
родитељ
комит
59691beb23

+ 3 - 2
device-api-service/src/main/java/com/xy/service/DeviceAlgorithmChargingServiceImpl.java

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