From c250003dc425746c0b31598b8966a785a5aac473 Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@DESKTOP-5BIMHQ3> Date: 星期六, 24 二月 2024 11:17:47 +0800 Subject: [PATCH] pda开发agv转运 --- Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 64 ++++++++++++++++++++++--------- 1 files changed, 45 insertions(+), 19 deletions(-) diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index 51103b6..bc3aad1 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -1761,8 +1761,6 @@ { throw new Exception("-1:鍗曟嵁鍙蜂笉鍙负绌�!"); } - //鏍规嵁鍗曟嵁鍙疯幏鍙栧叆搴撳崟鎬诲崟 - var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.AsnNo); if (model.AsnDetailId == null || model.AsnDetailId == 0) { throw new Exception("-1:鐗╂枡涓嶅彲涓虹┖!"); @@ -1770,6 +1768,12 @@ if (string.IsNullOrEmpty(model.PalletNo)) { throw new Exception("-1:鎵樼洏鍙蜂笉鍙负绌�!"); + } + //鏍规嵁鍗曟嵁鍙疯幏鍙栧叆搴撳崟鎬诲崟 + var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.AsnNo); + if (notice.Status != "0" && notice.Status != "1") + { + throw new Exception("-1:鍏ュ簱鍗曠姸鎬佷笉鏄瓑寰呮墽琛屾垨鎵ц瀹屾垚!"); } if (string.IsNullOrEmpty(model.LotNo)) { @@ -1815,6 +1819,12 @@ if (pallet == null) { throw new Exception("鏈煡璇㈠埌鎵樼洏淇℃伅锛岃鏍稿疄锛�"); + } + //鍒ゆ柇鎵樼洏鏄惁鍦ㄥ簱澶� + var stockDetail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo); + if (stockDetail != null && !string.IsNullOrEmpty(stockDetail.WareHouseNo)) + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ簱澶栵紝璇锋牳瀹烇紒"); } // 楠岃瘉鍏ュ簱鍗曟槑缁嗘槸鍚﹀瓨鍦� var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo)); @@ -2079,6 +2089,13 @@ //楠岃瘉搴撳瓨鏄惁鎷ユ湁璇ユ墭淇℃伅 if (stockDetail != null && stockDetail.Count > 0) { + foreach (var item in stockDetail) + { + if (!string.IsNullOrEmpty(item.WareHouseNo)) + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ簱澶栵紝璇锋牳鏌�!"); + } + } iscount = 1; //鍥炴祦鍏ュ簱 } #endregion @@ -2110,22 +2127,6 @@ Db.BeginTran();//寮�鍚簨鍔� if (iscount == 0)//姝e父鍏ュ簱 { - #region 绠辩爜淇℃伅 - var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList(); - //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪 - if (boxInfoList.Count <= 0) - { - throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!"); - } - foreach (var item in boxInfoList) - { - item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴� - item.UpdateTime = serverTime; - item.UpdateUser = model.CreateUser; - } - Db.Updateable(boxInfoList).ExecuteCommand(); - #endregion - #region 鍏ュ簱鎬诲崟淇℃伅 var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo); //楠岃瘉鍏ュ簱鍗曟�诲崟鏄惁鍏抽棴 @@ -2137,6 +2138,30 @@ if (notice.Status == "3") { throw new Exception("鍏ュ簱鍗曟�诲崟宸插叧闂紝璇锋牳鏌�!"); + } + #endregion + + #region 绠辩爜淇℃伅 + var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList(); + // type 0:鎴愬搧鍏ュ簱 1:閲囪喘鍏ュ簱 2:涓棿鍝佸叆搴� 3:閫�璐у叆搴� 4:杞﹂棿浣欐枡閫�鍥炲叆搴� 5:鍏跺畠鍏ュ簱 6:浠e偍鍏ュ簱 7:瀵勫瓨鍏ュ簱 + if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7") + { + // 涓嶈创鐮佺墿鏂� 鏃犻渶楠岃瘉绠辩爜淇℃伅 + } + else + { + //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪 + if (boxInfoList.Count <= 0) + { + throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!"); + } + foreach (var item in boxInfoList) + { + item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴� + item.UpdateTime = serverTime; + item.UpdateUser = model.CreateUser; + } + Db.Updateable(boxInfoList).ExecuteCommand(); } #endregion @@ -2228,7 +2253,7 @@ ASNDetailNo = (int)bindInfo.ASNDetailNo, WareHouseNo = "W02", RoadwayNo = "", - AreaNo = "", + AreaNo = storageLocat.AreaNo, LocatNo = model.LocatNo, PalletNo = model.PalletNo, PalletNo2 = bindInfo.PalletNo2, @@ -2253,6 +2278,7 @@ { stId = detailModel.Id; detailModel.LocatNo = model.LocatNo; + detailModel.AreaNo = storageLocat.AreaNo; detailModel.UpdateTime = serverTime; detailModel.UpdateUser = (int)model.CreateUser; // 鍙樻洿鍌ㄤ綅鍦板潃 -- Gitblit v1.8.0