wanshenmean
5 小时以前 e4921e003cc293fea714bdaf74dc6a6b6b750295
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Serilog;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Common.HttpEnum;
@@ -150,10 +151,10 @@
                return selectedTask;
            }
            // ===== TargetAddress 不可用时,先尝试同 NextAddress 的其他任务 =====
            // ===== TargetAddress 不可用时,先尝试同 NextAddress不同TargetAddress 的其他任务 =====
            var sameStationTasks = _taskService
                .QueryStackerCraneOutTasks(deviceCode, new List<string> { candidateTask.NextAddress })
                .Where(x => x.TaskId != candidateTask.TaskId)
                .Where(x => x.TaskId != candidateTask.TaskId && x.TargetAddress != candidateTask.TargetAddress)
                .ToList();
            foreach (var sameStationTask in sameStationTasks)
@@ -168,13 +169,8 @@
            // ===== 同 NextAddress 无可用任务,尝试不同 NextAddress 的任务 =====
            // 查找其他可用的出库站台
            var otherOutStationCodes = _routerService
                .QueryNextRoutes(deviceCode, candidateTask.NextAddress, candidateTask.TaskType)
                .Select(x => x.ChildPosi)
                .ToList();
            // 查询其他站台的出库任务
            var tasks = _taskService.QueryStackerCraneOutTasks(deviceCode, otherOutStationCodes);
            var tasks = _taskService.QueryStackerCraneOutTasks(deviceCode, new List<string> { candidateTask.NextAddress }, false);
            foreach (var alternativeTask in tasks)
            {
                selectedTask = TrySelectOutboundTask(alternativeTask);