| | |
| | | MesWmProductSalesStatusEnum.FINISHED.getStatus()) == 0) { |
| | | throw exception(WM_RETURN_SALES_BATCH_NOT_SHIPPED); |
| | | } |
| | | // 手工入库批次可能没有客户;仅在订单盘号及已完成出库都已验证后允许退货。 |
| | | if (batch != null && (batch.getClientId() != null || reelNumbers.isEmpty())) { |
| | | batchService.validateBatchExists(batch.getId(), reqVO.getItemId(), returnSales.getClientId(), null); |
| | | } |
| | | } else if (batch != null) { |
| | | batchService.validateBatchExists(batch.getId(), reqVO.getItemId(), returnSales.getClientId(), null); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 校验物料批次管理 |
| | | * |
| | | * @param returnId 退货单ID |
| | | * @param returnSales 退货单 |
| | | * @param itemId 物料ID |
| | | * @param batchId 批次ID |
| | | */ |
| | |
| | | } |
| | | // 校验批次存在且属于当前物料和客户 |
| | | if (batchId != null) { |
| | | // 从父单获取客户ID,校验批次归属 |
| | | return batchService.validateBatchExists(batchId, itemId, returnSales.getClientId(), null); |
| | | return batchService.validateBatchExists(batchId, itemId); |
| | | } |
| | | return null; |
| | | } |