From 578aacf0caebf2b3677702ef21bf87f56a49c91f Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期三, 17 七月 2024 09:09:14 +0800
Subject: [PATCH] 报工鼠标移动和第一道工序补片

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |  111 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 98 insertions(+), 13 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 7ebb414..1191627 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -218,7 +218,6 @@
                 on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number
         set ogd.splitting_status=0
         where ogd.order_id = #{orderId}
-          and ogd.production_id = left(#{processId}, 11)
 
     </update>
 
@@ -226,7 +225,7 @@
     <update id="deleteFlowCardMp">
         delete
         from flow_card as fc
-        where fc.production_id = left(#{processId}, 11)
+        where fc.order_id = left(#{processId}, 10)
     </update>
 
     <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
@@ -246,11 +245,31 @@
                od.compute_gross_area as 'computeGrossArea',
                p.total_thickness     AS 'totalThickness',
                p.thickness,
-               od.weight
+               od.weight,
+               od.remarks,
+               ods.S01,
+               ods.S02,
+               ods.S03,
+               ods.S04,
+               ods.S05
         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
                  left join sd.product as p on od.product_name = p.product_name
+                 left join (
+            SELECT
+                order_id,
+                order_number,
+                JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S01' )) AS S01,
+                JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S02' )) AS S02,
+                JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S03' )) AS S03,
+                JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S04' )) AS S04,
+                JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S05' )) AS S05
+            FROM
+                sd.order_detail
+            WHERE
+                order_id = #{orderId}
+        ) as ods on ods.order_id=od.order_id and ods.order_number=od.order_number
         where od.order_id = #{orderId}
           and ogd.production_id = #{productionId}
           and ogd.splitting_status = 0
@@ -427,11 +446,11 @@
     <delete id="deleteReportingWork">
         delete
         from sd.order_process_detail
-        where left(process_id, 11) = left(#{processId}, 11)
+        where order_id = left(#{processId}, 10)
     </delete>
 
     <select id="selectPrintFlowCardMp">
-        select *
+        select order_id,project,customer_name,quantity,area,order_type,pack_type,batch
         from sd.order
         where create_time between #{selectTime1} and #{selectTime2}
           and position(#{orderId} in order_id)
@@ -525,7 +544,8 @@
                od.other_columns,
                round(ogd.child_width) as width,
                round(ogd.child_height) as height,
-               pd.separation
+               pd.separation,
+               fc.technology_number
         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
@@ -563,18 +583,19 @@
 
     <select id="getPrintLabel">
         select o.order_id,
-               o.customer_name,
+               c.customer_abbreviation as customer_name,
                o.project,
                od.building_number,
                od.processing_note,
-               od.width,
-               od.height,
+               ogd.child_width as width,
+               ogd.child_height as height,
                ogd.glass_child,
                ogd.process,
                e.type_name,
                opd.stock_id,
                od.quantity,
-               od.other_columns
+               od.other_columns,
+               od.bend_radius
         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
@@ -583,6 +604,7 @@
                            on SUBSTR(opd.process_id, 1, 10) = ogd.order_id and opd.order_sort = ogd.order_number and opd.layer=ogd.technology_number
                  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
         where opd.project_no = #{projectNo}
         order by opd.stock_id
     </select>
@@ -591,8 +613,8 @@
         select o.order_id ,
                o.project,
                o.customer_id ,
-               od.width,
-               od.height,
+               ogd.child_width as width,
+               ogd.child_height as height,
                od.quantity,
                od.order_number as orderNumber,
                fc.technology_number as technologyNumber,
@@ -602,7 +624,8 @@
                ifnull(od.processing_note,'') as processing_note,
                bgt.type_name,
                od.other_columns,
-               od.building_number
+               od.building_number,
+               od.bend_radius
         from sd.order as o
                  left join sd.order_detail as od on o.order_id = od.order_id
                  left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number
@@ -875,4 +898,66 @@
           and position(fc.technology_number in #{technologyNumber}) and ogdc.concatenated_glass_child is NOT null
         group by fc.process_id, fc.technology_number
     </select>
+
+    <select id="selectorderOtherMoney">
+        select * from sd.basic_other_money where (id=21 or id>31)
+    </select>
+
+    <select id="selectReworkPrintMp">
+        select fc.id,
+               fc.order_id,
+               fc.process_id,
+               o.customer_name,
+               o.project,
+               fc.order_number,
+               ogd.technology_number,
+               ogd.glass_address,
+               pl.rework_num,
+               pl.rework_area,
+               pl.rework_team,
+               pl.responsible_equipment,
+               pl.responsible_personnel,
+               pl.rework_type,
+               pl.rework_reason,
+               pl.rework_processes,
+               od.product_name,
+               ogd.glass_child
+        from flow_card as fc
+                 left join sd.order_glass_detail as ogd
+                           on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number and
+                              ogd.technology_number = fc.technology_number
+                 left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number
+                 left join sd.`order` as o on o.order_id = fc.order_id
+                 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}
+        GROUP BY fc.process_id, ogd.technology_number
+        order by fc.process_id, ogd.technology_number
+    </select>
+
+    <select id="getDetailListLike">
+        select fc.order_number,
+               concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width,
+               od.quantity,
+               round(ogd.total_area, 2)                                     as total_area,
+               od.perimeter,
+               od.bend_radius,
+               concat(od.processing_note,od.remarks) as remarks,
+               od.other_columns,
+               round(ogd.child_width) as width,
+               round(ogd.child_height) as height,
+               pd.separation,
+               fc.technology_number
+        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
+                              fc.technology_number = ogd.technology_number
+                 left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number
+                 left join sd.product_detail as pd on pd.prod_id=od.product_id and pd.glass_sort=ogd.technology_number
+        where fc.process_id = #{processId}
+          and position(fc.technology_number in #{technologyNumber})
+        group by fc.process_id, fc.order_number,fc.technology_number
+        order by IF(sort != NULL || sort != '', sort, fc.order_number)
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0