From 77bbe488ca8aa21d81a4f8f4fcef205fd890ef83 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 24 三月 2026 09:33:27 +0800
Subject: [PATCH] yys 1.批量回款,付款

---
 src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
index 0d2e349..688fff3 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -97,6 +97,9 @@
     @Override
     public int insertPaymentRegistration(PaymentRegistration paymentRegistration) {
         PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId());
+        if(purchaseLedger == null){
+            throw new RuntimeException("鍏宠仈閲囪喘鍙拌处涓嶅瓨鍦�");
+        }
         SalesLedger salesLedger = salesLedgerMapper.selectOne(new QueryWrapper<SalesLedger>().
                 eq("sales_contract_no", purchaseLedger.getSalesContractNo()));
 //        if (salesLedger == null) {
@@ -380,13 +383,14 @@
         // 搴斾粯鎬婚噾棰濋噾棰濊绠�
         BigDecimal amountTotal = BigDecimal.ZERO;
         if(CollectionUtils.isNotEmpty(paymentRecordList)) {
+            // 鏍稿績鍒嗙粍姹傚拰閫昏緫
             Map<LocalDate, List<PaymentHistoryRecordVo>> dateListMap = paymentRecordList.stream().collect(
-                                                                        Collectors.groupingBy(
-                                                                                PaymentHistoryRecordVo::getHappenTime,
-                                                                                LinkedHashMap::new,
-                                                                                Collectors.toList()
-                                                                        )
-                                                                        );
+                    Collectors.groupingBy(
+                            PaymentHistoryRecordVo::getHappenTime,
+                            LinkedHashMap::new,
+                            Collectors.toList()
+                    )
+            );
             for (LocalDate localDate : dateListMap.keySet()) {
                 BigDecimal currentPaymentAmount = BigDecimal.ZERO;
                 BigDecimal invoiceAmount = BigDecimal.ZERO;

--
Gitblit v1.9.3