소스 검색

Merge branch 'activation' into test

李进 1 년 전
부모
커밋
59691beb23
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      device-api-service/src/main/java/com/xy/service/DeviceAlgorithmChargingServiceImpl.java

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