|
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
-import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -67,14 +66,18 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
@PostMapping("check")
|
|
@PostMapping("check")
|
|
@ApiOperation("检查")
|
|
@ApiOperation("检查")
|
|
public R check(@RequestBody @Validated DeviceAlgorithmChargingDto.Check check) {
|
|
public R check(@RequestBody @Validated DeviceAlgorithmChargingDto.Check check) {
|
|
- int yyyyMM = Integer.valueOf(DataTime.getSring("yyyyMM"));
|
|
|
|
|
|
+ int yyyyMMdd = Integer.valueOf(DataTime.getSring("yyyyMMdd"));
|
|
DeviceInfoDto.Vo deviceInfo = deviceInfoService.obj(new DeviceInfoDto.Obj().setDeviceId(check.getDeviceId())).getData();
|
|
DeviceInfoDto.Vo deviceInfo = deviceInfoService.obj(new DeviceInfoDto.Obj().setDeviceId(check.getDeviceId())).getData();
|
|
List<DeviceAlgorithmCharging> deviceAlgorithmChargings = list(new LambdaQueryWrapper<DeviceAlgorithmCharging>()
|
|
List<DeviceAlgorithmCharging> deviceAlgorithmChargings = list(new LambdaQueryWrapper<DeviceAlgorithmCharging>()
|
|
.eq(DeviceAlgorithmCharging::getDeviceId, deviceInfo.getDeviceId())
|
|
.eq(DeviceAlgorithmCharging::getDeviceId, deviceInfo.getDeviceId())
|
|
.eq(DeviceAlgorithmCharging::getAlgorithmId, deviceInfo.getAlgorithmId())
|
|
.eq(DeviceAlgorithmCharging::getAlgorithmId, deviceInfo.getAlgorithmId())
|
|
.gt(DeviceAlgorithmCharging::getUnusedSize, 0)
|
|
.gt(DeviceAlgorithmCharging::getUnusedSize, 0)
|
|
- .ge(DeviceAlgorithmCharging::getTimeout, yyyyMM)
|
|
|
|
- .in(DeviceAlgorithmCharging::getBeginTime, Arrays.asList(yyyyMM, -1))
|
|
|
|
|
|
+ .and(deviceAlgorithmChargingLambdaQueryWrapper -> deviceAlgorithmChargingLambdaQueryWrapper
|
|
|
|
+ .ge(DeviceAlgorithmCharging::getTimeout, yyyyMMdd)
|
|
|
|
+ .or()
|
|
|
|
+ .eq(DeviceAlgorithmCharging::getTimeout, -1)
|
|
|
|
+ )
|
|
|
|
+ .ge(DeviceAlgorithmCharging::getBeginTime, yyyyMMdd)
|
|
);
|
|
);
|
|
if (!Emptys.check(deviceAlgorithmChargings)) {
|
|
if (!Emptys.check(deviceAlgorithmChargings)) {
|
|
throw new CommRuntimeException(R.Enum.ALGORITHM_CHARGING.getCode(), R.Enum.ALGORITHM_CHARGING.getMsg());
|
|
throw new CommRuntimeException(R.Enum.ALGORITHM_CHARGING.getCode(), R.Enum.ALGORITHM_CHARGING.getMsg());
|