From 00a6c486eb0f4aec35af265ff9851bff41f18bd2 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 18 三月 2024 16:43:26 +0800
Subject: [PATCH] 修改报工前端判断流程卡位数

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 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 851f45a..2e3409b 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -22,6 +22,7 @@
         <result property="completedArea" column="completedArea"/>
         <result property="wornArea" column="wornArea"/>
         <result property="qualityInspector" column="quality_inspector"/>
+        <result property="qualityInsTime" column="quality_ins_time"/>
 
         <association property="order" javaType="com.example.erp.entity.sd.Order">
             <result property="customerId" column="customer_id"/>
@@ -63,6 +64,7 @@
 
     </resultMap>
 
+<!--    鏌ヨ褰撳墠宸ュ簭鐨勮〃澶存暟鎹�-->
     <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap">
         select o.order_id,
                fc.production_id,
@@ -126,8 +128,9 @@
             od.shape,
             fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
             fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
-            odpd.reporting_work_num_count as completed,
-            odpd.broken_num as onceBroken
+            odpd.reporting_work_num as completed,
+            odpd.broken_num as onceBroken,
+            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
         FROM
             sd.order_detail AS od
         LEFT JOIN sd.order_glass_detail AS ogd
@@ -170,9 +173,10 @@
             od.shape,
             odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
             odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
-            odpd.reporting_work_num_count as completed,
+            odpd.reporting_work_num as completed,
             odpd.broken_num as onceBroken,
-            ogd.`group`
+            ogd.`group`,
+            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
 
 
         FROM
@@ -318,7 +322,7 @@
             and c.technology_number = a.technology_number
 
         where
-            a.process_id=SUBSTR(#{processId} from 1 for 13)
+            a.process_id=SUBSTR(#{processId} from 1 for 14)
             and a.order_number = #{orderNumber}
             and a.technology_number = #{technologyNumber}
     </select>
@@ -342,7 +346,7 @@
                                    and c.technology_number = a.technology_number
 
         where
-            a.process_id=SUBSTR(#{processId} from 1 for 13)
+            a.process_id=SUBSTR(#{processId} from 1 for 14)
           and a.order_number = #{orderNumber}
           and a.technology_number = #{technologyNumber}
     </select>
@@ -363,6 +367,7 @@
             a.completed_quantity as 'completedQuantity', -- 瀹屽伐鏁�
             a.breakage_quantity as 'breakageQuantity', -- 鐮存崯鏁�
             f.completed_quantity as thisQuantitySum ,-- 鏈伐搴忓畬宸ュ拰
+            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
             <if test="nextProcess != null and nextProcess != ''">  -- 闈炴渶鍚庝竴閬撳伐搴�
                 ifnull(g.completed_quantity,0) as nextQuantitySum,  -- 鍚庡伐搴忓凡瀹屾垚
                 if((f.completed_quantity
@@ -375,8 +380,8 @@
                     )  as minQuantity -- 淇敼鏈�灏忔暟
             </if>
             <if test="nextProcess == null or nextProcess == ''">  -- 鏈�鍚庝竴閬撳伐搴�
-              c.received_quantity, -- 宸插叆搴撴暟閲�
-              c.inventory_quantity, -- 搴撳瓨鏁伴噺
+#               c.received_quantity, -- 宸插叆搴撴暟閲�
+#               c.inventory_quantity, --   搴撳瓨鏁伴噺
               if(ifnull(inventory_quantity,0)
                  -ifnull(c.received_quantity,0)
                  &gt;= a.completed_quantity,0,
@@ -447,9 +452,9 @@
                o.batch,
                rw.this_process,
                rw.this_completed_quantity,
-               (ogd.area * rw.this_completed_quantity) as completedArea,
+               round(ogd.area * rw.this_completed_quantity,2) as completedArea,
                rw.this_worn_quantity,
-               (ogd.area * rw.this_worn_quantity)      as wornArea,
+               round(ogd.area * rw.this_worn_quantity,2)      as wornArea,
                rw.device_name,
                rw.teams_groups_name,
                rw.reviewed_state
@@ -591,6 +596,7 @@
                rw.previous_process,
                rw.next_process,
                rw.quality_inspector,
+               rw.quality_ins_time,
                dd.quality_ins_status
         from sd.order as o
                  left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id

--
Gitblit v1.8.0