| | |
| | | //移库 |
| | | moveInStock(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type)) { |
| | | //移库 |
| | | //空板入库 |
| | | complateInstockE(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)) { |
| | | //越库 |
| | |
| | | } |
| | | |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId())); |
| | | |
| | | String type = LocStsType.LOC_STS_TYPE_F.type; |
| | | if (!taskItems.isEmpty()) { |
| | | //移库有可能是空板 |
| | | try { |
| | |
| | | if (!locItemService.remove(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, task.getOrgLoc()))) { |
| | | throw new CoolException("源库位明细删除失败!"); |
| | | } |
| | | } else { |
| | | type = LocStsType.LOC_STS_TYPE_D.type; |
| | | } |
| | | |
| | | /**修改库位状态为F.在库*/ |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .set(Loc::getBarcode, task.getBarcode()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) |
| | | .set(Loc::getUseStatus, type) |
| | | .set(Loc::getUpdateBy, loginUserId) |
| | | .set(Loc::getUpdateTime, new Date()) |
| | | .eq(Loc::getCode, task.getTargLoc()))) { |
| | |
| | | if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 1000000) / 1000000.0; |
| | | } |
| | | if (minQty.compareTo(0.0) >= 0) { |
| | | if (!minQty.equals(0D) && minQty>0D) { |
| | | taskItem.setAnfme(minQty); |
| | | if (!taskItemService.updateById(taskItem)) { |
| | | throw new CoolException("任务明细修改失败!!"); |
| | |
| | | throw new CoolException("库位明细不存在!!"); |
| | | } |
| | | |
| | | List<LocItemWorking> workings = new ArrayList<>(); |
| | | for (LocItem item : locItems) { |
| | | LocItemWorking working = new LocItemWorking(); |
| | | BeanUtils.copyProperties(item, working); |
| | | working.setId(null) |
| | | .setTaskId(task.getId()) |
| | | .setLocItemId(item.getId()) |
| | | .setUpdateBy(loginUserId) |
| | | .setUpdateTime(new Date()); |
| | | workings.add(working); |
| | | } |
| | | |
| | | if (!locItemWorkingService.saveBatch(workings)) { |
| | | throw new CoolException("临时库存保存失败!!"); |
| | | } |
| | | // List<LocItemWorking> workings = new ArrayList<>(); |
| | | // for (LocItem item : locItems) { |
| | | // LocItemWorking working = new LocItemWorking(); |
| | | // BeanUtils.copyProperties(item, working); |
| | | // working.setId(null) |
| | | // .setTaskId(task.getId()) |
| | | // .setLocItemId(item.getId()) |
| | | // .setUpdateBy(loginUserId) |
| | | // .setUpdateTime(new Date()); |
| | | // workings.add(working); |
| | | // } |
| | | // |
| | | // if (!locItemWorkingService.saveBatch(workings)) { |
| | | // throw new CoolException("临时库存保存失败!!"); |
| | | // } |
| | | |
| | | try { |
| | | //更新库位明细 |