From aece48b253b2e0b814bbdf5ee3d474e8cf697122 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:48 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/Report.xml |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 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 59f0137..c00dc2c 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -3460,8 +3460,13 @@
                  SELECT g.*
                       ,GROUP_CONCAT(g.glass_child SEPARATOR '+')  as childName
                  from( SELECT f.*,
-        e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num as quantity,
-        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)*f.area as glassArea
+        if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0,
+        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity),
+            0
+            ) as quantity,
+        if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0,
+        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)  ,
+            0)*f.area as glassArea
                        from (SELECT a.order_id,
                                    if(a.batch!="",CONCAT(a.project,'(',a.batch,')'),a.project) as project,
                                     C.product_id,
@@ -3474,7 +3479,8 @@
                                     b.id,
                                     c.area,
                                     d.glass_child,
-                                    ifnull(cb.patchNumSum,0) as patchNumSum
+                                    ifnull(cb.patchNumSum,0) as patchNumSum,
+                                    fc.termination_quantity
 
                              FROM sd.`order` as a
                                       LEFT JOIN sd.order_process_detail as b
@@ -3536,6 +3542,7 @@
 
 
              ) as h
+        where h.quantity >0
         <choose>
             <when test="optionVal == 1">
                 GROUP BY thisProcess

--
Gitblit v1.8.0