| | |
| | | } |
| | | |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId())); |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("任务明细不存在!!"); |
| | | |
| | | if (!taskItems.isEmpty()) { |
| | | //移库有可能是空板 |
| | | try { |
| | | //更新库位明细 |
| | | saveLocItem(taskItems, task.getId()); |
| | | } catch (Exception e) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | |
| | | if (!locItemService.remove(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, task.getOrgLoc()))) { |
| | | throw new CoolException("源库位明细删除失败!"); |
| | | } |
| | | |
| | | } |
| | | try { |
| | | //更新库位明细 |
| | | saveLocItem(taskItems, task.getId()); |
| | | } catch (Exception e) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | // /**对任务明细按组拖明细进行分组*/ |
| | | // try { |
| | | // //保存库存明细 |
| | | // saveStockItems(taskItems, null, null, pakinItem.getWkType(), pakinItem.getType()); |
| | | // } catch (Exception e) { |
| | | // log.error("<UNK>", e); |
| | | // throw new CoolException(e.getMessage()); |
| | | // } |
| | | |
| | | /**修改库位状态为F.在库*/ |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .set(Loc::getBarcode, task.getBarcode()) |
| | |
| | | throw new CoolException("库位状态修改失败!!"); |
| | | } |
| | | |
| | | if (!locItemService.remove(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, task.getOrgLoc()))) { |
| | | throw new CoolException("源库位明细删除失败!"); |
| | | } |
| | | |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getId, task.getId()).set(Task::getTaskStatus, TaskStsType.UPDATED_IN.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | |
| | | public void complateOutStock(Task task) throws Exception { |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | if (StringUtils.isNotBlank(task.getParentId() + "")) { |
| | | Task task1 = taskService.getById(task.getParentId()); |
| | | if (!Objects.isNull(task1)) { |
| | | throw new CoolException("父任务:" + task1.getTaskCode() + "未执行完成!"); |
| | | } |
| | | } |
| | | |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |