| | |
| | | String curLoc; |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | curLoc = task.getTargLoc(); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) { |
| | | curLoc = task.getTargLoc(); |
| | | if (StringUtils.isBlank(curLoc)) { |
| | | return task; |
| | | } |
| | | } else { |
| | | curLoc = task.getOrgLoc(); |
| | | } |
| | |
| | | } |
| | | |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId())); |
| | | // 空板入库无任务明细,仅更新库位为空板(D)、任务状态为库存更新完成 |
| | | if (TaskType.TASK_TYPE_EMPITY_IN.type.equals(task.getTaskType())) { |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type) |
| | | .set(Loc::getUpdateBy, loginUserId) |
| | | .set(Loc::getUpdateTime, new Date()))) { |
| | | throw new CoolException("空板入库库位状态修改失败!!"); |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getId, task.getId()).set(Task::getTaskStatus, TaskStsType.UPDATED_IN.id))) { |
| | | throw new CoolException("空板入库任务状态修改失败!!"); |
| | | } |
| | | reportInOutResultToCloud(task, loc, Collections.emptyList(), null, true); |
| | | return; |
| | | } |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("任务明细不存在!!"); |
| | | } |