From 8112ef4d25672733c725b105e0bb6d8d2d2027c0 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 05 九月 2025 13:19:09 +0800
Subject: [PATCH] 提交物料库存修改,以及玻璃料架部分新增功能

---
 north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
index 804b60f..a7b58af 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -625,19 +625,19 @@
     </select>
 
     <select id="getMaterialInventoryCount" >
-        select * from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture}
+        select * from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer}
     </select>
 
     <select id="getMaterialInventoryCountNull" >
-        select * from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture is null
+        select * from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture is null  and producer=#{producer}
     </select>
 
     <select id="getMaterialInventoryCountId" >
-        select id from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture}
+        select id from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer}
     </select>
 
     <select id="getMaterialInventoryCountNullId" >
-        select id from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture is null
+        select id from mm.material_inventory where  material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer}
     </select>
 
     <select id="getIsNotMaterialOutboundDetail" >
@@ -817,33 +817,34 @@
                                          available_quantity=available_quantity+#{materialInventory.inventoryQuantity},
                                          total_area=single_piece_area*inventory_quantity
                                      where  material_code=#{materialCode} and date_of_manufacture=#{materialInventory.dateOfManufacture}
+                                       and producer=#{materialInventory.producer}
     </update>
 
     <update id="updateMaterialInventoryNull" >
         update mm.material_inventory set inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity},
                                          available_quantity=available_quantity+#{materialInventory.inventoryQuantity},
                                          total_area=single_piece_area*inventory_quantity
-        where  material_code=#{materialCode} and date_of_manufacture is null
+        where  material_code=#{materialCode} and date_of_manufacture is null and producer=#{materialInventory.producer}
     </update>
 
     <update id="updateMaterialInventoryOut" >
         update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity},
                                          available_quantity=available_quantity-#{quantity},
                                          total_area=single_piece_area*inventory_quantity
-        where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture}
+        where  material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer}
     </update>
 
     <update id="updateMaterialInventoryNullOut" >
         update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity},
                                          available_quantity=available_quantity-#{quantity},
                                          total_area=single_piece_area*inventory_quantity
-        where  material_code=#{materialCode} and date_of_manufacture is null
+        where  material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer}
     </update>
 
     <update id="updateMaterialInventoryReturning" >
         update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity}
        where  material_code=#{materialCode} and
-                date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture}
+                date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} and producer=#{returningWarehouseDetail.producer}
 
 
     </update>
@@ -851,7 +852,7 @@
     <update id="updateMaterialInventoryReturningNull" >
         update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity}
         where  material_code=#{materialCode} and
-            date_of_manufacture is null
+            date_of_manufacture is null and producer=#{returningWarehouseDetail.producer}
 
 
     </update>
@@ -1319,4 +1320,15 @@
         where id=#{materialInventoryId}
     </update>
 
+    <update id="updateMaterialInventoryOne" >
+        update mm.material_inventory set
+                                         quality_guarantee_period=#{materialInventory.qualityGuaranteePeriod},
+                                         inventory_area=#{materialInventory.inventoryArea},
+                                         remarks=#{materialInventory.remarks},
+                                         available_quantity=available_quantity+#{materialInventory.availableQuantity},
+                                         inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity},
+                                         total_area=inventory_quantity*single_piece_area
+        where id=#{materialInventoryId}
+    </update>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0