| | |
| | | * @time 2025/4/15 15:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized void saveLocItem(List<TaskItem> items, Long taskId, Long loginUserId) throws Exception { |
| | | public synchronized void saveLocItem(List<TaskItem> items, Long taskId, Long loginUserId) { |
| | | Task task = this.getById(taskId); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("任务不存在!!"); |
| | |
| | | .setUpdateBy(loginUserId) |
| | | .setWkType(taskItem.getWkType()) |
| | | .setType(taskItem.getOrderType()); |
| | | locItems.add(item); |
| | | if (!locItemService.saveOrUpdate(item)) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | } else { |
| | | locItem.setAnfme(Math.round((locItem.getAnfme() + taskItem.getAnfme()) * 100) / 100.0) |
| | | locItem.setAnfme(Math.round((locItem.getAnfme() + taskItem.getAnfme()) * 1000000) / 1000000.0) |
| | | .setUpdateTime(new Date()); |
| | | locItems.add(locItem); |
| | | if (!locItemService.saveOrUpdate(locItem)) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | } |
| | | }); |
| | | if (!locItemService.saveBatch(locItems)) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |