| | |
| | | throw new CoolException("主单保存失败!!"); |
| | | } |
| | | if (params.getItems().isEmpty()) { |
| | | throw new CoolException("收货通知单明细不能为寒食节!!"); |
| | | throw new CoolException("收货通知单明细不能为空!!"); |
| | | } |
| | | params.setOrders(orders); |
| | | |
| | | svaeOrUpdateOrderItem(params,loginUserId); |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void svaeOrUpdateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception{ |
| | | AsnOrder orders = params.getOrders(); |
| | | |
| | | params.getItems().forEach(item -> { |
| | | item.put("asnId", orders.getId()); |
| | | item.put("asnCode", orders.getCode()); |
| | | item.put("poCode", orders.getPoCode()); |
| | | item.put("createBy", loginUserId); |
| | | item.put("updateBy", loginUserId); |
| | | if (!asnOrderItemService.fieldsSave(item)) { |
| | | if (!asnOrderItemService.fieldsSave(item, loginUserId)) { |
| | | throw new CoolException("明细保存失败!!"); |
| | | } |
| | | }); |