From cd8800f471c9d7ee62dd915c4407f809638471af Mon Sep 17 00:00:00 2001 From: yuyou_x <2336760928@qq.com> Date: 星期六, 16 三月 2024 11:01:24 +0800 Subject: [PATCH] 调整储位图例 有移入移除状态 整排不显示 --- Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 6 deletions(-) diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs index e65f09e..7b98079 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs @@ -890,6 +890,11 @@ { string EndLocat = string.Empty;//鐩爣浣嶇疆 + var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1")); + if (log != null) + { + throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!"); + } var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); if (stockDetail == null) { @@ -902,7 +907,7 @@ { throw new Exception("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!"); } - EndLocat = GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo); + EndLocat = GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo,palletNo); } else { @@ -921,11 +926,23 @@ { throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); } + //璧峰鍌ㄤ綅淇℃伅 var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo); if (storageLocat == null) { throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); } + //鐩爣鍌ㄤ綅淇℃伅 + var storageLocatEnd = new SysStorageLocat(); + if (!string.IsNullOrEmpty(areaNo)) + { + storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0"); + if (storageLocatEnd == null) + { + throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + } + //寮�鍚簨鍔� Db.BeginTran(); @@ -960,10 +977,16 @@ stock.LockQty += (decimal)stockDetail.Qty; Db.Updateable(stock).ExecuteCommand(); - //淇敼鍌ㄤ綅鍦板潃鐘舵�� + //淇敼璧峰鍌ㄤ綅鍦板潃鐘舵�� storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 Db.Updateable(storageLocat).ExecuteCommand(); + //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵�� + if (storageLocatEnd != null) + { + storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 + Db.Updateable(storageLocatEnd).ExecuteCommand(); + } //娣诲姞鎿嶄綔鏃ュ織璁板綍 var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId); //鎻愪氦浜嬪姟 @@ -1002,6 +1025,12 @@ } try { + var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1")); + if (log != null) + { + throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!"); + } + var notice = Db.Queryable<BllExportNotice>().First(w => w.IsDel == "0" && w.SONo == soNo); if (notice == null) { @@ -1041,7 +1070,13 @@ throw new Exception("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!"); } string EndLocat = string.Empty;//鐩爣浣嶇疆 - EndLocat= GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo); + EndLocat= GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo,palletNo); + //鐩爣鍌ㄤ綅淇℃伅 + var storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0"); + if (storageLocatEnd == null) + { + throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } //寮�鍚簨鍔� Db.BeginTran(); @@ -1080,6 +1115,10 @@ storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 Db.Updateable(storageLocat).ExecuteCommand(); + //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵�� + storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 + Db.Updateable(storageLocatEnd).ExecuteCommand(); + //娣诲姞鎿嶄綔鏃ュ織璁板綍 var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId); //鎻愪氦浜嬪姟 @@ -1095,7 +1134,14 @@ throw new Exception(ex.Message); } } - private string GetLocat(string areaNo,string skuNo,string lotNo) + /// <summary> + /// 鏍规嵁鍖哄煙鍒嗛厤鍌ㄤ綅 + /// </summary> + /// <param name="areaNo"></param> + /// <param name="skuNo"></param> + /// <param name="lotNo"></param> + /// <returns></returns> + private string GetLocat(string areaNo,string skuNo,string lotNo,string palletNo) { try { @@ -1103,7 +1149,7 @@ //褰撶劧鍖哄煙鎵�鏈夊偍浣嶄俊鎭� var storageLocatList = Db.Queryable<SysStorageLocat>().Where(w => w.WareHouseNo == "W02" && w.AreaNo == areaNo).ToList(); //鍚屽尯鍩熷悓鎵规鐗╂枡鐨勫偍浣嶄俊鎭� - List<string> locatList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == skuNo && w.LotNo == lotNo && w.WareHouseNo == "W02" && w.AreaNo == areaNo) + List<string> locatList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == skuNo && w.LotNo == lotNo && w.WareHouseNo == "W02" && w.AreaNo == areaNo && w.PalletNo != palletNo) .OrderByDescending(o=>o.LocatNo).Select(s=>s.LocatNo).Distinct().ToList(); foreach (var item in locatList) { @@ -1119,7 +1165,7 @@ if (string.IsNullOrEmpty(endLocat)) { var locatInfo3 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0") - .OrderByDescending(m => new { m.Layer, m.Column, m.Row }).First(); + .OrderByDescending(m => m.Layer).OrderByDescending(m=>m.Column).OrderByDescending(m=> m.Row).First(); if (locatInfo3 != null) { -- Gitblit v1.8.0