From ab335a89280e8bc22068c8dc42787959dfbfb466 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 29 八月 2024 15:30:03 +0800
Subject: [PATCH] 新增物料出库打印

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 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 92f06ae..fd7a0ee 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -480,8 +480,8 @@
                       ogdss.technology_number,
                       ogd.glass_address,
                       ROUND(sum(fc.quantity) / (count(DISTINCT fc.technology_number))) as quantity,
-                      sum(ogd.total_area)                                              as total_area,
-                      # SUM(ogd.child_width*child_height*fc.quantity/(count(DISTINCT ogd.technology_number))) as total_area,
+                      # sum(ogd.total_area)                                              as total_area,
+                      ROUND(SUM(ogd.child_width*ogd.child_height*fc.quantity)/1000000/(count(DISTINCT fc.technology_number)),2) as total_area,
                       od.product_name,
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
@@ -523,8 +523,8 @@
                       ogdss.technology_number,
                       ogd.glass_address,
                       ROUND(sum(fc.quantity) / (count(DISTINCT fc.technology_number))) as quantity,
-                      sum(ogd.total_area)                                              as total_area,
-                      # SUM(ogd.child_width*child_height*fc.quantity/(count(DISTINCT ogd.technology_number))) as total_area,
+                     #  sum(ogd.total_area)                                              as total_area,
+                      ROUND(SUM(ogd.child_width*ogd.child_height*fc.quantity)/1000000/(count(DISTINCT fc.technology_number)),2) as total_area,
                       od.product_name,
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
@@ -562,7 +562,7 @@
                       ogdss.technology_number,
                       ogd.glass_address,
                       ROUND(sum(fc.quantity) / (count(DISTINCT fc.technology_number))) as quantity,
-                      sum(ogd.total_area)                                              as total_area,
+                      ROUND(SUM(ogd.child_width*ogd.child_height*fc.quantity)/1000000/(count(DISTINCT fc.technology_number)),2) as total_area,
                       od.product_name,
                       ogdss.concatenated_glass_child                                   as glass_child,
                       fc.founder,
@@ -759,7 +759,7 @@
                o.customer_id,
                ogd.child_width                as width,
                ogd.child_height               as height,
-               od.quantity,
+               fc.quantity,
                od.order_number                as orderNumber,
                fc.technology_number           as technologyNumber,
                ogd.glass_child,
@@ -883,7 +883,7 @@
                od.processing_note                                    as processingNote,
                width,
                height,
-               od.quantity,
+               fc.quantity,
                od.order_number                                       as orderNumber,
                fc.technology_number                                  as technologyNumber,
                od.building_number                                    as buildingNumber,
@@ -945,7 +945,9 @@
                od.product_name,
                ogd.glass_child,
                fc.print_status,
-               pl.reporting_work_id
+               pl.reporting_work_id,
+               JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01'))                AS glassNumber
+
         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
@@ -1128,7 +1130,8 @@
                pl.rework_processes,
                od.product_name,
                ogd.glass_child,
-               pl.reporting_work_id
+               pl.reporting_work_id,
+               JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber
         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
@@ -1218,7 +1221,7 @@
     <select id="getDetailListRefund">
         select fc.order_number,
                concat(round(ogd.child_width), "*", round(ogd.child_height))   as child_width,
-               (pl.patch_num)                                                 as quantity,
+               sum(pl.patch_num)                                                 as quantity,
                round(ogd.total_area, 2)                                       as total_area,
                od.perimeter,
                od.bend_radius,
@@ -1264,7 +1267,8 @@
                dd.responsible_process,
                dd.responsible_team,
                concat('瀵瑰簲鎴戝徃鍗曞彿', o.batch)                 AS otherRemarks,
-               dd.responsible_personnel
+               dd.responsible_personnel,
+               #{mergeTechnologyNumber} as  mergeTechnologyNumber
         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
@@ -1501,7 +1505,7 @@
                od.processing_note                                    as processingNote,
                round(ogd.child_width)                                as width,
                round(ogd.child_height)                               as height,
-               od.quantity,
+               fc.quantity,
                od.order_number                                       as orderNumber,
                fc.technology_number                                  as technologyNumber,
                od.building_number                                    as buildingNumber,
@@ -1541,7 +1545,7 @@
                                and fcs.process = #{process}
         where fc.process_id = #{processId}
           and position(fc.technology_number in #{technologyNumber})
-        group by od.order_number, ogd.technology_number, ogd.child_width, ogd.child_height
+        group by fc.process_id,od.order_number, ogd.technology_number, ogd.child_width, ogd.child_height
         order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number)
     </select>
 
@@ -1554,8 +1558,8 @@
                fc.order_number,
                ogd.technology_number,
                ogd.glass_address,
-               sum(od.quantity)         as quantity,
-               sum(ogd.total_area)      as total_area,
+               sum(fc.quantity)                                                          as quantity,
+               round(sum(ogd.child_width * ogd.child_height * fc.quantity / 1000000), 2) as total_area,
                od.product_name,
                ogd.glass_child,
                fc.founder,

--
Gitblit v1.8.0