From 27b3352a6a7f514c98cce083eded6c3bb9e3f519 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 15 一月 2025 10:50:10 +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 |   59 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 45 insertions(+), 14 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 efd51ed..65dfcd3 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -68,9 +68,11 @@
         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,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
+        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 date(a.create_time)>=#{selectTime1} and date(a.create_time) &lt;= #{selectTime2}
+        and b.create_order>0
         <if test="flowCard.orderId != null and flowCard.orderId != ''">
             and a.order_id regexp #{flowCard.orderId}
         </if>
@@ -115,6 +117,7 @@
         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 date(a.create_time)>=#{selectTime1} and date(a.create_time) &lt;= #{selectTime2}
+        and b.create_order>0
         <if test="flowCard.orderId != null and flowCard.orderId != ''">
             and a.order_id regexp #{flowCard.orderId}
         </if>
@@ -484,15 +487,18 @@
     </select>
 
     <select id="selectPrintFlowCard">
-        select project_no,glass_total,glass_total_area,labelPrintNum,processPrintNum
-        from pp.optimize_project
-        where date(create_time)>=#{selectTime1} and date(create_time) &lt;= #{selectTime2}
-          and state >= 20
-        order by create_time desc
+        select op.project_no,glass_total,glass_total_area,labelPrintNum,processPrintNum
+        from pp.optimize_project as op
+                 left join pp.flow_card as fc on op.project_no=fc.project_no
+                 left join sd.`order` as o on o.order_id=fc.order_id
+        where date(op.create_time)>=#{selectTime1} and date(op.create_time) &lt;= #{selectTime2}
+          and state >= 20 and o.create_order>0
+        GROUP BY op.project_no
+        order by op.create_time desc
     </select>
 
     <select id="selectPrintMp">
-        select *
+        SELECT result.*,fcc.print_status from ( select *
         from ((select fc.id,
                       fc.order_id,
                       fc.process_id,
@@ -507,7 +513,6 @@
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
                       date(fc.splitFrame_time)                                         as splitFrame_time,
-                      fc.print_status,
                       processed_part                                                   as process
 
                from flow_card as fc
@@ -549,7 +554,6 @@
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
                       date(fc.splitFrame_time)                                         as splitFrame_time,
-                      fc.print_status,
                       processed_part                                                   as process
 
                from flow_card as fc
@@ -587,7 +591,6 @@
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
                       date(fc.splitFrame_time)                                         as splitFrame_time,
-                      fc.print_status,
                       processed_part                                                   as process
 
                from flow_card as fc
@@ -618,7 +621,9 @@
         where process is not null
           and process != ""
         GROUP BY order_id, process_id, technology_number, process
-        order by order_id, process_id, length(technology_number)
+        order by order_id, process_id, length(technology_number)) as result
+        LEFT JOIN (SELECT * from flow_card GROUP BY process_id,technology_number) as fcc
+        on result.process_id = fcc.process_id and result.technology_number = fcc.technology_number
     </select>
 
     <select id="getPrimaryList">
@@ -1056,7 +1061,7 @@
                            on ogd.order_id = fc.order_id and ogd.order_number = fc.order_number and
                               ogd.technology_number = fc.technology_number
         where fc.process_id = #{processId}
-          and fc.technology_number = #{technologyNumber}
+          and fc.order_number = #{orderNumber}
         group by od.order_number, width, height
         order by fc.process_id
     </select>
@@ -1140,7 +1145,19 @@
                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.bend_radius                                        as bendRadius,
+               CONCAT(
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))),
+                       ' X ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))),
+                       ' = ',pl.patch_num   )      as size,
+
+               CONCAT(
+                       od.order_number,')  ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))),
+                       ' X ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))),
+                       ' = ',pl.patch_num   )      as numberSize
         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
@@ -1151,6 +1168,7 @@
                  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
         where pl.process_id = #{processId}
+            and pl.order_sort=#{orderNumber}
           and pl.technology_number = #{technologyNumber}
           and pl.reporting_work_id = #{reportingWorkId}
         group by od.order_number, width, height
@@ -1925,7 +1943,19 @@
                od.bend_radius                                        as bendRadius,
                ogd.glass_child                                       as glassChild,
                ogd.glass_address                                     as glassAddress,
-               JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color'))  AS color
+               JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color'))  AS color,
+               CONCAT(
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))),
+                       ' X ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))),
+                       ' = ',pl.patch_num   )      as size,
+
+               CONCAT(
+                       od.order_number,')  ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(width AS CHAR))),
+                       ' X ',
+                       TRIM(TRAILING '.' FROM TRIM(TRAILING '0' FROM CAST(height AS CHAR))),
+                       ' = ',pl.patch_num   )      as numberSize
         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
@@ -1939,6 +1969,7 @@
                            on ogd.order_id = o.order_id and ogd.order_number = od.order_number and
                               ogd.technology_number = fc.technology_number
         where pl.process_id = #{processId}
+          and pl.order_sort=#{orderNumber}
           and pl.technology_number = #{technologyNumber}
           and pl.reporting_work_id = #{reportingWorkId}
         group by od.order_number, width, height

--
Gitblit v1.8.0