From 3f2c93e6d6db54032aa4d6f0673986a5dd3882f8 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 11 五月 2026 11:28:48 +0800
Subject: [PATCH] fix(accountSales): 财务管理的销售出库和销售退货

---
 src/main/resources/mapper/sales/ShippingInfoMapper.xml |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/sales/ShippingInfoMapper.xml b/src/main/resources/mapper/sales/ShippingInfoMapper.xml
index 955a89f..cd7dc3e 100644
--- a/src/main/resources/mapper/sales/ShippingInfoMapper.xml
+++ b/src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -61,20 +61,21 @@
     <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
         SELECT
         slp.*,
+        si.shipping_no,
         GREATEST(slp.quantity - COALESCE(rs.total_return_num, 0), 0) AS un_quantity,
         COALESCE(rs.total_return_num, 0) AS total_return_num
         FROM shipping_info si
         LEFT JOIN sales_ledger_product slp ON si.sales_ledger_product_id = slp.id and slp.type = 1
         LEFT JOIN (
         SELECT
-        return_sale_ledger_product_id,
+        return_sales_ledger_product_id,
         SUM(num) AS total_return_num
         FROM return_sale_product rsp
         left join return_management rm on rm.id = rsp.return_management_id
         left join shipping_info si on si.id = rm.shipping_id
         WHERE 1=1
-        GROUP BY return_sale_ledger_product_id
-        ) rs ON rs.return_sale_ledger_product_id = slp.id
+        GROUP BY return_sales_ledger_product_id
+        ) rs ON rs.return_sales_ledger_product_id = slp.id
         <where>
             <if test="shippingId != null">
                 si.id = #{shippingId}
@@ -84,6 +85,35 @@
     <select id="getShippingInfoByCustomerName" resultType="com.ruoyi.sales.pojo.ShippingInfo">
         select * from shipping_info si
         left join sales_ledger sl on si.sales_ledger_id = sl.id
-        where sl.customer_name = #{customerName}
+        where si.status = '宸插彂璐�' and sl.customer_name = #{customerName}
     </select>
-</mapper>
\ No newline at end of file
+    <select id="listPageByOutbound" resultType="com.ruoyi.account.bean.vo.SalesOutboundVo">
+         SELECT
+        sor.id,
+        sor.outbound_batches,
+        sl.customer_name,
+        s.shipping_date,
+        p.product_name,
+        slp.specification_model,
+        slp.stock_out_num,
+        s.shipping_no,
+        sl.sales_contract_no
+        FROM shipping_info s
+        LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
+        LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1
+        left join product_model pm on slp.product_model_id = pm.id
+        left join product p on pm.product_id = p.id
+        left join stock_out_record sor on sor.record_id = s.id and sor.record_type='13'
+        WHERE s.status='宸插彂璐�'
+        <if test="req.outboundBatches != null and req.outboundBatches != ''">
+            AND sor.outbound_batches LIKE CONCAT('%',#{req.outboundBatches},'%')
+        </if>
+        <if test="req.customerName != null and req.customerName != ''">
+            AND sl.customer_name LIKE CONCAT('%',#{req.customerName},'%')
+        </if>
+        <if test="req.startDate != null and req.endDate != null">
+            AND s.shipping_date BETWEEN #{startDate} AND #{endDate}
+        </if>
+        order by sor.id DESC
+    </select>
+</mapper>

--
Gitblit v1.9.3