From 05d6de25d55bdf1e2f3cde9d310c2cd14d59837a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 17 七月 2024 12:51:33 +0800
Subject: [PATCH] 提交
---
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml | 46 ++++++++++++++++++++++++++++++++++++----------
1 files changed, 36 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 367700e..0a17142 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -78,11 +78,13 @@
ifnull((rw.reviewed_state),1) as reviewed_state -- 涓嬪伐搴忓鏍哥姸鎬�
from sd.order as o
left join flow_card as fc on fc.order_id = o.order_id
- left join (select if(count(reviewed_state)>0 and process_id=null,1,0) as reviewed_state ,
- process_id
- from reporting_work
- where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}) as rw
+ left join (select reviewed_state as reviewed_state ,
+ process_id,a.reporting_work_id
+ from reporting_work as a
+ left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id
+ where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr} and b.technology_number=#{technologyStr}) as rw
on rw.process_id = fc.process_id
+ left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number
where fc.process_id = #{processIdStr}
and fc.technology_number = #{technologyStr}
GROUP BY fc.process_id
@@ -105,6 +107,7 @@
select ogd.process
from sd.order_glass_detail as ogd
where ogd.production_id = LEFT(#{processIdStr}, 11)
+ and ogd.technology_number=#{technologyStr}
limit 1
</select>
@@ -126,11 +129,12 @@
ogd.child_width,
ogd.child_height,
if(od.shape=1,'鏅舰',if(od.shape=2,'寮傚舰','')) as shape,
- fc.quantity -odpd.reporting_work_num -odpd.broken_num as quantity,
- fc.quantity -odpd.reporting_work_num -odpd.broken_num as completedQuantity,
+ fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,0) as quantity,
+ fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(patch.patch_num,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 -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
+ if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
+ od.other_columns
FROM
sd.order_detail AS od
LEFT JOIN sd.order_glass_detail AS ogd
@@ -146,6 +150,19 @@
AND odpd.order_number = fc.order_number
AND odpd.technology_number = fc.technology_number
and odpd.process_id = fc.process_id
+ left join (
+ select ifnull(sum(a.patch_num),0) as patch_num,a.process_id,a.technology_number,a.order_sort
+ from patch_log as a
+ where a.process_id=#{processIdStr}
+ and a.technology_number = #{technologyStr}
+ and a.patch_processes = #{process}
+ and a.review_status = 1
+ group by a.process_id,a.order_sort,a.technology_number
+ ) as patch
+ on patch.process_id = fc.process_id
+ and patch.order_sort = fc.order_number
+ and patch.technology_number = fc.technology_number
+
WHERE
fc.process_id = #{processIdStr}
AND fc.technology_number = #{technologyStr}
@@ -173,8 +190,8 @@
odpd.reporting_work_num as completed,
odpd.broken_num as onceBroken,
ogd.`group`,
- if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
-
+ if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
+ od.other_columns
FROM
sd.order_detail AS od
@@ -390,6 +407,7 @@
ifnull(a.breakage_quantity,0) as 'breakageQuantity', -- 鐮存崯鏁�
ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 鏈伐搴忓畬宸ュ拰
if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
+ e.other_columns,
<if test="nextProcess != null and nextProcess != ''"> -- 闈炴渶鍚庝竴閬撳伐搴�
ifnull(g.completed_quantity,0) as nextQuantitySum, -- 鍚庡伐搴忓凡瀹屾垚
if((f.completed_quantity
@@ -702,7 +720,7 @@
update reporting_work as rw left join damage_details as dd on rw.reporting_work_id = dd.reporting_work_id
set dd.quality_ins_status = 2,
rw.quality_inspector=#{username},
- rw.examine_time=NOW()
+ rw.quality_ins_time=NOW()
where rw.reporting_work_id = #{reportingWorkId}
</update>
@@ -746,4 +764,12 @@
select REPLACE(GROUP_CONCAT(DISTINCT rwd.technology_number),',','') from reporting_work_detail as rwd
where rwd.reporting_work_id=#{reportingWorkId}
</select>
+
+ <update id="ReviewReportingWorkMp">
+ update reporting_work as rw
+ left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id
+ set rw.reviewed_state = 1
+ where rw.process_id = #{substring} and rw.this_process=#{process}
+ and rwd.technology_number = #{result} and reviewed_state=0
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0