From e719f3e5d5d16ee8a9dece97d9889610507628ac Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期一, 18 八月 2025 08:15:27 +0800 Subject: [PATCH] 1 --- 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" index cbdf94b..7e3464f 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" @@ -8,8 +8,10 @@ using WIDESEA_Common.OtherEnum; using WIDESEA_Common.StockEnum; using WIDESEA_Common.TaskEnum; +using WIDESEA_Common.WareHouseEnum; using WIDESEA_Core; using WIDESEA_Core.Helper; +using WIDESEA_DTO.Basic; using WIDESEA_DTO.Task; using WIDESEA_Model.Models; @@ -126,7 +128,6 @@ return WebResponseContent.Instance.Error(ex.Message); } } - public WebResponseContent RelocationTaskCompleted(Dt_Task task) { try @@ -166,5 +167,54 @@ return WebResponseContent.Instance.Error(ex.Message); } } + public WebResponseContent IsRelocation(string startAddress,string endAddress,string roadWay) + { + WebResponseContent content = new WebResponseContent(); + try + { + //鑾峰彇璐т綅 + Dt_LocationInfo startLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == startAddress); + Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.LocationCode == startAddress); + Dt_LocationInfo endLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == endAddress); + if (startLocationInfo != null && endLocationInfo != null && stockInfo!=null) + { + Dt_Task newTask = new Dt_Task() + { + Roadway = roadWay, + WarehouseId = stockInfo.WarehouseId, + CurrentAddress = startLocationInfo.LocationCode, + Grade = 99, + NextAddress = endLocationInfo.LocationCode, + OrderNo = "", + PalletCode = stockInfo.PalletCode, + PalletType = stockInfo.PalletType, + SourceAddress = startLocationInfo.LocationCode, + TargetAddress = endLocationInfo.LocationCode, + TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), + TaskStatus = 0, + TaskType = TaskTypeEnum.Relocation.ObjToInt() + }; + stockInfo.StockStatus = StockStatusEmun.绉诲簱閿佸畾.ObjToInt(); + _unitOfWorkManage.BeginTran(); + Repository.AddData(newTask); + _basicService.LocationInfoService.UpdateLocationStatus(startLocationInfo, stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); + _basicService.LocationInfoService.UpdateLocationStatus(endLocationInfo, stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); + _stockService.StockInfoService.Repository.UpdateData(stockInfo); + _unitOfWorkManage.CommitTran(); + PushTasksToWCS(new List<Dt_Task> { newTask }); + content.OK("鎴愬姛"); + } + else + { + content.Error("搴撳瓨璐т綅淇℃伅涓虹┖"); + } + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + content.Error(ex.Message); + } + return content; + } } } -- Gitblit v1.9.3