| | |
| | | task.setSort(i); |
| | | } |
| | | } |
| | | // else if (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | // //如果为在库状态,生成移库任务 |
| | | // LocToTaskParams params = new LocToTaskParams(); |
| | | // params.setOrgLoc(curLoc); |
| | | // //生成移深库位任务 |
| | | // Task moveTask = locItemService.genMoveTask(params, loginUserId); |
| | | // moveTask.setTaskType(task.getSort() + 1); |
| | | // |
| | | // return moveTask; |
| | | // } |
| | | } else { |
| | | //浅库位,判断深对应深库位是否为空,如果为空生成一个移库任务,将托盘送入深库位 |
| | | String deepLoc = LocUtils.getDeepLoc(curLoc); |
| | |
| | | throw new CoolException("任务已处执行状态不可取消!!"); |
| | | } |
| | | for (Task task : tasks) { |
| | | //取消移库任务 |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) && task.getTaskStatus().equals(TaskStsType.GENERATE_OUT.id)) { |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getCode, task.getOrgLoc()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) { |
| | | throw new CoolException("源库位状态修改失败!!"); |
| | | } |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()).set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type))) { |
| | | throw new CoolException("移库目标库位状态修改失败!!"); |
| | | } |
| | | |
| | | Task outTask = taskService.getById(task.getParentId()); |
| | | if (!Objects.isNull(outTask)) { |
| | | LocToTaskParams params = new LocToTaskParams(); |
| | | params.setOrgLoc(task.getOrgLoc()).setSiteNo(task.getOrgSite()); |
| | | //生成移深库位任务 |
| | | Task moveTask = locItemService.genMoveTask(params, loginUserId); |
| | | moveTask.setSort(task.getSort() + 1).setParentId(outTask.getId()); |
| | | if (!this.updateById(moveTask)) { |
| | | throw new CoolException("任务信息修改失败!!"); |
| | | } |
| | | outTask.setParentId(moveTask.getId()); |
| | | if (!this.updateById(outTask)) { |
| | | throw new CoolException("任务信息修改失败!!"); |
| | | |
| | | } |
| | | |
| | | } else { |
| | | throw new CoolException("无法生成新的移库任务,取消失败!!"); |
| | | } |
| | | } |
| | | |
| | | if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) { |
| | | BasStation basStation = null; |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) { |
| | |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) |
| | | ) { |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)) { |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, task.getTargLoc()) |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type)); |