From 141af43b696975d22a3abacd5d2017fb0fbfbb97 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期五, 30 一月 2026 09:44:07 +0800
Subject: [PATCH] feat(production): 添加生产核算功能和相关接口

---
 src/main/resources/mapper/production/ProductOrderMapper.xml |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductOrderMapper.xml b/src/main/resources/mapper/production/ProductOrderMapper.xml
index b47d5cf..5f526ea 100644
--- a/src/main/resources/mapper/production/ProductOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -21,10 +21,11 @@
         slp.specification_model,
         ppr.process_route_code,
         pb.bom_no,
-        ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus
+        ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus,
+        DATEDIFF(sl.delivery_date, CURDATE()) AS delivery_days_diff
         from product_order po
         left join sales_ledger sl on po.sales_ledger_id = sl.id
-        left join sales_ledger_product slp on po.product_model_id = slp.id
+        left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id
         left join product_process_route ppr on po.id = ppr.product_order_id
         left join product_bom pb on pb.id = ppr.bom_id
         <where>
@@ -43,6 +44,9 @@
             <if test="c.specificationModel != null and c.specificationModel != ''">
                 and slp.specification_model like concat('%',#{c.specificationModel},'%')
             </if>
+            <if test="c.startTime != null and c.endTime != null">
+                and po.create_time between #{c.startTime} and #{c.endTime}
+            </if>
         </where>
     </select>
     <select id="productMainByOrderId" resultType="com.ruoyi.production.dto.ProductOrderDto">

--
Gitblit v1.9.3