From 54d812d9a307f3db88a51a17573b80f54c85c6cd Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期五, 20 六月 2025 17:25:21 +0800 Subject: [PATCH] 针对NDCAGV的Request请求授权,添加报文检验功能备用 --- wms/LocationHelper.cs | 41 +++++++++++++++++++++++++++++++++++------ 1 files changed, 35 insertions(+), 6 deletions(-) diff --git a/wms/LocationHelper.cs b/wms/LocationHelper.cs index 7be3946..d746730 100644 --- a/wms/LocationHelper.cs +++ b/wms/LocationHelper.cs @@ -153,6 +153,12 @@ return true; } + /// <summary> + /// 缁堢偣鍏ュ簱閿侊紙鍙兘瀵规棤閿佽揣浣嶄笂閿侊級 + /// </summary> + /// <param name="loc"></param> + /// <param name="lockSource"></param> + /// <returns></returns> public static bool LockEndLoc(ref TN_Location loc, string lockSource = "") { if (loc == null) { LogHelper.Info($"缁堢偣鍏ュ簱閿侊細浼犲叆鐨勮揣浣嶅弬鏁颁负null"); @@ -249,7 +255,6 @@ } cntrs = lcrList.Select(a => a.S_CNTR_CODE).ToList(); - var log = JsonConvert.SerializeObject(cntrs); var location = db.Queryable<TN_Location>().First(a => a.S_CODE == loc); if (location != null) @@ -258,8 +263,30 @@ location.S_LOCK_STATE = "鏃�; location.N_LOCK_STATE = 0; + //var containerList = new List<TN_Container>(); + //foreach (var item in lcrList) { + // // 閽堝瀹瑰櫒绫诲瀷娣诲姞鐨勬柊閫昏緫 + // var cntr = db.Queryable<TN_Container>() + // .Where(c => c.S_CODE == item.S_CNTR_CODE).First(); + // if (cntr == null) { + // LogHelper.Info($"璐т綅瑙g粦鏃讹紝瀹瑰櫒{item.S_CNTR_CODE}娌℃湁鍦ㄥ鍣ㄤ俊鎭〃涓煡鍒帮紝杩欓噷鏍规嵁璐т綅瀹瑰櫒鍏崇郴娣诲姞"); + // containerList.Add(new TN_Container { + // S_CODE = item.S_CNTR_CODE, + // S_TYPE = item.S_CNTR_TYPE, + // }); + // } + //} + using (var tran = db.Ado.UseTran()) { + //if (containerList.Count > 0) { + // if (db.Insertable<TN_Container>(containerList).ExecuteCommand() <= 0) { + // LogHelper.Info($"鎻掑叆瀹瑰櫒淇℃伅琛ㄥけ璐� + JsonConvert.SerializeObject(containerList)); + // tran.RollbackTran(); + // return "璐т綅瑙g粦瀹瑰櫒澶辫触锛� + logs; + // } + //} + if (db.Deleteable<TN_Loc_Container>().Where(it => cntrs.Contains(it.S_CNTR_CODE) && it.S_LOC_CODE == loc).ExecuteCommand() > 0) { LogHelper.Info($"鍒犻櫎璐т綅瀹瑰櫒鍏崇郴琛ㄦ垚鍔燂紝{log}"); @@ -326,14 +353,16 @@ foreach (var item in cntrs) { // 閽堝瀹瑰櫒绫诲瀷娣诲姞鐨勬柊閫昏緫 - var cntrItemRel = db.Queryable<TN_Container_ItemType>() - .Where(c => c.S_CNTR_CODE == item).First(); - if (cntrItemRel == null) { - LogHelper.Info($"璐т綅瑙g粦鏃讹紝瀹瑰櫒{item}娌℃湁鍦ㄥ鍣ㄧ墿鏂欎俊鎭叧绯昏〃涓煡鍒�); + var cntr = db.Queryable<TN_Container>() + .Where(c => c.S_CODE == item) + .First(); + + if (cntr == null) { + LogHelper.Info($"璐т綅瑙g粦鏃讹紝瀹瑰櫒{item}娌℃湁鍦ㄥ鍣ㄤ俊鎭〃涓煡鍒帮紝涓嶈褰曞鍣ㄧ被鍨�); bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item }); } else { - bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item, S_CNTR_TYPE = cntrItemRel.S_CNTR_TYPE }); + bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item, S_CNTR_TYPE = cntr.S_TYPE }); } } -- Gitblit v1.9.1