| | |
| | | * @time 2025/4/7 13:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void svaeOrUpdateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception{ |
| | | public void svaeOrUpdateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception{ |
| | | AsnOrder orders = params.getOrders(); |
| | | params.getItems().forEach(item -> { |
| | | item.put("asnId", orders.getId()); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R completeOrder(Long id, Long loginUserId) { |
| | | public R completeOrder(Long id, Long loginUserId) { |
| | | AsnOrder asnOrder = this.getById(id); |
| | | if (Objects.isNull(asnOrder)) { |
| | | throw new CoolException("单据不存在!!"); |
| | |
| | | * @time 2025/3/19 19:53 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void operateOrderLogs(AsnOrder asrder) throws Exception{ |
| | | public synchronized void operateOrderLogs(AsnOrder asrder) throws Exception{ |
| | | if (Objects.isNull(asrder) || Objects.isNull(asrder.getId())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | |
| | | // } |
| | | AsnOrder order = this.getById(asrder.getId()); |
| | | AsnOrderLog orderLog = new AsnOrderLog(); |
| | | order.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | // order.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | BeanUtils.copyProperties(order, orderLog); |
| | | orderLog.setId(null); |
| | | orderLog.setAsnId(order.getId()); |
| | | |
| | | if (!this.saveOrUpdate(order)) { |
| | | throw new CoolException("状态修改失败!!"); |
| | | } |
| | | orderLog.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val); |
| | | // if (!this.saveOrUpdate(order)) { |
| | | // throw new CoolException("状态修改失败!!"); |
| | | // } |
| | | // orderLog.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val); |
| | | if (!asnOrderLogService.save(orderLog)) { |
| | | throw new CoolException("主单历史档添加失败!!"); |
| | | } |