From 5563586beaa4c70d0d570848fa39c12a5f1e3ed7 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期五, 18 九月 2026 15:24:44 +0800
Subject: [PATCH] Merge branch 'dev_天津君歌化工pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_天津君歌化工pro

---
 src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java b/src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java
index 20374ae..fbd2734 100644
--- a/src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java
+++ b/src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java
@@ -122,13 +122,14 @@
         }
 
         List<Long> stockOutRecordIds = accountSalesCollectionMapper.selectStockOutRecordIdsBySalesLedgerId(salesLedger.getId());
-        if (CollectionUtils.isEmpty(stockOutRecordIds)) {
-            throw new ServiceException("璇ュ悎鍚屾殏鏃犲彲鍥炴鐨勯攢鍞嚭搴撹褰�");
-        }
 
         AccountSalesCollection collection = new AccountSalesCollection();
         collection.setCustomerId(dto.getCustomerId().intValue());
-        collection.setStockOutRecordIds(stockOutRecordIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
+        collection.setSalesLedgerId(salesLedger.getId());
+        // 鍚堝悓鏈彂璐ф椂娌℃湁鍑哄簱璁板綍锛屾鏃朵粛鍏佽鍥炴锛屽嚭搴撳崟鍏宠仈鐣欑┖
+        collection.setStockOutRecordIds(CollectionUtils.isEmpty(stockOutRecordIds)
+                ? null
+                : stockOutRecordIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
         collection.setCollectionDate(dto.getPaymentDate());
         collection.setCollectionAmount(dto.getPaymentAmount());
         collection.setCollectionMethod(dto.getPaymentMethod());

--
Gitblit v1.9.3