From eef4b7ca66cc2fb34d2d2cb0a4a8643f2bb0f838 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 18 十月 2024 13:44:06 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/Report.xml |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index 376afb5..230db3c 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -151,6 +151,7 @@
         <result column="stockArea" property="stockArea"/>
         <result column="product_name" property="productName"/>
         <result column="bend_radius" property="bendRadius"/>
+        <result column="glassNumber" property="glassNumber"/>
     </resultMap>
 
     <!--    娴佺▼鍗¤繘搴�-->
@@ -168,7 +169,7 @@
                ifnull(f.inventory, 0)                         as inventory,
                round(ifnull(f.inventory, 0) * a.area, 2)      as inventoryArea,
                ifnull(dd.quantity, 0)                         as shippedQuantity,
-               JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')) AS glassNumber
+               ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber
         from flow_card as c
                  left join
              sd.order_detail as a
@@ -257,6 +258,12 @@
         <if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
             and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
         </if>
+        <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
+            and o.project regexp #{crossProcessBreakingDTO.project}
+        </if>
+        <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
+            and o.order_id regexp #{crossProcessBreakingDTO.orderId}
+        </if>
         GROUP BY dd.id
         order by dd.id desc
         limit #{offset},#{pageSize}
@@ -279,6 +286,33 @@
           and dd.available = 0
           and reviewed_state != 2
           and rw.this_process != dd.responsible_process
+        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
+            and JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) regexp #{crossProcessBreakingDTO.code}
+        </if>
+        <if test="crossProcessBreakingDTO.processId != null and crossProcessBreakingDTO.processId != ''">
+            and rw.process_id regexp #{crossProcessBreakingDTO.processId}
+        </if>
+        <if test="crossProcessBreakingDTO.thisProcess != null and crossProcessBreakingDTO.thisProcess != ''">
+            and rw.this_process regexp #{crossProcessBreakingDTO.thisProcess}
+        </if>
+        <if test="crossProcessBreakingDTO.responsibleProcess != null and crossProcessBreakingDTO.responsibleProcess != ''">
+            and dd.responsible_process regexp #{crossProcessBreakingDTO.responsibleProcess}
+        </if>
+        <if test="crossProcessBreakingDTO.responsibleTeam != null and crossProcessBreakingDTO.responsibleTeam != ''">
+            and dd.responsible_team regexp #{crossProcessBreakingDTO.responsibleTeam}
+        </if>
+        <if test="crossProcessBreakingDTO.glassChild != null and crossProcessBreakingDTO.glassChild != ''">
+            and ogd.glass_child regexp #{crossProcessBreakingDTO.glassChild}
+        </if>
+        <if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
+            and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
+        </if>
+        <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
+            and o.project regexp #{crossProcessBreakingDTO.project}
+        </if>
+        <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
+            and o.order_id regexp #{crossProcessBreakingDTO.orderId}
+        </if>
         order by dd.id desc
     </select>
 
@@ -302,7 +336,8 @@
         (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
         odpd.broken_num) / 1000000, 2) as stockArea,
         od.product_name,
-        od.bend_radius
+        od.bend_radius,
+        ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber
 
         from sd.order_detail AS od
         LEFT JOIN sd.order_glass_detail AS ogd
@@ -364,6 +399,9 @@
         </if>
         <if test="workInProgressDTO.technologyNumber != null and workInProgressDTO.technologyNumber != ''">
             and ogd.technology_number regexp #{workInProgressDTO.technologyNumber}
+        </if>
+        <if test="workInProgressDTO.glassNumber != null and workInProgressDTO.glassNumber != ''">
+            and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{workInProgressDTO.glassNumber}
         </if>
         group by fc.process_id, fc.order_number, fc.technology_number
         order by fc.process_id, fc.order_number, fc.technology_number
@@ -451,14 +489,14 @@
                ogd.glass_child,
                ogd.child_width,
                ogd.child_height,
-               od.quantity,
+               fc.quantity,
                ROUND(ogd.child_width * ogd.child_height / 1000000, 2)               as childArea,
-               ROUND(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as actualArea,
+               ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as actualArea,
                odpd.reporting_work_num                                              as completeNum,
                ROUND(ogd.child_width * ogd.child_height * odpd.reporting_work_num / 1000000,
                      2)                                                             as completeArea,
-               od.quantity - odpd.reporting_work_num                                as incompleteNum,
-               ROUND(ogd.child_width * ogd.child_height * (od.quantity - odpd.reporting_work_num) / 1000000,
+               fc.quantity - odpd.reporting_work_num                                as incompleteNum,
+               ROUND(ogd.child_width * ogd.child_height * (fc.quantity - odpd.reporting_work_num) / 1000000,
                      2)                                                             as incompleteArea,
                od.product_name
 
@@ -483,7 +521,7 @@
           and o.create_time between #{selectTime1} and #{selectTime2}
           and position(#{orderId} in od.order_id)
           and position(#{inputProject} in o.project)
-          and od.quantity > odpd.reporting_work_num
+          and fc.quantity - odpd.reporting_work_num>0
 
         group by fc.process_id, fc.order_number, fc.technology_number
         order by fc.process_id, fc.order_number, fc.technology_number
@@ -506,7 +544,7 @@
         round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area,
         IFNULL(dd.responsible_personnel,'') as personnel,
         ogd.glass_child,
-        JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS glassNumber
+        ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber
         FROM
         sd.ORDER AS o
         LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id
@@ -715,7 +753,7 @@
                round(ifnull(f.inventory, 0) * a.area, 2)            as inventoryArea,
                ifnull(dd.quantity, 0)                               as shippedQuantity,
                ifnull(dd.area, 0)                                   as area,
-               JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')) AS glassNumber
+               ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber
 
         from flow_card as c
                  left join

--
Gitblit v1.8.0