From 3f3a1ed182e96214e66f6456ee692427bf04d454 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 28 十一月 2025 11:10:23 +0800
Subject: [PATCH] yys 1.库存管理导出修改 2.来票登记分页查询修改

---
 src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java                        |    2 +-
 src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml                  |    6 ++++--
 src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java |    4 +++-
 src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml                         |    8 +++-----
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java b/src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
index ab500b7..62da339 100644
--- a/src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
+++ b/src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
@@ -26,7 +26,7 @@
     // 鍏ュ簱鏃堕棿
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "鍏ュ簱鏃堕棿")
+    @Excel(name = "鍏ュ簱鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd")
     private Date inboundDate;
 
     /**
diff --git a/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java b/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
index 611791e..f511af2 100644
--- a/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -255,7 +255,9 @@
 
     @Override
     public void exportCopyTwo(HttpServletResponse response,Integer type) {
-        List<CustomStorage> list = customStorageMapper.selectList(null);
+        LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        customStorageLambdaQueryWrapper.groupBy(CustomStorage::getSupplierName, CustomStorage::getProductCategory, CustomStorage::getSpecificationModel);
+        List<CustomStorage> list = customStorageMapper.selectList(customStorageLambdaQueryWrapper);
         // 璁$畻寰呭叆搴撴暟閲�
         // 鏌ヨ閲囪喘璁板綍宸插叆搴撴暟閲�
         List<Integer> collect = list.stream().map(CustomStorage::getId).collect(Collectors.toList());
diff --git a/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml b/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
index d7799dc..f1f7509 100644
--- a/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
+++ b/src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -186,9 +186,10 @@
             t1.update_time as uTime,
             t1.create_by
         from  procurement_record_storage t1
-                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
+                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2
                   left join purchase_ledger t3 on t3.id = t2.sales_ledger_id
         where t1.type = 1
+        group by t3.supplier_name,t2.product_category,t2.specification_model
     </select>
     <select id="listCopyOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
         select
@@ -214,9 +215,10 @@
             t1.update_time as uTime,
             t1.create_by
         from  procurement_record_storage t1
-                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
+                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
                   left join sales_ledger t3 on t3.id = t2.sales_ledger_id
         where t1.type = 2
+        group by t3.customer_name,t2.product_category,t2.specification_model
     </select>
     <select id="listPageByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto">
         select
diff --git a/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml b/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
index 8e8cf1c..d8b9241 100644
--- a/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
+++ b/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -164,11 +164,9 @@
         FROM
         payment_registration T1
         LEFT JOIN purchase_ledger t4 ON t4.id = T1.purchase_ledger_id
-        LEFT JOIN
-        supplier_manage T2 ON T1.supplier_id = T2.id
-        LEFT JOIN
-        sys_user T3 ON T3.user_id = T1.registrant_id
-        left join ticket_registration t5 on t5.purchase_ledger_id = T1.purchase_ledger_id
+        LEFT JOIN supplier_manage T2 ON T1.supplier_id = T2.id
+        LEFT JOIN sys_user T3 ON T3.user_id = T1.registrant_id
+        left join ticket_registration t5 on t5.id = T1.ticket_registration_id
         <where>
             <if test="params.searchText != null and params.searchText != '' ">
                 AND T2.supplier_name LIKE CONCAT('%',#{params.searchText},'%')

--
Gitblit v1.9.3