From 25cc86fd8a2fb3b2bb6b385cba0adaf89ff3dcdc Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:32 +0800
Subject: [PATCH] 流程卡进度打印部分代码
---
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 100 insertions(+), 0 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 33f08a2..952fb3c 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -3935,4 +3935,104 @@
select basic_name as process,sort FROM sd.basic_data as bd
where bd.basic_category='process' and bd.basic_name = #{processName}
</select>
+ <select id="OrderProcess">
+ select DISTINCT basic_name as process,nickname,sort from sd.basic_data where basic_category = 'process'
+ </select>
+
+ <select id="PrintProgressProcessCardData">
+ select a.product_name,
+ b.glass_child,
+ d.order_type,
+ c.process_id,
+ c.process_id as 'processId',
+ c.order_id,
+ c.order_number,
+ c.technology_number,
+ b.child_width,
+ b.child_height,
+ c.quantity,
+
+ c.quantity-ifnull(c.termination_quantity,0) as thisQuantity,/*鐢ㄤ簬鍒ゆ柇鏄惁鏀瑰彉棰滆壊*/
+ e.reportWorkQuantity,
+ e.reportWorkQuantityShow,
+ e.reportWorkQuantityCount,
+ e.reportWorkTime,
+ e.broken_num,
+ c.quantity-ifnull(c.termination_quantity,0) as glassQuantity,
+
+ c.quantity-ifnull(c.termination_quantity,0) as quantityShow,
+ round( (c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2) as grossAreaShow,
+ ifnull(c.received_quantity, 0) as StorageShow,
+ ifnull(dd.quantity, 0) as shippedQuantityShow, -- 鍙戣揣鏁伴噺
+ round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedAreaShow, -- 鍙戣揣闈㈢Н
+ round((ifnull(c.received_quantity, 0))*a.compute_area,2) as StorageAreaShow,-- 鍏ュ簱闈㈢Н
+
+ round((c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2)as grossArea,
+ ifnull(c.received_quantity, 0) as Storage,
+ ifnull(dd.quantity, 0) as shippedQuantity,
+ round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedArea,
+ round((ifnull(c.received_quantity, 0))*a.compute_area,2) as StorageArea,
+
+
+ ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber,
+ b.`group`,
+ c.print_status,
+ c.print_number,
+ o.project,
+ o.customer_name
+
+ from pp.flow_card as c
+ left join
+ sd.order_detail as a
+ on c.order_id = a.order_id
+ and c.order_number = a.order_number
+ left join sd.order_glass_detail as b
+ on c.order_id = b.order_id
+ and b.order_number = c.order_number
+ and c.technology_number = b.technology_number
+ left join sd.`order` as d
+ on c.order_id = d.order_id
+ # left join mm.finished_goods_inventory as f
+ # on c.order_id = f.order_id and f.order_number = c.order_number
+ left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number
+ left join (SELECT a.process_id,
+ a.order_number,
+ a.technology_number,
+ sum(a.broken_num) as broken_num,
+ concat('{',
+ GROUP_CONCAT(concat("\"", process, "\":\"", if(a.technology_number!=1 and (bd.nickname='stepD' || bd.nickname='stepB' ) ,0,reporting_work_num), "\"")),
+ '}'
+ ) as reportWorkQuantity,
+ concat('{',
+ GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")),
+ '}'
+ ) as reportWorkQuantityShow,
+ concat('{',
+ GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")),
+ '}'
+ ) as reportWorkQuantityCount,
+ concat('{',
+ GROUP_CONCAT(concat("\"", process, "\":\"", IFNULL(date(a.update_time),''), "\"")),
+ '}'
+ ) as reportWorkTime
+ FROM sd.order_process_detail as a
+ left join (SELECT DISTINCT basic_name,nickname from sd.basic_data as bd where bd.basic_category = 'process') as bd
+ on a.process = bd.basic_name
+ left join pp.flow_card as fc on fc.process_id=a.process_id and fc.order_number=a.order_number and fc.technology_number=a.technology_number
+ where (fc.create_time) >= #{startDate} and (fc.create_time) <= #{endDate}
+ GROUP BY a.process_id, a.order_number, a.technology_number
+
+
+ ) as e
+ on e.process_id = c.process_id
+ and e.technology_number = c.technology_number
+ and e.order_number = c.order_number
+ left join sd.`order` as o on o.order_id =c.order_id
+ where (c.create_time) >= #{startDate} and (c.create_time) <= #{endDate}
+ and d.create_order>0 and c.quantity-ifnull(c.termination_quantity,0)>0
+ group by c.order_number,
+ c.technology_number,
+ c.process_id
+ order by c.process_id, c.order_number, c.technology_number
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0