From 74afa7174d1f6159aa2f7d2404903b36e13cef1f Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 10 三月 2025 14:46:18 +0800
Subject: [PATCH] 流程卡分家删除部分已分流程卡后重新分架数量不正确问题,次破报表后端求和sql语法错误调整

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |    7 ++++---
 1 files changed, 4 insertions(+), 3 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 aff91d4..6be0699 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -211,7 +211,7 @@
                ogd.production_id,
                od.product_id,
                od.product_name,
-               ROUND(SUM(od.quantity)-IFNULL(sum(fc.quantity)/count(fc.technology_number),0))            as quantity,
+               ROUND(SUM(DISTINCT od.quantity)-IFNULL(sum(fc.quantity)/fc.layers_number,0))            as quantity,
                SUM(od.compute_gross_area)  as compute_gross_area,
                round(sum(od.perimeter), 2) as perimeter
         from sd.order_detail as od
@@ -272,7 +272,7 @@
                od.quantity,
                od.compute_gross_area,
                p.total_thickness,
-               ROUND(od.quantity-IFNULL(sum(fc.quantity)/count(fc.technology_number),0))           as baiscQuantity,
+               ROUND(od.quantity-IFNULL(sum(fc.quantity)/fc.layers_number,0))           as baiscQuantity,
                od.compute_gross_area as 'computeGrossArea',
                p.total_thickness     AS 'totalThickness',
                ifnull(p.thickness,'') as thickness,
@@ -289,7 +289,7 @@
         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 sd.product as p on od.product_id = p.id
                  left join (SELECT order_id,
                                    order_number,
                                    JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')) AS S01,
@@ -2900,6 +2900,7 @@
     <select id="getOrderDetailByProductionId">
         select * from (select a.*,
                               a.quantity as 'baiscQuantity',
+                              #{glassThickness} as 'thickness',
         IF(a.height >= a.width, a.height, a.width) as 'long',
         IF(a.height &lt; a.width, a.height, a.width) as 'short'
         from sd.order_detail as a

--
Gitblit v1.8.0