| | |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type).set(Loc::getBarcode, param.getContainerNo()))) { |
| | | Loc taskLoc = locService.getOne(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getCode, task.getTargLoc()) |
| | | .last("limit 1"), false); |
| | | if (Objects.isNull(taskLoc)) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | | taskLoc.setUseStatus(LocStsType.LOC_STS_TYPE_S.type) |
| | | .setBarcode(param.getContainerNo()) |
| | | .setUpdateBy(loginUserId) |
| | | .setUpdateTime(new Date()); |
| | | if (!locService.updateById(taskLoc)) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | | return R.ok("任务生成完毕!"); |