From 6f287ccb0f8df857fbce894bd241cdf77690cecb Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 20 一月 2026 15:23:11 +0800
Subject: [PATCH] Merge branch 'jtwy' of http://114.132.189.42:9002/r/product-inventory-management-after into sqd-hb

---
 src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
index 1406667..9089885 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
@@ -51,6 +51,7 @@
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 /**
@@ -462,7 +463,7 @@
         List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct);
         purchaseLedgerDto.setProductData(salesLedgerProducts);
         List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>()
-                .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue())
+                .eq(CommonFile::getType, FileNameType.PURCHASE.getValue())
                 .eq(CommonFile::getCommonId, id));
         purchaseLedgerDto.setSalesLedgerFiles(commonFiles);
         return purchaseLedgerDto;
@@ -490,19 +491,20 @@
 
         // 鎵归噺鏇存柊锛堥渶瑕� MyBatis 鎻愪緵鎵归噺鏇存柊鏂规硶锛�
         if (!updateList.isEmpty()) {
+            AtomicBoolean isUpdated = new AtomicBoolean(true);
             updateList.forEach(product -> {
                 // 闈炵┖鏍¢獙锛屼换涓�瀛楁涓虹┖鍒欐姏鍑哄紓甯�
-                if (product.getQuantity() == null) {
-                    throw new BaseException("鏁伴噺涓嶈兘涓虹┖");
+                if (product.getQuantity() != null) {
+                    isUpdated.set(false);
                 }
-                if (product.getTicketsNum() == null) {
-                    throw new BaseException("宸插紑绁ㄦ暟閲忎笉鑳戒负绌�");
+                if (product.getTicketsNum() != null) {
+                    isUpdated.set(false);
                 }
-                if (product.getTaxInclusiveTotalPrice() == null) {
-                    throw new BaseException("鍚◣鎬讳环涓嶈兘涓虹┖");
+                if (product.getTaxInclusiveTotalPrice() != null) {
+                    isUpdated.set(false);
                 }
-                if (product.getTicketsAmount() == null) {
-                    throw new BaseException("鏈鏉ョエ閲戦(鍏�)涓嶈兘涓虹┖");
+                if (product.getTicketsAmount() != null) {
+                    isUpdated.set(false);
                 }
 
                 // 璁$畻 futureTickets锛堢洿鎺ヤ娇鐢� BigDecimal 璁$畻锛岄伩鍏嶇簿搴︿涪澶憋級
@@ -520,6 +522,9 @@
                 product.setType(type);
                 salesLedgerProductMapper.updateById(product);
             });
+            if(isUpdated.get()){
+                throw new RuntimeException("鏉ョエ鏁颁笉鍙叏閮ㄤ负绌�");
+            }
         }
     }
 

--
Gitblit v1.9.3