From 1f918b55233967349c49a3230382303ac9698850 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 04 二月 2026 13:30:40 +0800
Subject: [PATCH] fix: 付款记录状态计算错误

---
 src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
index f596e88..302add7 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -15,6 +15,7 @@
 import com.ruoyi.production.dto.ProductStructureDto;
 import com.ruoyi.production.mapper.*;
 import com.ruoyi.production.pojo.*;
+import com.ruoyi.production.service.impl.SalesLedgerProductionAccountingServiceImpl;
 import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
 import com.ruoyi.purchase.pojo.PurchaseLedger;
 import com.ruoyi.quality.mapper.QualityInspectMapper;
@@ -92,6 +93,8 @@
     private ProductStructureMapper productStructureMapper;
     @Autowired
     private StockInventoryMapper stockInventoryMapper;
+    @Autowired
+    private SalesLedgerProductionAccountingServiceImpl salesLedgerProductionAccountingServiceImpl;
 
     @Override
     public SalesLedgerProduct selectSalesLedgerProductById(Long id) {
@@ -228,9 +231,7 @@
             /*鍒犻櫎瀵瑰簲鐨勭敓浜ф暟鎹苟閲嶆柊鏂板*/
             deleteProductionData(Arrays.asList(salesLedgerProduct.getId()));
             // 鍒犻櫎鐢熶骇鏍哥畻鏁版嵁
-            LambdaQueryWrapper<SalesLedgerProductionAccounting> reportWrapper = new LambdaQueryWrapper<>();
-            reportWrapper.in(SalesLedgerProductionAccounting::getSalesLedgerId, salesLedgerId);
-            salesLedgerProductionAccountingMapper.delete(reportWrapper);
+
             addProductionData(salesLedgerProduct);
         }
 
@@ -407,6 +408,8 @@
                             }
                         });
                         qualityInspectMapper.deleteByProductMainIds(productMainIds);
+                        salesLedgerProductionAccountingMapper.delete(new LambdaQueryWrapper<SalesLedgerProductionAccounting>()
+                                .in(SalesLedgerProductionAccounting::getProductMainId, productMainIds));
                     }
 
                     // 鍒犻櫎鐢熶骇涓昏〃鏁版嵁
@@ -450,7 +453,7 @@
         IPage<SalesLedgerProductDto> salesLedgerProductDtoIPage = salesLedgerProductMapper.listPagePurchaseLedger(page, salesLedgerProduct);
         salesLedgerProductDtoIPage.getRecords().forEach(item -> {
             // 鍒ゆ柇鐘舵��
-            if(item.getTaxInclusiveTotalPrice().compareTo(item.getInvoiceTotal()) == 0){
+            if(item.getTaxInclusiveTotalPrice().compareTo(item.getTicketsTotal()) == 0){
                 item.setStatusName("宸插畬鎴愪粯娆�");
             }else{
                 item.setStatusName("鏈畬鎴愪粯娆�");

--
Gitblit v1.9.3