| | |
| | | waitPakins.forEach(pakin -> { |
| | | BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>() |
| | | .eq(BasContainer::getCode, pakin.getBarcode())); |
| | | if (Objects.isNull(container)) { |
| | | throw new CoolException("容器未维护入库,请维护后再操作!!"); |
| | | } |
| | | /**获取库位*/ |
| | | String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType()); |
| | | if (Cools.isEmpty(targetLoc)) { |
| | |
| | | |
| | | tempLocs.forEach(working -> { |
| | | taskItems.forEach(taskItem -> { |
| | | if (taskItem.getMatnrId().equals(working.getMatnrId())) { |
| | | if (taskItem.getFieldsIndex().equals(working.getFieldsIndex())) { |
| | | Double minQty = taskItem.getAnfme(); |
| | | if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 100) / 100.0; |
| | |
| | | .setMatnrCode(working.getMatnrCode()) |
| | | .setSpec(working.getSpec()) |
| | | .setAnfme(working.getAnfme()) |
| | | .setQty(0.0) |
| | | .setBatch(working.getBatch()) |
| | | .setFieldsIndex(working.getFieldsIndex()) |
| | | .setUnit(working.getUnit()) |
| | |
| | | throw new CoolException("库位状态修改失败!!"); |
| | | } |
| | | |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)) { |
| | | if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | .eq(Task::getId, task.getId()) |
| | | .set(Task::getUpdateBy, loginUserId) |
| | | .set(Task::getUpdateTime, new Date()) |
| | | .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | } else { |
| | | if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | .eq(Task::getId, task.getId()) |
| | | .set(Task::getUpdateBy, loginUserId) |
| | | .set(Task::getUpdateTime, new Date()) |
| | | .set(Task::getTaskStatus, TaskStsType.UPDATED_OUT.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | //全板出库,删除临时库存 |
| | | if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) { |
| | | throw new CoolException("临时库存清除失败!!"); |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | .eq(Task::getId, task.getId()) |
| | | .set(Task::getUpdateBy, loginUserId) |
| | | .set(Task::getUpdateTime, new Date()) |
| | | .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | |
| | | // if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)) { |
| | | // if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | // .eq(Task::getId, task.getId()) |
| | | // .set(Task::getUpdateBy, loginUserId) |
| | | // .set(Task::getUpdateTime, new Date()) |
| | | // .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) { |
| | | // throw new CoolException("库存状态更新失败!!"); |
| | | // } |
| | | // } else { |
| | | // if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | // .eq(Task::getId, task.getId()) |
| | | // .set(Task::getUpdateBy, loginUserId) |
| | | // .set(Task::getUpdateTime, new Date()) |
| | | // .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) { |
| | | // throw new CoolException("库存状态更新失败!!"); |
| | | // } |
| | | //// //全板出库,删除临时库存 |
| | | //// if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) { |
| | | //// throw new CoolException("临时库存清除失败!!"); |
| | | //// } |
| | | // } |
| | | |
| | | } |
| | | |
| | | /** |