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 |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 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 6b905c9..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
@@ -102,7 +102,7 @@
         if (dto.getPaymentDate() == null) {
             throw new ServiceException("璇烽�夋嫨鍥炴鏃ユ湡");
         }
-        if (dto.getPaymentAmount() == null || dto.getPaymentAmount().compareTo(BigDecimal.valueOf(0.01)) < 0) {
+        if (dto.getPaymentAmount() == null || dto.getPaymentAmount().compareTo(new BigDecimal("0.000001")) < 0) {
             throw new ServiceException("璇疯緭鍏ュ洖娆鹃噾棰�");
         }
         if (StringUtils.isEmpty(dto.getSalesContractNo())) {
@@ -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