From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml |   59 +++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml
index f6479f6..ff6017c 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedGlassShelf.xml
@@ -36,13 +36,12 @@
     </select>
 
     <select id="getSelectFinishedGlassShelfInformationInventoryArea">
-        select
-            *
-        from
-            mm.finished_glass_shelf_information
-        where
+        SELECT
+            ifnull(MAX(CAST(REGEXP_REPLACE(glass_shelf_number, '[^0-9]', '')AS UNSIGNED)),0) AS maxDindex
+        FROM
+            finished_glass_shelf_information
+        WHERE
             glass_shelf_number regexp #{inventoryArea}
-
 
     </select>
 
@@ -88,13 +87,16 @@
     <select id="getSelectFinishedGlassShelfInformationDate">
         select
             id,
+            glass_shelf_name as glassShelfName,
+            price,
+            unit,
             count(*) as quantity,
             max_weight as maxWeight,
             max_width as maxWidth,
             max_height as maxHeight
         from mm.finished_glass_shelf_information
         where state=0
-        group by max_weight,max_width,max_height
+        group by glass_shelf_name,price,unit,max_weight,max_width,max_height
         limit #{offset},#{pageSize};
     </select>
 
@@ -102,7 +104,8 @@
         select
             CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
             count(zu.id) as 'total'
-        from ( select id as id from mm.finished_glass_shelf_information where state=0 group by max_weight,max_width,max_height) as zu
+        from ( select id as id from mm.finished_glass_shelf_information where state=0
+                                                                        group by glass_shelf_name,price,unit,max_weight,max_width,max_height) as zu
     </select>
 
     <select id="getSelectFinishedGlassShelfInformationDateDetail">
@@ -138,10 +141,14 @@
         '' as remarks,
         max_weight as maxWeight,
         max_width as maxWidth,
-        max_height as maxHeight
+        max_height as maxHeight,
+        price,
+        unit,
+        glass_shelf_name as glassShelfName
         from
-            mm.finished_glass_shelf_information  where max_weight=#{weight} and max_width=#{width} and max_height=#{height}
-        group by max_weight,max_width,max_height
+            mm.finished_glass_shelf_information  where state=0 and max_weight=#{weight} and max_width=#{width} and max_height=#{height}
+                                                 and glass_shelf_name=#{glassShelfName} and price=#{price} and unit=#{unit}
+        group by max_weight,max_width,max_height,glass_shelf_name,price,unit
 
     </select>
 
@@ -159,6 +166,7 @@
 
     <select id="getSelectFinishedGlassShelfEmitDetailsByemitId" >
         select
+            fed.glass_shelf_name as glassShelfName,
             fed.quantity as quantity,
             ifnull(fi.quantity+fed.quantity,fed.quantity) as availableQuantity,
             fed.price,
@@ -174,9 +182,13 @@
             fed.emit_number as emitNumber
         from
             mm.finished_glass_shelf_emit_details fed left join
-            (select count(*) as quantity,max_weight,max_width,max_height
-             from mm.finished_glass_shelf_information where state=0 group by max_weight,max_width,max_height) fi
-            on fed.max_weight=fi.max_weight and fed.max_weight=fi.max_weight and fed.max_width=fi.max_width
+            (select count(*) as quantity,max_weight,max_width,max_height,glass_shelf_name,unit,price
+             from mm.finished_glass_shelf_information
+             where state=0
+             group by max_weight,max_width,max_height,glass_shelf_name,unit,price
+             ) fi
+            on fed.max_weight=fi.max_weight and fed.max_weight=fi.max_weight and fed.max_width=fi.max_width and
+               fed.glass_shelf_name=fi.glass_shelf_name and fed.unit=fi.unit and fed.price=fi.price
         where emit_id=#{emitId}
     </select>
 
@@ -205,21 +217,21 @@
 
     <insert id="insertFinishedGlassShelfEmitDetails"  useGeneratedKeys="true" >
         insert into mm.finished_glass_shelf_emit_details(emit_id,emit_number,max_weight,max_width,max_height,
-                                                         withdraw_quantity,quantity,price,unit,money,remarks)
+                                                         withdraw_quantity,quantity,price,unit,money,remarks,glass_shelf_name)
         values (
                    #{emitId},#{emitNumber},#{finishedGlassShelfEmitDetails.maxWeight},
                 #{finishedGlassShelfEmitDetails.maxWidth},#{finishedGlassShelfEmitDetails.maxHeight}
                ,0,#{finishedGlassShelfEmitDetails.quantity},#{finishedGlassShelfEmitDetails.price},#{finishedGlassShelfEmitDetails.unit},
-                #{finishedGlassShelfEmitDetails.money},#{finishedGlassShelfEmitDetails.remarks}
+                #{finishedGlassShelfEmitDetails.money},#{finishedGlassShelfEmitDetails.remarks},#{finishedGlassShelfEmitDetails.glassShelfName}
                )
     </insert>
 
     <insert id="insertFinishedGlassShelfEmitDetailsLog"  useGeneratedKeys="true" >
         insert into mm.finished_glass_shelf_log(document_id,document_number,type,quantity,price,money,unit,
-                                                remarks,create_time,max_weight,max_width,max_height)
+                                                remarks,create_time,max_weight,max_width,max_height,glass_shelf_name,operator)
         values (
                    #{emitId},#{emitNumber},#{type},#{quantity},#{price},#{money},#{unit},
-                #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight}
+                #{remarks},now(),#{maxWeight},#{maxWidth},#{maxHeight},#{glassShelfName},#{operator}
                )
     </insert>
 
@@ -227,6 +239,9 @@
         update finished_glass_shelf_information set state=1 where state=0 and max_weight=#{maxWeight}
                                                               and max_width=#{maxWidth}
                                                               and max_height=#{maxHeight}
+                                                              and price=#{price}
+                                                              and unit=#{unit}
+                                                              and glass_shelf_name=#{glassShelfName}
          order by id limit #{quantity}
     </update>
 
@@ -234,6 +249,9 @@
         update finished_glass_shelf_information set state=0 where state=1 and max_weight=#{maxWeight}
                                                               and max_width=#{maxWidth}
                                                               and max_height=#{maxHeight}
+                                                              and price=#{price}
+                                                              and unit=#{unit}
+                                                              and glass_shelf_name=#{glassShelfName}
          order by id limit #{quantity}
     </update>
 
@@ -335,6 +353,7 @@
     <select id="getSelectFinishedGlassShelfWithdrawDetailsBywithdrawId" >
         select
             fgw.emit_id as emitId,
+            fgw.glass_shelf_name as glassShelfName,
             fgw.emit_number as emitNumber,
             fgw.max_weight as maxWeight,
             fgw.max_width as maxWidth,
@@ -436,12 +455,12 @@
 
     <insert id="insertFinishedGlassShelfWithdrawDetails"  useGeneratedKeys="true" >
         insert into mm.finished_glass_shelf_withdraw_details(withdraw_id,withdraw_number,max_weight,emit_id,emit_number,max_width,max_height,
-                                                         quantity,price,unit,money,remarks)
+                                                         quantity,price,unit,money,remarks,glass_shelf_name)
         values (
                    #{withdrawId},#{withdrawNumber},#{finishedGlassShelfWithdrawDetails.maxWeight},#{finishedGlassShelfWithdrawDetails.emitId},#{finishedGlassShelfWithdrawDetails.emitNumber},
                     #{finishedGlassShelfWithdrawDetails.maxWidth},#{finishedGlassShelfWithdrawDetails.maxHeight}
                    ,#{finishedGlassShelfWithdrawDetails.quantity},#{finishedGlassShelfWithdrawDetails.price},#{finishedGlassShelfWithdrawDetails.unit},
-                   #{finishedGlassShelfWithdrawDetails.money},#{finishedGlassShelfWithdrawDetails.remarks}
+                   #{finishedGlassShelfWithdrawDetails.money},#{finishedGlassShelfWithdrawDetails.remarks},#{finishedGlassShelfWithdrawDetails.glassShelfName}
                )
     </insert>
 

--
Gitblit v1.8.0