From 5b8bf171b9afda52fa366a72e54eedbd9e6d4d17 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期六, 01 十一月 2025 19:54:25 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/FangCangZhiNeng

---
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Allocat.cs |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Allocat.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Allocat.cs"
index a8743ee..caa7125 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Allocat.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Allocat.cs"
@@ -37,7 +37,7 @@
                 List<Dt_SupplyTask> supplyTasks = new List<Dt_SupplyTask>();
                 //// 鏌ヨ澶т欢搴撲腑鍙敤鐨勫簱瀛�
                 List<Dt_InventoryInfo> dt_InventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.MaterielCode == materielInfo.MaterielCode && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt() && x.AvailableQuantity > 0 && x.WarehouseCode == WareCode);
-                if (dt_InventoryInfos.Count < 1) throw new Exception($"鐗╂枡缂栧彿銆恵materielInfo.MaterielCode}銆戝ぇ浠跺簱鏃犲簱瀛橈紒");
+                if (dt_InventoryInfos.Count < 1) throw new Exception($"鐗╂枡缂栧彿銆恵materielInfo.MaterielCode}銆戝ぇ浠跺簱鏃犲簱瀛橈紒璇峰強鏃惰ˉ鍏呭簱瀛橈紒");
                 if (tactics.SelectTactice == TacticsEnum.ComeOutonFirstTime.ObjToInt())
                     dt_InventoryInfos = dt_InventoryInfos.OrderBy(x => x.ValidityPeriod).ToList();
                 else
@@ -46,7 +46,7 @@
                 foreach (var item in dt_InventoryInfos)
                 {
                     if (materielInfo.Business_qty >= materielInfo.MinQty) break;
-                    item.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
+                    //item.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
                     while (item.StockQuantity > item.OutboundQuantity && materielInfo.Business_qty < materielInfo.MinQty)
                     {
                         Qty += materielInfo.BoxQty;
@@ -59,7 +59,11 @@
                 //娣诲姞鎶ヨ淇℃伅
                 if (materielInfo.Business_qty < materielInfo.MinQty)
                 {
-                    _messageInfoService.AddMessageInfo(MessageGroupByEnum.InventoryLowAlarm, $"鐗╂枡鍚嶇О:{materielInfo.MaterielName}", $"銆愮墿鏂欑紪鐮亄materielInfo.MaterielCode}澶т欢搴撳簱瀛樿繃浣庛��");
+                    _messageInfoService.AddMessageInfo(MessageGroupByEnum.InventoryLowAlarm, $"鐗╂枡鍚嶇О:{materielInfo.MaterielName}", $"銆愮墿鏂欑紪鐮亄materielInfo.MaterielCode}宸茬敓鎴愯皟鎷ㄥ嚭鍏ュ簱鍗曪紝璇疯繘琛屽嚭鍏ュ簱娴佺▼銆傚ぇ浠跺簱搴撳瓨杩囦綆锛佽鍙婃椂琛ュ厖搴撳瓨锛併��");
+                }
+                else
+                {
+                    _messageInfoService.AddMessageInfo(MessageGroupByEnum.InventoryLowAlarm, $"鐗╂枡鍚嶇О:{materielInfo.MaterielName}", $"銆愮墿鏂欑紪鐮亄materielInfo.MaterielCode}宸茬敓鎴愯皟鎷ㄥ嚭鍏ュ簱鍗曪紝璇疯繘琛屽嚭鍏ュ簱娴佺▼銆�");
                 }
                 #endregion
                 #region 娣诲姞璋冩嫧鍑哄簱鍗�
@@ -138,17 +142,17 @@
                 }
                 #endregion
 
-                _unitOfWorkManage.BeginTran();
+                //_unitOfWorkManage.BeginTran();
                 _materielInfoService.UpdateData(materielInfo);
                 _inventoryInfoService.Repository.UpdateData(dt_InventoryInfos);
                 _supplyTaskService.AddData(supplyTasks);
-                BaseDal.Db.InsertNav(deliveryOrder).Include(x => x.Details).ExecuteCommand();
-                _cabinOrderServices.Repository.Db.InsertNav(cabinOrder).Include(x => x.Details).ExecuteCommand();
-                _unitOfWorkManage.CommitTran();
+                if (deliveryOrder.Details.Count > 1) BaseDal.Db.InsertNav(deliveryOrder).Include(x => x.Details).ExecuteCommand();
+                if (cabinOrder.Details.Count > 1) _cabinOrderServices.Repository.Db.InsertNav(cabinOrder).Include(x => x.Details).ExecuteCommand();
+                //_unitOfWorkManage.CommitTran();
             }
             catch (Exception ex)
             {
-                _unitOfWorkManage.RollbackTran();
+                //_unitOfWorkManage.RollbackTran();
                 _messageInfoService.AddMessageInfo(MessageGroupByEnum.InventoryLowAlarm, "澶т欢搴撹ˉ璐х珛搴�", ex.Message);
                 response.Error(ex.Message);
             }

--
Gitblit v1.9.3