| | |
| | | throw new CoolException("任务创建失败!!"); |
| | | } |
| | | |
| | | if (!LocUtils.isShallowLoc(loc.getCode())) { |
| | | //获取深库位对应浅库位 |
| | | String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); |
| | | Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); |
| | | if (Objects.isNull(one)) { |
| | | throw new CoolException("对应库位不存在!!"); |
| | | } |
| | | Task workTask = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, one.getBarcode())); |
| | | if (Objects.isNull(workTask)) { |
| | | map.setOrgLoc(one.getCode()); |
| | | //优先生成移库任务 |
| | | if (one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | moveTask = genMoveTask(map, loginUserId); |
| | | } |
| | | } else { |
| | | workTask.setSort(task.getSort() + 1).setParentId(task.getId()); |
| | | if (!taskService.updateById(workTask)) { |
| | | throw new CoolException("优先级修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | // if (!LocUtils.isShallowLoc(loc.getCode())) { |
| | | // //获取深库位对应浅库位 |
| | | // String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); |
| | | // Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); |
| | | // if (Objects.isNull(one)) { |
| | | // throw new CoolException("对应库位不存在!!"); |
| | | // } |
| | | // Task workTask = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, one.getBarcode())); |
| | | // if (Objects.isNull(workTask)) { |
| | | // map.setOrgLoc(one.getCode()); |
| | | // //优先生成移库任务 |
| | | // if (one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | // moveTask = genMoveTask(map, loginUserId); |
| | | // } |
| | | // } else { |
| | | // workTask.setSort(task.getSort() + 1).setParentId(task.getId()); |
| | | // if (!taskService.updateById(workTask)) { |
| | | // throw new CoolException("优先级修改失败!!"); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if (!Objects.isNull(moveTask.getId())) { |
| | | moveTask.setParentId(task.getId()).setSort(moveTask.getSort() + 1); |