From 8b150adba61ff2de1800c0fb99410847833b1642 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期四, 21 十一月 2024 11:11:39 +0800 Subject: [PATCH] Create .gitignore --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs | 145 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 141 insertions(+), 4 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" index 4072b5c..fa6b4e8 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" @@ -16,6 +16,7 @@ using System.Security.Policy; using static WIDESEA_ITaskInfoService.ITaskService; using MailKit.Search; +using WIDESEA_Common.Log; namespace WIDESEA_TaskInfoService { @@ -424,7 +425,16 @@ { Dt_LocationInfo newLocation; //鏌ヨ蛋璐т綅锛岃繘琛岀敓鎴愮Щ搴撲换鍔� - newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo); //鎷垮埌浜嗙Щ搴撳悗鐨勮揣浣� + int Locationtype = 9; //榛樿涓�9 + if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.鎴愬搧) + { + Locationtype = 11; + } + else if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.鍘熸潗鏂�) + { + Locationtype = 10; + } + newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo,Locationtype); //鎷垮埌浜嗙Щ搴撳悗鐨勮揣浣� if (newLocation != null) { Dt_Task dt_Task = new() @@ -635,6 +645,7 @@ return content = WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撶殑搴撳瓨淇℃伅"); } } + /// <summary> /// 鎵嬪姩鐢熸垚鍑哄簱浠诲姟 /// </summary> @@ -653,7 +664,7 @@ for (int i = 0; i < saveModel.DelKeys.Count; i++) { Dt_StockInfo stockt = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == saveModel.DelKeys[i].ToString()); - if (stockt.StockStatus != (int)StockStatusEmun.宸插叆搴�) + if (stockt.StockStatus == (int)StockStatusEmun.宸插叆搴�) { Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); stockt.StockStatus = (int)StockStatusEmun.鍑哄簱閿佸畾; @@ -675,11 +686,11 @@ { if (locationinfo.RoadwayNo == "1") { - LocationName = "R01-003-041-011-01"; + LocationName = "R01-002-041-011-01"; } else { - LocationName = "R02-003-027-011-01"; + LocationName = "R02-002-027-011-01"; } } Dt_LocationInfo newTargetAddress; @@ -928,5 +939,131 @@ } return (null, LocationStatusEnum.Free.ObjToInt()); } + + /// <summary> + /// 浜哄伐鎵嬪姩鍑哄簱锛堝垹闄ゅ簱瀛橈級 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public WebResponseContent ManualOutboundDeleteinventory(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>(); + List<Dt_LocationInfo> locations = new List<Dt_LocationInfo>(); + List<Dt_StockInfoDetail> dtstocktdetail = new List<Dt_StockInfoDetail>(); + + for (int i = 0; i < saveModel.DelKeys.Count; i++) + { + Dt_StockInfo stockt = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == saveModel.DelKeys[i].ToString()); + if (stockt.StockStatus == (int)StockStatusEmun.宸插叆搴�) + { + Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); + Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockt.LocationCode); + locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); + dtstockt.Add(stockt); + locations.Add(locationinfo); + if (stockt.MaterialType == (int)InventoryMaterialType.绌烘墭) + { + dtstocktdetail.Add(stocktdetail); + } + WriteLog.GetLog("浜哄伐鎵嬪姩鍒犻櫎搴撳瓨淇℃伅").Write($"鎵樼洏鏉$爜锛歿stockt.PalletCode},搴撲綅缂栧彿锛歿stockt.LocationCode}", $"浜哄伐鍑哄簱搴撳瓨"); + } + else + { + return content = WebResponseContent.Instance.Error($"鍑哄簱澶辫触锛岃搴撳瓨淇℃伅涓嶅彲杩涜鍑哄簱"); + } + + } + _unitOfWorkManage.BeginTran(); + _stockService.StockInfoService.Repository.DeleteData(dtstockt); + if(dtstocktdetail.Count==0) + { + _stockService.StockInfoDetailService.Repository.DeleteData(dtstocktdetail); + } + _basicService.LocationInfoService.Repository.UpdateData(locations); + _unitOfWorkManage.CommitTran(); + content = WebResponseContent.Instance.OK(); + return content; + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return content = WebResponseContent.Instance.Error($"鎵嬪姩鍑哄簱淇℃伅澶辫触锛屾姤閿欎俊鎭細{ex.Message}"); + throw; + } + } + + /// <summary> + /// 浠诲姟鍙栨秷 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public WebResponseContent Cancelinventory(int taskNum) + { + WebResponseContent content = new WebResponseContent(); + Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); + if(task != null) + { + if(task.TaskType== (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound) + { + //澶勭悊鍑哄簱鐨勯�昏緫 + Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); + if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt()) + { + locationinfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); + } + if (locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) + { + locationinfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); + } + _basicService.LocationInfoService.Repository.UpdateData(locationinfo); + Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); + stockInfo.StockStatus = (int)StockStatusEmun.宸插叆搴�; + _stockService.StockInfoService.Repository.UpdateData(stockInfo); + Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id); + if(stocktdetail != null) + { + stocktdetail.Status = (int)StockStatusEmun.宸插叆搴�; + _stockService.StockInfoDetailService.Repository.UpdateData(stocktdetail); + } + BaseDal.DeleteData(task); + BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎); + WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍑哄簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷"); + return content = WebResponseContent.Instance.Error($"鍑哄簱浠诲姟鍙栨秷鎴愬姛"); + + } + else if(task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.PalletInbound) + { + //澶勭悊鍑哄簱鐨勯�昏緫 + Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); + if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt() || locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) + { + locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); + } + _basicService.LocationInfoService.Repository.UpdateData(locationinfo); + Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); + _stockService.StockInfoService.Repository.DeleteData(stockInfo); + Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id); + if (stocktdetail != null) + { + _stockService.StockInfoDetailService.Repository.DeleteData(stocktdetail); + } + BaseDal.DeleteData(task); + BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎); + WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷"); + return content = WebResponseContent.Instance.Error($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛"); + } + else + { + return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$殑浠诲姟绫诲瀷寮傚父锛屽彇娑堝け璐�"); + } + } + else + { + return content = WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔″彿"); + } + } } } -- Gitblit v1.9.3