From 3a3dad65d748e50c12a349d45efc24b787a79392 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 09 七月 2024 17:12:07 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   61 +++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 7 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 0fb3fac..f02d6e6 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -63,6 +63,7 @@
         sum(c.compute_gross_area) as compute_gross_area,
         a.founder,
         c.processing_note,
+        b.customer_name,
         if(a.layout_status=0,'涓嶅彲鎺掔増',if(a.layout_status=1,'鍙帓鐗�','宸叉帓鐗�')) as layout_status
         from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card
         group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
@@ -93,7 +94,9 @@
         <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '宸叉帓鐗�'">
             and a.layout_status regexp 2
         </if>
-
+        <if test="flowCard.order.customerName != null and flowCard.order.customerName!= ''">
+            and b.customer_name regexp #{flowCard.order.customerName}
+        </if>
         group by a.process_Id
         ORDER BY a.id desc
         limit #{offset},#{pageSize};
@@ -459,7 +462,9 @@
                od.product_name,
                ogd.glass_child,
                fc.founder,
-               date(fc.splitFrame_time) as splitFrame_time
+               date(fc.splitFrame_time) as splitFrame_time,
+              /* if(fc.print_status=0,'鏈墦鍗�','宸叉墦鍗�') as  print_status*/
+        fc.print_status
         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
@@ -505,12 +510,17 @@
                round(ogd.total_area, 2)                                     as total_area,
                od.perimeter,
                od.bend_radius,
-               od.remarks
+               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
         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 fc.technology_number = #{technologyNumber}
         group by fc.process_id, fc.order_number
@@ -549,15 +559,17 @@
                od.width,
                od.height,
                ogd.glass_child,
+               ogd.process,
                e.type_name,
                opd.stock_id,
-               od.quantity
+               od.quantity,
+               od.other_columns
         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
                            on SUBSTR(opd.process_id, 1, 10) = od.order_id and opd.order_sort = od.order_number
                  left join sd.order_glass_detail ogd
-                           on SUBSTR(opd.process_id, 1, 10) = ogd.order_id and opd.order_sort = ogd.order_number
+                           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
         where opd.project_no = #{projectNo}
@@ -574,9 +586,12 @@
                od.order_number as orderNumber,
                fc.technology_number as technologyNumber,
                ogd.glass_child,
+               ogd.process,
                c.customer_abbreviation as customer_name,
                ifnull(od.processing_note,'') as processing_note,
-               bgt.type_name
+               bgt.type_name,
+               od.other_columns,
+               od.building_number
         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
@@ -686,7 +701,8 @@
                od.product_name      as productName,
                od.edging_type       as edgingType,
                p.remarks,
-               c.customer_abbreviation as customerAbbreviation
+               c.customer_abbreviation as customerAbbreviation,
+               od.other_columns
         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
@@ -780,4 +796,35 @@
         order by IF(fc.sort != NULL || fc.sort != '', fc.sort, fc.order_number)
     </select>
 
+    <update id="updatePrintStateMp">
+        update  pp.flow_card
+        set print_status = print_status+1
+        where process_id = #{processId} and technology_number = #{technologyNumber}
+    </update>
+
+    <select id="printFlowCardOrderSortMp">
+        SELECT fc.process_id,
+               fc.order_number,
+               fc.technology_number,
+               ogd.glass_address,
+               ogd.child_width,
+               ogd.child_height,
+               fc.quantity,
+               ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
+               fc.sort
+        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
+        where fc.order_id=#{orderId}
+        order by IF(fc.sort != NULL || fc.sort != '', fc.sort, fc.technology_number)
+    </select>
+
+    <update id="printOrderSortMp">
+        update flow_card
+        set sort = #{sort}
+        where process_id = #{processId}
+          and order_number = #{orderNumber}
+          and technology_number = #{technologyNumber}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0