From af9c3ed5d036ad68faf7e18f566679b3da92d244 Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期六, 22 三月 2025 11:36:06 +0800 Subject: [PATCH] 合并 --- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs | 55 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 11 deletions(-) diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs index 4638dac..4a36e31 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs @@ -9,6 +9,7 @@ using WIDESEAWCS_Core.Helper; using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob.Models; namespace WIDESEAWCS_TaskInfoService { @@ -222,11 +223,11 @@ return content.Error("褰撳墠鎵樼洏瀛樺湪浠诲姟"); } - // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩存帴鍑哄簱浠诲姟 - if (await HasDirectOutboundTask(stationManager)) - { - return content.Error($"銆恵stationManager.stationChildCode}銆戝凡瀛樺湪鐩存帴鍑哄簱浠诲姟浠诲姟"); - } + //// 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩存帴鍑哄簱浠诲姟 + //if (await HasDirectOutboundTask(stationManager)) + //{ + // return content.Error($"銆恵stationManager.stationChildCode}銆戝凡瀛樺湪鐩存帴鍑哄簱浠诲姟浠诲姟"); + //} //if (stationManager.stationType == 7) //{ @@ -389,6 +390,7 @@ public WebResponseContent ReceiveByWMSTask([NotNull] WMSTaskDTO taskDTO) { WebResponseContent content = new WebResponseContent(); + ConsoleHelper.WriteSuccessLine($"鎺ユ敹鍒颁换鍔�,浠诲姟鏁版嵁锛歿JsonConvert.SerializeObject(taskDTO, Formatting.Indented)}"); try { if (BaseDal.QueryFirst(x => x.TaskNum == taskDTO.TaskNum || x.PalletCode == taskDTO.PalletCode) != null) @@ -400,12 +402,43 @@ if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { - var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay); - task.TaskState = (int)TaskOutStatusEnum.OutNew; - task.CurrentAddress = taskDTO.RoadWay; - task.NextAddress = stationinfo.stationChildCode; - task.SourceAddress = taskDTO.SourceAddress; - task.TargetAddress = taskDTO.TargetAddress; + if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray) + { + // 鏌ヨ涓嬩竴涓矾鐢� + List<Dt_Router> routers = _routerService.QueryNextRoutes(taskDTO.RoadWay, taskDTO.TargetAddress); + if (routers.Count > 0) + { + // 璁剧疆浠诲姟鐘舵�佷负鍑哄簱鏂板缓 + task.TaskState = (int)TaskOutStatusEnum.OutNew; + // 璁剧疆褰撳墠鍦板潃涓烘簮鍦板潃 + task.CurrentAddress = taskDTO.SourceAddress; + // 璁剧疆涓嬩竴涓湴鍧�涓虹涓�涓瓙浣嶇疆 + task.NextAddress = routers.FirstOrDefault().ChildPosi; + } + else + { + // 鏌ヨ浠庢簮鍦板潃鍒扮洰鏍囧湴鍧�鐨勮矾鐢� + routers = _routerService.QueryNextRoutes(taskDTO.SourceAddress, taskDTO.TargetAddress); + if (routers.Count > 0) + { + // 璁剧疆浠诲姟鐘舵�佷负鍑哄簱瀹屾垚 + task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish; + // 璁剧疆褰撳墠鍦板潃涓烘簮鍦板潃 + task.CurrentAddress = taskDTO.SourceAddress; + // 璁剧疆涓嬩竴涓湴鍧�涓虹涓�涓瓙浣嶇疆 + task.NextAddress = routers.FirstOrDefault().ChildPosi; + } + } + } + else + { + var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay); + task.TaskState = (int)TaskOutStatusEnum.OutNew; + task.CurrentAddress = taskDTO.RoadWay; + task.NextAddress = stationinfo.stationChildCode; + task.SourceAddress = taskDTO.SourceAddress; + task.TargetAddress = taskDTO.TargetAddress; + } } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) { -- Gitblit v1.9.3