From ac0bc1d3df54c8f18a10b135daf28faebb25d20a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 07 八月 2025 16:43:24 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index 6956e04..24a1f39 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -135,8 +135,8 @@
             ogd.child_width,
             ogd.child_height,
             if(od.shape=1,'鏅舰',if(od.shape=2,'寮傚舰','')) as shape,
-            fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num   as quantity,
-            fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num   as completedQuantity,
+            fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num - ifnull(fc.termination_quantity,0)  as quantity,
+            fc.quantity -fc.export_number + ifnull(patch.patch_num,0) -odpd.reporting_work_num -odpd.broken_num - ifnull(fc.termination_quantity,0)   as completedQuantity,
             odpd.reporting_work_num as completed,
             odpd.broken_num as onceBroken,
             if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
@@ -178,7 +178,7 @@
           AND  POSITION(fc.technology_number in #{technologyStr})
           AND odpd.process = #{process}
           and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
-        and o.create_order>0
+        and o.create_order>0 and fc.quantity - ifnull(fc.termination_quantity,0)>0
         group by fc.order_number,
                  ogd.technology_number
         order by fc.order_number
@@ -411,7 +411,7 @@
 
 <!--鏌ヨ淇敼鎶ュ伐鏄庣粏鏁版嵁-->
     <select id="selectByReportingWorkId" >
-        select
+        select * from(select
             a.reporting_work_id,
             d.order_number,
             d.glass_child,
@@ -422,7 +422,7 @@
             d.child_height,
             if(e.shape=1,'鏅舰',if(e.shape=2,'寮傚舰','')) as shape,
             if(ifnull(a.completed_quantity+a.breakage_quantity,0)=0,
-                c.quantity-ifnull(a.completed_quantity+a.breakage_quantity,0),
+                0,
                 ifnull(a.completed_quantity+a.breakage_quantity,0)) as 'quantity', -- 鍙姤宸ユ暟
             ifnull(a.completed_quantity,0) as 'completedQuantity', -- 瀹屽伐鏁�
             ifnull(a.breakage_quantity,0) as 'breakageQuantity', -- 鐮存崯鏁�
@@ -481,6 +481,7 @@
                        from reporting_work as rw
                        left join  reporting_work_detail  as rwd
                        on rw.reporting_work_id = rwd.reporting_work_id
+              where rw.reviewed_state>-1
                        group by rw.process_id,
                                 rw.this_process,
                                 rwd.order_number,
@@ -512,6 +513,7 @@
         </if>
         where b.reporting_work_id = #{reportingWorkId}
         GROUP BY c.order_number,c.technology_number
+        order BY c.order_number,c.technology_number) as result
     </select>
 <select id="selectReportingWorkMp" resultMap="reportingWorkMap">
     select rw.reporting_work_id,

--
Gitblit v1.8.0