From 3163fec4985ebc87ea859087cdedacad749096d9 Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期五, 28 二月 2025 19:15:39 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs | 70 ++++++++++++++++++++++++++++++++--- 1 files changed, 64 insertions(+), 6 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 6ee819d..80cd5ef 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" @@ -381,7 +381,7 @@ WebResponseContent content = new WebResponseContent(); List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>(); Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNum); - if (task != null) + if (task == null) { return content = WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅锛屼换鍔″彿锛歿TaskNum}"); } @@ -489,6 +489,7 @@ loca.Add(newLocation); loca.Add(locationInfos); _basicService.LocationInfoService.UpdateData(loca); + BaseDal.AddData(dt_Task); _unitOfWorkManage.CommitTran(); return content = WebResponseContent.Instance.OK(data: dt_Task); } @@ -1215,10 +1216,33 @@ { Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockt.LocationCode); + Dt_Task_Hty task_Hty = new Dt_Task_Hty() + { + TaskNum = 001, + PalletCode = stockt.PalletCode, + Roadway = locationinfo.RoadwayNo, + TaskType = (int)TaskTypeEnum.Outbound, + TaskStatus = (int)OutTaskStatusEnum.OutFinish, + SourceAddress = locationinfo.LocationCode, + TargetAddress = locationinfo.LocationCode, + CurrentAddress = locationinfo.LocationCode, + NextAddress = locationinfo.LocationCode, + Grade = 1, + Dispatchertime = DateTime.Now, + Creater = App.User.UserName, + CreateDate = DateTime.Now, + ModifyDate = DateTime.Now, + Modifier = App.User.UserName, + Remark = "浜哄伐鍑哄簱", + PLCTo = 1, + PalletCodequantity = 1, + MaterialType = 1 + }; + _taskHtyService.AddData(task_Hty); locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); dtstockt.Add(stockt); locations.Add(locationinfo); - if (stockt.MaterialType == (int)InventoryMaterialType.绌烘墭) + if (stockt.MaterialType != (int)InventoryMaterialType.绌烘墭) { dtstocktdetail.Add(stocktdetail); } @@ -1232,10 +1256,7 @@ } _unitOfWorkManage.BeginTran(); _stockService.StockInfoService.Repository.DeleteData(dtstockt); - if(dtstocktdetail.Count==0) - { - _stockService.StockInfoDetailService.Repository.DeleteData(dtstocktdetail); - } + _stockService.StockInfoDetailService.Repository.DeleteData(dtstocktdetail); _basicService.LocationInfoService.Repository.UpdateData(locations); _unitOfWorkManage.CommitTran(); content = WebResponseContent.Instance.OK(); @@ -1285,6 +1306,7 @@ BaseDal.DeleteData(task); BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎); WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍑哄簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷"); + WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎"); return content = WebResponseContent.Instance.Error($"鍑哄簱浠诲姟鍙栨秷鎴愬姛"); } @@ -1307,6 +1329,42 @@ BaseDal.DeleteData(task); BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎); WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷"); + WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎"); + return content = WebResponseContent.Instance.Error($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛"); + } + else if (task.TaskType == (int)TaskTypeEnum.RelocationIn) //搴撳唴绉诲簱 + { + //澶勭悊鍑哄簱鐨勯�昏緫 + Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); + if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt() || locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) + { + locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); + } + _basicService.LocationInfoService.Repository.UpdateData(locationinfo); + + Dt_LocationInfo locationinfo2 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); + if (locationinfo2.LocationStatus == LocationStatusEnum.Lock.ObjToInt()) + { + locationinfo2.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); + } + if (locationinfo2.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) + { + locationinfo2.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); + } + _basicService.LocationInfoService.Repository.UpdateData(locationinfo2); + 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}", $"浠诲姟鍙栨秷"); + WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎"); return content = WebResponseContent.Instance.Error($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛"); } else -- Gitblit v1.9.3