| | |
| | | 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); |
| | |
| | | } |
| | | taskItems.add(taskItem); |
| | | |
| | | Double qty = Math.round((item.getWorkQty() + item.getOutQty()) * 10000) / 10000.0; |
| | | Double qty = Math.round((item.getWorkQty() + item.getOutQty()) * 100) / 100.0; |
| | | LocItem locItem = locItemService.getById(item.getId()); |
| | | if (Objects.isNull(locItem)) { |
| | | throw new CoolException("库存信息不存在!"); |
| | |
| | | } |
| | | |
| | | if (locItem.getAnfme().compareTo(qty) < 0) { |
| | | Double minusQty = Math.round((locItem.getAnfme() - locItem.getWorkQty()) * 10000) / 10000.0; |
| | | Double minusQty = Math.round((locItem.getAnfme() - locItem.getWorkQty()) * 100) / 100.0; |
| | | item.setWorkQty(minusQty); |
| | | } else { |
| | | item.setWorkQty(qty); |