From 1ba245c2c69e7a70d44c950bb15bf92dcfaabdc5 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 07 八月 2025 16:40:36 +0800
Subject: [PATCH] 生产终止功能添加,添加相关代码,补充报工删除代码

---
 north-glass-erp/src/main/resources/mapper/pp/Report.xml |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index dd59044..f990b5a 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -174,18 +174,18 @@
                c.technology_number,
                b.child_width,
                b.child_height,
-              if(c.technology_number=1,c.quantity,0) as quantity,
+              if(c.technology_number=1,c.quantity-ifnull(c.termination_quantity,0),0) as quantity,
 
-               c.quantity as thisQuantity,/*鐢ㄤ簬鍒ゆ柇鏄惁鏀瑰彉棰滆壊*/
+               c.quantity-ifnull(c.termination_quantity,0) as thisQuantity,/*鐢ㄤ簬鍒ゆ柇鏄惁鏀瑰彉棰滆壊*/
                e.reportWorkQuantity,
                e.reportWorkQuantityShow,
                e.reportWorkQuantityCount,
                e.reportWorkTime,
                e.broken_num,
-               c.quantity as glassQuantity,
+               c.quantity-ifnull(c.termination_quantity,0) as glassQuantity,
 
-               c.quantity as quantityShow,
-               c.quantity*a.area as grossAreaShow,
+               c.quantity-ifnull(c.termination_quantity,0) as quantityShow,
+               (c.quantity-ifnull(c.termination_quantity,0))*a.area as grossAreaShow,
                ifnull(f.inventory, 0) as inventoryShow,
                round(ifnull(f.inventory, 0) * a.area, 2) as inventoryAreaShow,
                ifnull(dd.quantity, 0) as shippedQuantityShow,
@@ -244,7 +244,7 @@
                            on e.process_id = c.process_id
                                and e.technology_number = c.technology_number
                                and e.order_number = c.order_number
-        where a.order_id = #{orderId} and d.create_order>0
+        where a.order_id = #{orderId} and d.create_order>0 and c.quantity-ifnull(c.termination_quantity,0)>0
         group by c.order_number,
                  c.technology_number,
                  c.process_id
@@ -819,7 +819,7 @@
                a.product_name,
                b.child_width,
                b.child_height,
-               c.quantity,
+               c.quantity - ifnull(c.termination_quantity,0) as quantity,
                c.technology_number,
                b.glass_child,
                ifnull(e.reportWorkQuantity, 0)                      as reportWorkQuantity,
@@ -862,7 +862,7 @@
                                 and   e.order_number=c.order_number
                                and e.technology_number = c.technology_number
                  left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number
-        where a.order_id = #{orderId} and d.create_order>0
+        where a.order_id = #{orderId} and d.create_order>0 and c.quantity - ifnull(c.termination_quantity,0)>0
         group by c.order_number,c.technology_number
         ORDER BY a.order_number
     </select>

--
Gitblit v1.8.0