From 82685a4ec94db01c564561582141c03054012ea3 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 07 二月 2025 10:16:38 +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 | 161 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 146 insertions(+), 15 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 d8eaa8f..48f7c41 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -91,6 +91,7 @@
where fc.process_id = #{processIdStr}
and POSITION(fc.technology_number in #{technologyStr})
and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
+ and o.create_order>0
GROUP BY fc.process_id
</select>
@@ -111,9 +112,10 @@
select ifnull((select ogd.process
from sd.order_glass_detail as ogd
left join sd.`order` as o on o.order_id=ogd.order_id
- where ogd.production_id = LEFT(#{processIdStr}, 11)
+ left join flow_card as fc on fc.order_id=o.order_id and fc.order_number=ogd.order_number and fc.technology_number=ogd.technology_number
+ where fc.process_id = #{processIdStr}
and o.create_order>0
- and POSITION(ogd.technology_number in #{technologyStr})
+ and POSITION(fc.technology_number in #{technologyStr})
limit 1),'') as process
</select>
@@ -178,6 +180,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
group by fc.order_number,
ogd.technology_number
order by fc.order_number
@@ -212,7 +215,7 @@
LEFT JOIN sd.order_glass_detail AS ogd
ON od.order_id = ogd.order_id
AND od.order_number = ogd.order_number
- <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�' and previousProcess=='澶硅兌')">
+ <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�')">
AND ogd.`group` = (select `group`
from sd.order_glass_detail
where order_id = ogd.order_id
@@ -254,7 +257,7 @@
WHERE
fc.process_id = #{processIdStr}
- <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰' and process != '鎵撹兌鍜岀矘妗�' ">
+ <if test="laminating != 'laminating'">
AND POSITION(fc.technology_number in #{technologyStr})
</if>
AND odpd.process = #{process}
@@ -342,10 +345,10 @@
</select>
<select id="selectGlassProcessNum" resultType="java.lang.Integer">
select
- if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0,
+ ifnull(if((d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)< 0,
0,
(d.reporting_work_num_count+ifnull(c.reworkNumSum,0)-b.reporting_work_num_count-b.broken_num)
- )
+ ),0)
from flow_card as a
left join sd.order_process_detail as b
on
@@ -423,15 +426,17 @@
ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 鏈伐搴忓畬宸ュ拰
if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
e.other_columns,
+ IF(count(pl.id)>0,'宸茶ˉ鐗�','') as patchStatusOther,
+
<if test="nextProcess != null and nextProcess != ''"> -- 闈炴渶鍚庝竴閬撳伐搴�
ifnull(g.completed_quantity,0) as nextQuantitySum, -- 鍚庡伐搴忓凡瀹屾垚
if((f.completed_quantity
-ifnull(g.completed_quantity,0))
- >=
+ >
a.completed_quantity,
0,
- (a.completed_quantity-f.completed_quantity
- +ifnull(g.completed_quantity,0))
+ (f.completed_quantity
+ -ifnull(g.completed_quantity,0))
) as minQuantity -- 淇敼鏈�灏忔暟
</if>
<if test="nextProcess == null or nextProcess == ''"> -- 鏈�鍚庝竴閬撳伐搴�
@@ -462,6 +467,8 @@
and d.technology_number = c.technology_number
left join sd.order_detail as e
on e.order_id = d.order_id and e.order_number = d.order_number
+ left join patch_log as pl on pl.reporting_work_id=b.reporting_work_id
+ and pl.order_sort=a.order_number and pl.technology_number=a.technology_number
left join (select sum(completed_quantity) as completed_quantity ,
rw.process_id,
@@ -512,9 +519,9 @@
o.batch,
rw.this_process,
rw.this_completed_quantity,
- round(ogd.area * rw.this_completed_quantity,2) as completedArea,
+ round(ogd.child_width*ogd.child_height * rw.this_completed_quantity/1000000,2) as completedArea,
rw.this_worn_quantity,
- round(ogd.area * rw.this_worn_quantity,2) as wornArea,
+ round(ogd.child_width*ogd.child_height * rw.this_worn_quantity/1000000,2) as wornArea,
rw.device_name,
rw.teams_groups_name,
rw.reviewed_state,
@@ -528,7 +535,8 @@
on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
rwd.technology_number = ogd.technology_number
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and rw.reporting_work_time >= #{selectTime1}
+ AND rw.reporting_work_time < #{selectTime2}
and position(#{orderId} in rw.order_id)
and rw.reviewed_state!=-1
and o.create_order>0
@@ -571,7 +579,8 @@
on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and
rwd.technology_number = ogd.technology_number
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
+ and rw.reporting_work_time >= #{selectTime1}
+ AND rw.reporting_work_time < #{selectTime2} and position(#{orderId} in rw.order_id)
and rw.reviewed_state!=-1
and o.create_order>0
<if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
@@ -700,7 +709,7 @@
left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{processId} in rw.process_id)
and position(#{state} in dd.quality_ins_status)
and rw.reviewed_state!=-1
@@ -730,7 +739,7 @@
left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id
where rw.reviewed_state != 2
- and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
+ and DATE_FORMAT((rw.reporting_work_time), '%Y-%m-%d') between #{selectTime1} and #{selectTime2}
and position(#{processId} in rw.process_id)
and position(#{state} in dd.quality_ins_status)
and rw.reviewed_state!=-1
@@ -881,4 +890,126 @@
where reporting_work_id=#{reportingWorkId} and order_number = #{orderSort}
and technology_number = #{technologyNumber}
</update>
+
+ <select id="selectUserProcess">
+ select address from erp_user_info.user where login_name=#{userId}
+ </select>
+
+ <select id="getSelectProcessJiajiao">
+ SELECT * FROM (
+ SELECT * FROM sd.basic_data
+ WHERE basic_type='product' AND basic_category='process' AND basic_name='澶硅兌'
+
+ UNION
+
+ SELECT * FROM sd.basic_data
+ WHERE basic_type='product' AND basic_category='process' AND basic_name='鍧囪川'
+ ) AS combined_results;
+ </select>
+
+ <select id="getSelectProcessDuoqu">
+ SELECT * FROM (
+ SELECT * FROM sd.basic_data
+ WHERE basic_type='product' AND basic_category='process' AND basic_name='鎶�鏈儴澶氭洸'
+
+ UNION
+
+ SELECT * FROM sd.basic_data
+ WHERE basic_type='product' AND basic_category='process' AND basic_name='閽㈠寲'
+ ) AS combined_results;
+ </select>
+
+ <select id="SelectReworlDetailMpReview">
+ SELECT
+ fc.order_number,
+ ogd.glass_child,
+ ogd.technology_number,
+ ogd.glass_address,
+ fc.quantity AS quantity_card,
+ ogd.child_width,
+ ogd.child_height,
+ if(od.shape=1,'鏅舰',if(od.shape=2,'寮傚舰','')) as shape,
+ if((odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num ) < 0,
+ 0,
+ odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num) as quantity,
+ if((odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num) < 0,
+ 0,
+ odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num) as completedQuantity,
+ 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, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
+ od.other_columns,
+ ogd.id as 'glassId'
+ ,rws.reviewed_state
+ FROM
+ sd.order_detail AS od
+ LEFT JOIN sd.order_glass_detail AS ogd
+ ON od.order_id = ogd.order_id
+ AND od.order_number = ogd.order_number
+ <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�')">
+ AND ogd.`group` = (select `group`
+ from sd.order_glass_detail
+ where order_id = ogd.order_id
+ and order_number = ogd.order_number
+ and POSITION(technology_number in #{technologyStr})
+ limit 1)
+ </if>
+
+
+ LEFT JOIN flow_card AS fc
+ ON fc.order_id = ogd.order_id
+ and fc.production_id=ogd.production_id
+ AND fc.order_number = ogd.order_number
+ AND fc.technology_number = ogd.technology_number
+ left join sd.order_process_detail as odpd
+ ON odpd.order_id = fc.order_id
+ AND odpd.order_number = fc.order_number
+ AND odpd.technology_number = fc.technology_number
+ 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(rw.rework_num) as 'patchNumSum',
+ rw.process_id,rw.order_sort,rw.technology_number,
+ rwk.this_process
+ from
+ rework as rw
+ LEFT JOIN
+ reporting_work as rwk
+ on rw.reporting_work_id =rwk.reporting_work_id
+ where rwk.this_process=#{process}
+ and rw.review_status=0
+ and rw.process_id = #{processIdStr}
+ GROUP BY rw.process_id,rw.order_sort,rw.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
+ left join (select reviewed_state as reviewed_state ,
+ process_id,a.reporting_work_id,b.technology_number,b.order_number
+ 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}
+
+ GROUP BY a.reporting_work_id,b.order_number,b.technology_number
+ ) as rws
+ on rws.process_id = fc.process_id and rws.order_number=fc.order_number and rws.technology_number=fc.technology_number
+ WHERE
+ fc.process_id = #{processIdStr}
+ <if test="laminating != 'laminating' ">
+ AND POSITION(fc.technology_number in #{technologyStr})
+ </if>
+ AND odpd.process = #{process}
+ and rws.reviewed_state=0
+ order by fc.order_number
+ </select>
+
+ <select id="getProcessLaminating">
+ select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{process}
+ </select>
+
+ <select id="selectOrderid">
+ select order_id from pp.flow_card where process_id=#{processIdStr} group by order_id
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0