From a3dfc8966bb702c4ccb20f2a2afda7b7c39bd98d Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 06 十一月 2024 15:17:08 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml | 140 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 111 insertions(+), 29 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 7f0e531..1a6aba7 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -67,10 +67,10 @@
b.customer_name,
if(a.layout_status=0,'涓嶅彲鎺掔増',if(a.layout_status=1,'鍙帓鐗�','宸叉帓鐗�')) as layout_status,
a.merge
- from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time,merge from flow_card
+ from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge from flow_card
group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
- where a.create_time between #{selectTime1} and #{selectTime2}
+ where date(a.create_time)>=#{selectTime1} and date(a.create_time) <= #{selectTime2}
<if test="flowCard.orderId != null and flowCard.orderId != ''">
and a.order_id regexp #{flowCard.orderId}
</if>
@@ -114,7 +114,7 @@
count(distinct a.process_Id) as 'total'
from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
- where a.create_time between #{selectTime1} and #{selectTime2}
+ where date(a.create_time)>=#{selectTime1} and date(a.create_time) <= #{selectTime2}
<if test="flowCard.orderId != null and flowCard.orderId != ''">
and a.order_id regexp #{flowCard.orderId}
</if>
@@ -162,8 +162,8 @@
o.delivery_address
from sd.`order` as o
left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
- where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
- #{selectTime2}
+ where o.production_order=2 and ogd.splitting_status=0 and
+ date(o.create_time)>=#{selectTime1} and date(o.create_time) <= #{selectTime2}
<if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
and o.order_id regexp #{flowCard.order.orderId}
@@ -257,12 +257,14 @@
ifnull(p.thickness,'') as thickness,
od.weight,
od.remarks,
+ od.processing_note,
ifnull(od.bend_radius,'') as bend_radius,
ods.S01,
ods.S02,
ods.S03,
ods.S04,
- ods.S05
+ ods.S05,
+ od.building_number
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
@@ -412,7 +414,7 @@
left join sd.order as o on od.order_id = o.order_id
left join production_scheduling as ps
on ps.order_id = od.order_id and ps.order_number = od.order_number
- where od.create_time between #{selectTime1} and #{selectTime2}
+ where date(od.create_time)>=#{selectTime1} and date(od.create_time) <= #{selectTime2}
</select>
<!-- 鏌ヨ瀵瑰簲搴忓彿鐨勫眰鏁�-->
@@ -468,7 +470,7 @@
pack_type,
batch
from sd.order
- where create_time between #{selectTime1} and #{selectTime2}
+ where date(create_time)>=#{selectTime1} and date(create_time) <= #{selectTime2}
and position(#{orderId} in order_id)
and position(#{project} in project)
and processing_card >0
@@ -478,7 +480,7 @@
<select id="selectPrintFlowCard">
select *
from pp.optimize_project
- where create_time between #{selectTime1} and #{selectTime2}
+ where date(create_time)>=#{selectTime1} and date(create_time) <= #{selectTime2}
and state >= 20
order by create_time desc
</select>
@@ -515,13 +517,14 @@
ogds.glass_child AS concatenated_glass_child,
process AS processed_part,
ogds.child_width,
- ogds.child_height
+ ogds.child_height,
+ ogds.group
from sd.order_glass_detail as ogds
where ogds.order_id = #{orderId}
- GROUP BY order_id, order_number, ogds.glass_child, process) as ogdss
+ GROUP BY order_id, order_number, ogds.glass_child, process,ogds.group) as ogdss
on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number
where fc.order_id = #{orderId}
- GROUP BY fc.process_id, ogdss.concatenated_glass_child, ogdss.processed_part
+ GROUP BY fc.process_id, ogdss.concatenated_glass_child, ogdss.processed_part,ogdss.group
order by fc.process_id, ogdss.technology_number)
UNION
@@ -663,7 +666,8 @@
round(ogd.child_width) as width,
round(ogd.child_height) as height,
pd.separation,
- fc.technology_number
+ fc.technology_number,
+ IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber
from flow_card as fc
left join sd.order_glass_detail as ogd
on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -718,7 +722,9 @@
opd.stock_id,
od.quantity,
od.other_columns,
- od.bend_radius
+ od.bend_radius,
+ od.order_number as heat_layout_id,
+ a.id as heat_layout_sort
from pp.optimize_detail opd
left join sd.`order` o on SUBSTR(opd.process_id, 1, 10) = o.order_id
left join sd.order_detail od
@@ -729,8 +735,11 @@
left join sd.product p on od.product_id = p.id
left join sd.basic_glass_type e on e.type_id = p.type_id
left join sd.customer c on c.id = o.customer_id
+ left join
+ (select (@row_number := @row_number + 1) as id,process_id as process_id from (select process_id from pp.optimize_detail tt where project_no =#{projectNo} group by process_id) tt,(select @row_number := 0) as t) a
+ on a.process_id=opd.process_id
where opd.project_no = #{projectNo}
- order by opd.stock_id
+ order by opd.stock_id,opd.polys_id
</select>
<select id="getPrintLabel2">
@@ -744,7 +753,6 @@
ogd.glass_child,
ogd.process,
e.type_name,
- opd.stock_id,
od.quantity,
od.other_columns,
od.bend_radius,
@@ -995,7 +1003,8 @@
ogd.glass_child,
fc.print_status,
pl.reporting_work_id,
- JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber,
+ pl.patch_id
from flow_card as fc
left join sd.order_glass_detail as ogd
@@ -1006,7 +1015,7 @@
left join patch_log as pl on pl.order_id = fc.order_id and pl.process_id = fc.process_id and
pl.order_sort = fc.order_number and
pl.technology_number = fc.technology_number
- where pl.create_time between #{selectTime1} and #{selectTime2}
+ where date(pl.create_time)>=#{selectTime1} and date(pl.create_time) <= #{selectTime2}
and pl.review_status > 0
GROUP BY pl.id, fc.process_id, ogd.technology_number
order by pl.id desc, fc.process_id, ogd.technology_number
@@ -1190,7 +1199,7 @@
left join rework as pl on pl.order_id = fc.order_id and pl.process_id = fc.process_id and
pl.order_sort = fc.order_number and
pl.technology_number = fc.technology_number
- where pl.create_time between #{selectTime1} and #{selectTime2}
+ where date(pl.create_time)>=#{selectTime1} and date(pl.create_time) <= #{selectTime2}
GROUP BY fc.process_id,fc.order_number, ogd.technology_number, pl.reporting_work_id
order by pl.id desc, fc.process_id, ogd.technology_number
</select>
@@ -1207,7 +1216,8 @@
round(ogd.child_width) as width,
round(ogd.child_height) as height,
pd.separation,
- fc.technology_number
+ fc.technology_number,
+ IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber
from flow_card as fc
left join sd.order_glass_detail as ogd
on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -2108,7 +2118,8 @@
'鏂囨湰' as custom2,
'鏂囨湰' as custom3,
'鏂囨湰' as custom4,
- '鏂囨湰' as custom5
+ '鏂囨湰' as custom5,
+ od.quantity
from sd.order as o
left join sd.order_detail as od on o.order_id = od.order_id
left join flow_card as fc on o.order_id = fc.order_id and
@@ -2220,11 +2231,11 @@
<select id="remakList">
SELECT
- JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')) AS S01,
- JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S04')) AS S02,
- JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S05')) AS S03,
- JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S06')) AS S04,
- JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S07')) AS S05
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')),'') AS S01,
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S04')),'') AS S02,
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S05')),'') AS S03,
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S06')),'') AS S04,
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S07')),'') AS S05
FROM flow_card as fc left join sd.order_detail as od on fc.order_id = od.order_id
and fc.order_number = od.order_number
WHERE fc.process_id=#{processId}
@@ -2244,7 +2255,7 @@
</select>
<select id="selectFlowCardMerge">
- select *
+ select *,GROUP_CONCAT(DISTINCT fc.technology_number) as count1,count(DISTINCT fc.technology_number) as count2
from pp.flow_card as fc
left join sd.order_glass_detail as ogd
on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -2255,12 +2266,83 @@
</select>
<update id="updateFlowCardMerge">
- update pp.flow_card fc set fc.merge=1
- where fc.process_id = #{processId}
+ update pp.flow_card fc set fc.merge=#{index}
+ where fc.process_id = #{processId} and fc.technology_number in
+ <foreach item="technologyNumber" collection="technologyNumbers" open="(" separator="," close=")">
+ #{technologyNumber}
+ </foreach>
</update>
<delete id="deleteflowCardSort">
delete from flow_card_sort where process_id = #{processId}
</delete>
+ <select id="getPrintProjectDetailsMp">
+ SELECT opd.project_no,opd.stock_id,opl.glass_count FROM optimize_detail as opd left join optimize_layout as opl on opl.project_no=opd.project_no and opl.stock_id=opd.stock_id
+ where opd.project_no=#{projectNo}
+ GROUP BY opd.stock_id
+ ORDER BY opd.stock_id
+ </select>
+
+ <select id="getPrintCustomDataProjectDetail">
+ select
+ o.order_id as orderId,
+ project,
+ customer_id as customerId,
+ o.customer_name as customerName,
+ order_type as orderType,
+ order_classify as orderClassify,
+ batch,
+ o.icon,
+ pack_type as packType,
+ delivery_date as deliveryDate,
+ al_type as alType,
+ money,
+ contract_id as contractId,
+ customer_batch customerBatch,
+ contacts,
+ delivery_address as deliveryAddress,
+ od.processing_note as processingNote,
+ od.width,
+ od.height,
+ fc.quantity,
+ od.order_number as orderNumber,
+ fc.technology_number as technologyNumber,
+ od.building_number as buildingNumber,
+ od.product_name as productName,
+ od.edging_type as edgingType,
+ od.remarks,
+ c.customer_abbreviation as customerAbbreviation,
+ p.product_abbreviation as productAbbreviation,
+ fc.process_id as processId,
+ o.create_time as createTime,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS figureNumber,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS colourCeramicGlaze,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS remarks1,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS remarks2,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S06')) AS remarks3,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S07')) AS remarks4,
+ JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S08')) AS remarks5,
+ p.remarks as filmNumber,
+ od.bend_radius as bendRadius,
+ od.other_columns,
+ JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color,
+ '鏂囨湰' as custom1,
+ '鏂囨湰' as custom2,
+ '鏂囨湰' as custom3,
+ '鏂囨湰' as custom4,
+ '鏂囨湰' as custom5
+ from optimize_detail as opt
+ left join flow_card as fc on opt.project_no=fc.project_no and opt.process_id=fc.process_id and opt.layer=fc.technology_number and opt.order_sort=fc.order_number
+ left join sd.order as o on o.order_id=fc.order_id
+ left join sd.order_detail as od on fc.order_id = od.order_id and od.order_number = fc.order_number
+ left join sd.product as p on p.id = od.product_id
+ left join sd.customer as c on c.id = o.customer_id
+ left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number and
+ pd.glass_sort = fc.technology_number
+ where opt.project_no=#{projectNo} and opt.stock_id=#{stockId}
+ order by opt.stock_id,opt.polys_id
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0