| | |
| | | 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 { |
| | | //更新库位明细 |