From db81d79a579180f5d8b486a5dc5617d54bf9f206 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 23 四月 2024 18:02:44 +0800
Subject: [PATCH] 修改报工
---
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml | 32 ++++++++++----------------------
1 files changed, 10 insertions(+), 22 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 3e5e592..52d167b 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -64,6 +64,7 @@
</resultMap>
+<!-- 鏌ヨ褰撳墠宸ュ簭鐨勮〃澶存暟鎹�-->
<select id="AddSelectLastWorkMp" resultMap="reportingWorkMap">
select o.order_id,
fc.production_id,
@@ -125,8 +126,8 @@
ogd.child_width,
ogd.child_height,
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,
+ fc.quantity -odpd.reporting_work_num -odpd.broken_num as quantity,
+ fc.quantity -odpd.reporting_work_num -odpd.broken_num 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 -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
@@ -145,13 +146,7 @@
AND odpd.order_number = fc.order_number
AND odpd.technology_number = fc.technology_number
and odpd.process_id = fc.process_id
- left join
- (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
- from patch_log
- group by reporting_work_id,order_sort,technology_number) as c
- on c.process_id = fc.process_id
- and c.order_sort = fc.order_number
- and c.technology_number = fc.technology_number
+
WHERE
fc.process_id = #{processIdStr}
AND fc.technology_number = #{technologyStr}
@@ -170,8 +165,8 @@
ogd.child_width,
ogd.child_height,
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,
+ odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num as quantity,
+ odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num as completedQuantity,
odpd.reporting_work_num as completed,
odpd.broken_num as onceBroken,
ogd.`group`,
@@ -204,13 +199,6 @@
and odpd.process_id = fc.process_id
left join sd.order_process_detail as odpds
ON odpds.id = odpd.id-1
- left join
- (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
- from patch_log
- group by reporting_work_id,order_sort,technology_number) as c
- on c.process_id = fc.process_id
- and c.order_sort = fc.order_number
- and c.technology_number = fc.technology_number
WHERE
fc.process_id = #{processIdStr}
<if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰'">
@@ -321,7 +309,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>
@@ -345,7 +333,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>
@@ -451,9 +439,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
--
Gitblit v1.8.0