From f1a496f4b53e3de34bdf82dab0faa40d2a29bc11 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期一, 24 六月 2024 09:02:36 +0800
Subject: [PATCH] 其他金额设置筛选类型

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |  172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 163 insertions(+), 9 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 9718ead..b7cef34 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -49,6 +49,8 @@
         <result column="g_type" property="glassTypes.type"/>-->
 
     </resultMap>
+
+
     <!--    娴佺▼鍗$鐞嗘煡璇�-->
     <select id="selectFlowCard" resultMap="flowCardMap">
         select
@@ -81,7 +83,15 @@
         <if test="flowCard.order.project != null and flowCard.order.project!= ''">
             and b.project regexp #{flowCard.order.project}
         </if>
-
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '涓嶅彲鎺掔増'">
+            and a.layout_status regexp 0
+        </if>
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '鍙帓鐗�'">
+            and a.layout_status regexp 1
+        </if>
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '宸叉帓鐗�'">
+            and a.layout_status regexp 2
+        </if>
 
         group by a.process_Id
         ORDER BY a.id desc
@@ -99,8 +109,8 @@
         <if test="flowCard.orderId != null and flowCard.orderId != ''">
             and a.order_id regexp #{flowCard.orderId}
         </if>
-        <if test="flowCard.productionId != null and flowCard.productionId != ''">
-            and a.process_Id regexp #{flowCard.productionId}
+        <if test="flowCard.processId != null and flowCard.processId != ''">
+            and a.process_Id regexp #{flowCard.processId}
         </if>
         <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
             and c.product_id regexp #{flowCard.orderDetail.productId}
@@ -111,6 +121,15 @@
 
         <if test="flowCard.order.project != null and flowCard.order.project!= ''">
             and b.project regexp #{flowCard.order.project}
+        </if>
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '涓嶅彲鎺掔増'">
+            and a.layout_status regexp 0
+        </if>
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '鍙帓鐗�'">
+            and a.layout_status regexp 1
+        </if>
+        <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and  flowCard.layoutStatus == '宸叉帓鐗�'">
+            and a.layout_status regexp 2
         </if>
 
         ORDER BY a.id desc
@@ -174,7 +193,7 @@
         od.product_name,
         SUM( od.quantity) as quantity,
         SUM(od.compute_gross_area) as compute_gross_area,
-        sum(od.perimeter) as perimeter
+        round(sum(od.perimeter),2) as perimeter
         from sd.order_detail as od left join
         (select order_id,order_number,production_id,splitting_status from sd.order_glass_detail
         GROUP BY order_id,order_number
@@ -407,6 +426,7 @@
         select * from  sd.order where create_time between #{selectTime1} and #{selectTime2} and
                                       position(#{orderId} in order_id ) and position(#{project} in project)
         and processing_card=2
+        order by create_time desc
     </select>
 
     <select id="selectPrintMp">
@@ -415,10 +435,11 @@
                fc.process_id,
                o.customer_name,
                o.project,
+               fc.order_number,
                ogd.technology_number,
                ogd.glass_address,
-               od.quantity,
-               ogd.total_area,
+               sum(od.quantity) as quantity,
+               sum(ogd.total_area) as total_area,
                od.product_name,
                ogd.glass_child,
                fc.founder,
@@ -445,7 +466,7 @@
                o.processing_note,
                fc.process_id,
                SUM( od.quantity) as quantity,
-               SUM(ogd.total_area) as gross_area,
+               round(SUM(ogd.total_area),2) as gross_area,
                SUM(od.weight) as weight,
                #{technologyNumber} as technologyNumber,
                concat(fc.process_id,'/',#{technologyNumber}) as  processIdNumber
@@ -462,7 +483,7 @@
 
     <select id="getDetailList">
         select fc.order_number,
-               concat(ogd.child_width, "*", ogd.child_height) as child_width,
+               concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width,
                od.quantity,
                round(ogd.total_area,2) as total_area,
                od.perimeter,
@@ -476,7 +497,7 @@
         where fc.process_id = #{processId}
           and fc.technology_number = #{technologyNumber}
         group by fc.process_id, fc.order_number
-        order by fc.order_number
+        order by IF(sort!=NULL||sort!='',sort,fc.order_number)
     </select>
 
     <select id="getProcessList">
@@ -491,4 +512,137 @@
         update flow_card set inventory_quantity=#{completedQuantity}
         where process_id = #{processId} and  order_number = #{orderNumber} and technology_number = #{technologyNumber}
     </update>
+
+<!--    澶嶉�夋淇敼鎺掔増鐘舵��-->
+    <update id="updateComposing">
+        update flow_card as fc
+        set fc.layout_status=1
+        where fc.process_id = #{processId}
+    </update>
+
+    <select id="getPrintLabel">
+        select c.customer_name,
+               c.order_id,
+               e.type_name,
+               b.remarks,
+               c.project,
+                a.child_width,
+               a.child_height,
+               sum(b.quantity) as quantity,
+               a.glass_child,
+               b.processing_note
+        from sd.order_glass_detail as a
+                 left join sd.order_detail as b
+                           on a.order_id = b.order_id
+                               and a.order_number = b.order_number
+                 left join sd.`order` as c
+                           on c.order_id = a.order_id
+                 left join flow_card as d
+                           on d.order_id = a.order_id and d.order_number = a.order_number and
+                              d.technology_number = a.technology_number
+                 left join sd.basic_glass_type e
+                           on e.type_id = b.product_id
+        where d.process_id = #{processId}
+          and d.technology_number = #{technologyNumber}
+        group by a.glass_child, a.child_width, a.child_height
+        order by d.technology_number
+    </select>
+
+    <select id="printFlowCardDetailsMp">
+        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
+        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.process_id = #{processId}
+          and fc.technology_number = #{technologyNumber}
+    </select>
+
+    <update id="printSortMp">
+        update flow_card
+        set sort = #{sort}
+        where process_id = #{processId}
+          and order_number=#{orderNumber}
+          and technology_number = #{technologyNumber}
+    </update>
+
+    <select id="selectType">
+        select * from pp.tag_style
+    </select>
+<select id="getPrintTitle">
+    select value from pp.tag_style as a where  a.name=#{type}
+</select>
+
+    <select id="getCustomLabelDetailMp">
+        select #{name} from #{form} where order_id=#{id}
+    </select>
+
+    <resultMap id="orderDetial" type="com.example.erp.entity.sd.OrderDetail">
+        <result column="width" property="width"/>
+        <result column="height" property="height"/>
+        <result column="order_id" property="order.orderId"/>
+        <result column="project" property="order.project"/>
+        <result column="customer_id" property="order.customerId"/>
+        <result column="customer_name" property="order.customerName"/>
+        <result column="order_type" property="order.orderType"/>
+        <result column="order_classify" property="order.orderClassify"/>
+        <result column="batch" property="order.batch"/>
+        <result column="icon" property="order.icon"/>
+        <result column="pack_type" property="order.packType"/>
+        <result column="delivery_date" property="order.deliveryDate"/>
+        <result column="al_type" property="order.alType"/>
+        <result column="money" property="order.money"/>
+        <result column="contract_id" property="order.contractId"/>
+        <result column="customer_batch" property="order.customerBatch"/>
+        <result column="contacts" property="order.contacts"/>
+        <result column="delivery_address" property="order.deliveryAddress"/>
+        <result column="processing_note" property="processingNote"/>
+        <result column="quantity" property="quantity"/>
+    </resultMap>
+
+    <select id="getPrintCustomData" resultMap="orderDetial">
+        select o.order_id,
+               project,
+               customer_id,
+               customer_name,
+               order_type,
+               order_classify,
+               batch,
+               o.icon,
+               pack_type,
+               delivery_date,
+               al_type,
+               money,
+               contract_id,
+               customer_batch,
+               contacts,
+               delivery_address,
+               od.processing_note,
+                width,
+                height,
+               od.quantity,
+               od.order_number,
+               fc.technology_number
+
+        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
+                                                    od.order_number = fc.order_number
+        where fc.process_id = #{processId}
+        and fc.technology_number=#{technologyNumber}
+       group by od.order_number,width,height
+
+    </select>
+
+    <select id="getPrintLabelCount">
+
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0