From 1285aeec470dfa1b953878a714e3bc58bba83dec Mon Sep 17 00:00:00 2001 From: lss <Lss@HanInfo> Date: 星期五, 13 六月 2025 17:31:06 +0800 Subject: [PATCH] 优化 --- HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/LocationHelper.cs | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/LocationHelper.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/LocationHelper.cs index 94f4928..ac65721 100644 --- a/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/LocationHelper.cs +++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/LocationHelper.cs @@ -293,11 +293,11 @@ Location loc = new Location(); var db = new SqlHelper<object>().GetInstance(); string CntrCodeWith = ""; - if (type.Trim() == "PM") + if (type.Trim().Contains("MA")) { CntrCodeWith = "MA"; } - else if (type.Trim() == "PN") + else if (type.Trim().Contains("NA")) { CntrCodeWith = "NA"; } @@ -621,16 +621,32 @@ { db.BeginTran(); var lcrList = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == loc).ToList(); + //if (!string.IsNullOrEmpty(location.S_NOTE) && lcrList.Count > 0) + //{ + // if (location.S_NOTE == "鍙犵洏" || location.S_NOTE.Trim() == "鐗囪兌鍫嗗彔浣�) + // { + // LogHelper.Info("鍙犵洏璐т綅鍒犻櫎鎵樼洏"); + // cntrs = lcrList.Select(a => a.S_CNTR_CODE).ToList(); + + // } + //} + if (lcrList.Count > 0) + { + cntrs = lcrList.Select(a => a.S_CNTR_CODE).ToList(); + } + LogHelper.Info($"BindingLoc锛氬紑濮嬭В缁戝鍣細{cntrs}"); var count = db.Deleteable<LocCntrRel>().Where(it => cntrs.Contains(it.S_CNTR_CODE.Trim()) && it.S_LOC_CODE.Trim() == loc).ExecuteCommand(); location.N_CURRENT_NUM = lcrList.Count - count; location.S_LOCK_STATE = "鏃�; location.N_LOCK_STATE = 0; db.Updateable(location).UpdateColumns(it => new { it.N_CURRENT_NUM, it.S_LOCK_STATE, it.N_LOCK_STATE }).ExecuteCommand(); + LogHelper.Info($"BindingLoc锛氳В缁戝鍣細{cntrs}锛屾垚鍔�); db.CommitTran(); res = true; } catch (Exception ex) { + LogHelper.Info($"BindingLoc Error:{ex}"); db.RollbackTran(); } return res; -- Gitblit v1.9.1