| | |
| | | if (Objects.isNull(locWorking)) { |
| | | throw new CoolException("数据错误,作业中库存数据丢失!!"); |
| | | } |
| | | if (locWorking.getAnfme().compareTo(taskItem.getAnfme()) >= 0) { |
| | | locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0); |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | locWorking.setWorkQty(0.0); |
| | | locWorking.setAnfme(taskItem.getAnfme()); |
| | | } else { |
| | | continue; |
| | | if (locWorking.getAnfme().compareTo(taskItem.getAnfme()) >= 0) { |
| | | locWorking.setWorkQty(0.0); |
| | | locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0); |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | BeanUtils.copyProperties(locWorking, locItem); |
| | | locItem.setLocCode(loc.getCode()).setLocId(loc.getId()).setId(null); |
| | | items.add(locItem); |
| | |
| | | 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::getTaskStatus, TaskStsType.UPDATED_OUT.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | } else { |
| | | 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::getTaskStatus, TaskStsType.WAVE_SEED.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | } else { |
| | | if (!this.update(new LambdaUpdateWrapper<Task>() |
| | | .eq(Task::getId, task.getId()) |
| | | .set(Task::getTaskStatus, TaskStsType.UPDATED_OUT.id))) { |
| | | throw new CoolException("库存状态更新失败!!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |