From 5621e29bd415c85fd719e0e6366eae813b970ea2 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 30 十月 2025 20:16:11 +0800
Subject: [PATCH] 1

---
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs |   62 +++++++++++++++++--------------
 1 files changed, 34 insertions(+), 28 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
index 7130732..fb4045a 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
@@ -7,6 +7,7 @@
 using System.Reflection.Metadata;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Common.WareHouseEnum;
@@ -234,36 +235,39 @@
                                     }
                                     #endregion
 
-                                    #region 鍒涘缓搴撳瓨鎵规淇℃伅
-                                    // 6锔忊儯 鏌ヨ搴撳瓨鎵规淇℃伅
-                                    var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>()
-                                        .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo);
+                                    #region 鍒涘缓搴撳瓨鎵规淇℃伅  鍙湁涓嶆槸璋冩嫧鍏ュ簱鍗曪紙115锛夋墠瀵规壒娆′俊鎭繘琛屼慨鏀�
+                                    if (cabinOrder.Order_type != InOrderTypeEnum.Allocat.ObjToInt().ToString())
+                                    {
+                                        // 6锔忊儯 鏌ヨ搴撳瓨鎵规淇℃伅
+                                        var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>()
+                                            .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo);
 
-                                    if (inventory_Batch != null)
-                                    {
-                                        inventory_Batch.StockQuantity += orderQty;
-                                        inventory_Batch.AvailableQuantity += orderQty;
-                                        BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand();
-                                    }
-                                    else
-                                    {
-                                        inventory_Batch = new Dt_Inventory_Batch
+                                        if (inventory_Batch != null)
                                         {
-                                            MaterielCode = inventoryInfo.MaterielCode,
-                                            MaterielName = inventoryInfo.MaterielName,
-                                            MaterielSpec = inventoryInfo.MaterielSpec,
-                                            BatchNo = inventoryInfo.BatchNo,
-                                            StockQuantity = inventoryInfo.StockQuantity,
-                                            OutboundQuantity = inventoryInfo.OutboundQuantity,
-                                            AvailableQuantity = inventoryInfo.AvailableQuantity,
-                                            SupplyQuantity = inventoryInfo.SupplyQuantity,
-                                            ERPStockQuantity = 0,
-                                            Status = false,
-                                            ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"),
-                                            ValidityPeriod = inventoryInfo.ValidityPeriod,
-                                            Remark = "鑷姩鍒涘缓"
-                                        };
-                                        BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand();
+                                            inventory_Batch.StockQuantity += orderQty;
+                                            inventory_Batch.AvailableQuantity += orderQty;
+                                            BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand();
+                                        }
+                                        else
+                                        {
+                                            inventory_Batch = new Dt_Inventory_Batch
+                                            {
+                                                MaterielCode = inventoryInfo.MaterielCode,
+                                                MaterielName = inventoryInfo.MaterielName,
+                                                MaterielSpec = inventoryInfo.MaterielSpec,
+                                                BatchNo = inventoryInfo.BatchNo,
+                                                StockQuantity = inventoryInfo.StockQuantity,
+                                                OutboundQuantity = inventoryInfo.OutboundQuantity,
+                                                AvailableQuantity = inventoryInfo.AvailableQuantity,
+                                                SupplyQuantity = inventoryInfo.SupplyQuantity,
+                                                ERPStockQuantity = 0,
+                                                Status = false,
+                                                ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"),
+                                                ValidityPeriod = inventoryInfo.ValidityPeriod.ObjToDate(),
+                                                Remark = "鑷姩鍒涘缓"
+                                            };
+                                            BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand();
+                                        }
                                     }
                                     #endregion
 
@@ -288,6 +292,8 @@
                                         SupplyQuantity = 0,
                                         Remark = "鍏ュ簱"
                                     };
+                                    //杩欓噷杩欓噷鐨勫叆搴撹皟鎷ㄥ崟鐘舵�佹槸115锛屽氨灏嗚皟鎷ㄤ换鍔$姸鎬佹敼涓�7
+                                    if (cabinOrder.Order_type == InOrderTypeEnum.Allocat.ObjToInt().ToString()) supplyTask_Hty.TaskType = TaskTypeEnum.AllocatIn.ObjToInt();
                                     BaseDal.Db.Insertable(supplyTask_Hty).ExecuteCommand();
                                     #endregion
                                 }

--
Gitblit v1.9.3