| | |
| | | using Newtonsoft.Json; |
| | | using Serilog; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEAWCS_Common.Constants; |
| | | using WIDESEAWCS_Common.HttpEnum; |
| | |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.ConveyorLine.Enum; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | |
| | |
| | | { |
| | | // 先进行本地站台检查(PLC 读取,快速),避免不必要的 WMS HTTP 调用 |
| | | |
| | | if (outboundTask.TaskType != (int)TaskOutboundTypeEnum.OutEmpty && outboundTask.Roadway != "GWSC1" && outboundTask.TargetAddress != "CWSC1") |
| | | if (outboundTask.TaskType != (int)TaskOutboundTypeEnum.OutEmpty && outboundTask.TargetAddress != "CWSC1") |
| | | { |
| | | // 判断 TargetAddress 输送线站台是否空闲 |
| | | if (!IsTargetAddressConveyorStationAvailable(outboundTask)) |
| | |
| | | return null; |
| | | } |
| | | |
| | | if (outboundTask.TargetAddress != "CWSC1") |
| | | //if (outboundTask.TargetAddress != "CWSC1") |
| | | //{ |
| | | // 检查是否有正在执行的输送线任务去往同一 TargetAddress |
| | | if (_taskService.HasExecutingTaskToTarget(outboundTask.Roadway, outboundTask.TargetAddress)) |
| | | { |
| | | // 检查是否有正在执行的输送线任务去往同一 TargetAddress |
| | | if (_taskService.HasExecutingTaskToTarget(outboundTask.Roadway, outboundTask.TargetAddress)) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, "TrySelectOutboundTask:TargetAddress: {TargetAddress} 已有正在执行的输送线任务,任务号: {TaskNum}", |
| | | $"TrySelectOutboundTask:TargetAddress: {outboundTask.TargetAddress} 已有正在执行的输送线任务", outboundTask.Roadway, outboundTask.TargetAddress, outboundTask.TaskNum); |
| | | return null; |
| | | } |
| | | QuartzLogHelper.LogInfo(_logger, "TrySelectOutboundTask:TargetAddress: {TargetAddress} 已有正在执行的输送线任务,任务号: {TaskNum}", |
| | | $"TrySelectOutboundTask:TargetAddress: {outboundTask.TargetAddress} 已有正在执行的输送线任务", outboundTask.Roadway, outboundTask.TargetAddress, outboundTask.TaskNum); |
| | | return null; |
| | | } |
| | | //} |
| | | |
| | | if(outboundTask.Roadway != "GWSC1") |
| | | if (outboundTask.Roadway != "GWSC1") |
| | | { |
| | | return outboundTask; |
| | | } |