| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString()); |
| | | //Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString()); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | bool flag = speStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup; |
| | | if (flag) |
| | | bool flag = speStackerCrane.LastTaskType == TaskTypeEnum.Inbound.ObjToInt() || speStackerCrane.LastTaskType == TaskTypeEnum.PalletInbound.ObjToInt(); |
| | | if (flag==false) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(speStackerCrane.DeviceCode); |
| | | if (task == null) |
| | |
| | | task = _taskService.QueryStackerCraneOutTask(speStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(speStackerCrane.DeviceCode, task.TargetAddress); |
| | | foreach (var item in tasks) |
| | | { |
| | | return task; |
| | | } |
| | | return task; |
| | | |
| | | } |
| | | |
| | | return task; |
| | | } |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | public bool SendCommands(StackerCraneTaskCommand command,SpeStackerCrane speStackerCrane) |
| | | { |
| | | try |
| | | { |
| | | speStackerCrane.SetValue(StackerCraneDBName.TaskNum, command.TaskNum); |
| | | speStackerCrane.SetValue(StackerCraneDBName.StartRow, command.StartRow); |
| | | speStackerCrane.SetValue(StackerCraneDBName.StartColumn, command.StartColumn); |
| | | speStackerCrane.SetValue(StackerCraneDBName.StartLayer, command.StartLayer); |
| | | speStackerCrane.SetValue(StackerCraneDBName.EndRow, command.EndRow); |
| | | speStackerCrane.SetValue(StackerCraneDBName.EndColumn, command.EndColumn); |
| | | speStackerCrane.SetValue(StackerCraneDBName.EndLayer, command.EndLayer); |
| | | speStackerCrane.SetValue(StackerCraneDBName.Barcode, command.Barcode); |
| | | speStackerCrane.SetValue(StackerCraneDBName.WorkType, command.WorkType); |
| | | speStackerCrane.SetValue(StackerCraneDBName.TrayType, command.TrayType); |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | stackerCraneTaskCommand.TrayType = 0; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() || task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt())//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | else if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.PalletOutbound.ObjToInt()) |
| | | { |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | else if (task.TaskType == TaskTypeEnum.Relocation.ObjToInt()) |
| | | { |
| | | if (task.SourceAddress != null && task.TargetAddress != null) |
| | | { |