| | |
| | | tempLocs.forEach(working -> { |
| | | taskItems.forEach(taskItem -> { |
| | | if (taskItem.getMatnrId().equals(working.getMatnrId())) { |
| | | Double minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0; |
| | | Double minQty = taskItem.getAnfme(); |
| | | if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0; |
| | | } |
| | | if (minQty.compareTo(0.0) > 0) { |
| | | taskItem.setAnfme(minQty); |
| | | if (!taskItemService.updateById(taskItem)) { |
| | | throw new CoolException("任务明细修改失败!!"); |
| | | } |
| | | |
| | | } else { |
| | | if (!taskItemService.removeById(taskItem)) { |
| | | throw new CoolException("任务明细修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | }); |
| | | List<Long> matnrIds = taskItems.stream().map(TaskItem::getMatnrId).collect(Collectors.toList()); |
| | |
| | | }); |
| | | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | Loc loc1 = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |
| | | Loc loc1 = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())); |
| | | if (Objects.isNull(loc1)) { |
| | | throw new CoolException("目标库位不存在!!"); |
| | | } |