From 24f897e83340a4d4b87d681905a708a24e705ebb Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期六, 31 八月 2024 10:56:07 +0800
Subject: [PATCH] 按编号打印标签数量修改
---
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 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 523f885..b6d53d3 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -23,6 +23,7 @@
<result property="wornArea" column="wornArea"/>
<result property="qualityInspector" column="quality_inspector"/>
<result property="qualityInsTime" column="quality_ins_time"/>
+ <result property="notes" column="notes"/>
<association property="order" javaType="com.example.erp.entity.sd.Order">
<result property="customerId" column="customer_id"/>
@@ -82,11 +83,14 @@
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
+ where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}
+ and POSITION(b.technology_number in #{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}
+ and POSITION(fc.technology_number in #{technologyStr})
+ and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
GROUP BY fc.process_id
</select>
@@ -104,11 +108,13 @@
<!-- 鏌ヨ娴佺▼鍗″伐鑹烘祦绋�-->
<select id="SelectTechnologicalProcess">
- 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 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)
+ and o.create_order>0
+ and POSITION(ogd.technology_number in #{technologyStr})
+ limit 1),'') as process
</select>
@@ -158,18 +164,22 @@
where
reporting_work.this_process = #{process}
and a.process_id=#{processIdStr}
- and a.technology_number = #{technologyStr}
+ and POSITION(a.technology_number in #{technologyStr})
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
+ left join sd.`order` as o on o.order_id=od.order_id
WHERE
fc.process_id = #{processIdStr}
- AND fc.technology_number = #{technologyStr}
+ AND POSITION(fc.technology_number in #{technologyStr})
AND odpd.process = #{process}
+ and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
+ group by fc.order_number,
+ ogd.technology_number
order by fc.order_number
</select>
@@ -195,19 +205,19 @@
ogd.`group`,
if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag, -- 鍒ゆ柇鏄惁宸茬粡瀹屾垚锛屽凡缁忓畬鎴愪笉搴忓彿鍜屽悓搴忓彿鏁伴噺鐩稿悓鎵嶈兘鎻愪氦
od.other_columns,
- ogd.id
+ ogd.id as 'glassId'
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 == '澶硅兌'">
+ <if test="process == '澶硅兌' or (process == '鎵撹兌鍜岀矘妗�' and previousProcess=='澶硅兌')">
AND ogd.`group` = (select `group`
from sd.order_glass_detail
where order_id = ogd.order_id
and order_number = ogd.order_number
- and technology_number =#{technologyStr}
+ and POSITION(technology_number in #{technologyStr})
limit 1)
</if>
@@ -244,8 +254,8 @@
WHERE
fc.process_id = #{processIdStr}
- <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰'">
- AND fc.technology_number = #{technologyStr}
+ <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰' and process != '鎵撹兌鍜岀矘妗�' ">
+ AND POSITION(fc.technology_number in #{technologyStr})
</if>
AND odpd.process = #{process}
order by fc.order_number
@@ -497,7 +507,7 @@
select rw.reporting_work_id,
(rw.reporting_work_time) as reporting_work_time,
o.order_id,
- rw.process_id,
+ CONCAT(rw.process_id,'/',GROUP_CONCAT(distinct rwd.technology_number SEPARATOR '')) as process_id,
o.project,
o.batch,
rw.this_process,
@@ -507,7 +517,8 @@
round(ogd.area * rw.this_worn_quantity,2) as wornArea,
rw.device_name,
rw.teams_groups_name,
- rw.reviewed_state
+ rw.reviewed_state,
+ rw.notes
# (IF(rw.reviewed_state = 0, '鏈鏍�', IF(rw.reviewed_state = 1, '瀹℃牳閫氳繃', '瀹℃牳涓嶉�氳繃'))) as reviewed_state
from sd.order as o
left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
@@ -519,6 +530,7 @@
and rw.reporting_work_time between #{selectTime1} and #{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 != ''">
and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
</if>
@@ -560,6 +572,7 @@
where rw.reviewed_state != 2
and rw.reporting_work_time between #{selectTime1} and #{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 != ''">
and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
</if>
@@ -791,7 +804,7 @@
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
+ and POSITION(rwd.technology_number in #{result}) and reviewed_state=0
</update>
<select id="getPatchConditionMp">
--
Gitblit v1.8.0