| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.StackerCraneEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Common.WMSInfo; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IShuttleCar; |
| | |
| | | using WIDESEAWCS_TaskInfoService; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using static WIDESEAWCS_Common.WMSInfo.RequestWMS; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public partial class CommonStackerCraneJob : IJob |
| | | public partial class CommonStackerCraneJob : JobBase, IJob |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | |
| | | } |
| | | else |
| | | { |
| | | task.ShuttleCarCode = ShuttleCar?.ShuttleCarCode; |
| | | _taskService.UpdateData(task); |
| | | SendTask(commonStackerCrane, task);//ä¸åå åæºä»»å¡ |
| | | } |
| | | } |
| | | else |
| | | SendTask(commonStackerCrane, task);//ä¸åå åæºä»»å¡ |
| | | } |
| | | } |
| | | |
| | |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | bool worktype = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, task.TaskType == (int)TaskOtherTypeEnum.RelocationCar ? 2 : 1); |
| | | bool worktype = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, task.TaskType == (int)TaskOtherTypeEnum.RelocationCar ? (short)WorkType.Car : (short)WorkType.Cargo); |
| | | if (sendFlag && worktype) |
| | | { |
| | | if (commonStackerCrane.SetValue(StackerCraneDBName.CommandSend, sendFlag)) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | if (task.TaskType != (int)TaskOtherTypeEnum.RelocationCar) commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | //if (_taskService.GetTaskInfo(commonStackerCrane.CurrentTaskNum) != null) |
| | | //{ |
| | | Console.Out.WriteLine($"å åæºä»»å¡å®æï¼[{commonStackerCrane.CurrentTaskNum}]ï¼{DateTime.Now}"); |
| | | var Status = _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum).Status;///éä¿®æ¹ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ |
| | | var Status = _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum).Status; |
| | | commonStackerCrane.SetValue(StackerCraneDBName.ConfirmComplete, Status); |
| | | //} |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | if (task != null && task.TargetAddress != "SC01") return task;//å
¥åºä»»å¡å¤ææ¯å¦å·²åé
è´§ä½ï¼WMSå¤æè´§ä½ç¶ææ¯å¦å
许æ¾è´§ |
| | | if (task != null && !string.IsNullOrEmpty(task.TargetAddress)) return task;//å
¥åºä»»å¡å¤ææ¯å¦å·²åé
è´§ä½ï¼WMSå¤æè´§ä½ç¶ææ¯å¦å
许æ¾è´§ |
| | | return task; |
| | | } |
| | | |
| | |
| | | { |
| | | StackerCraneTaskCommandW stackerCraneTaskCommand = new StackerCraneTaskCommandW(); |
| | | |
| | | stackerCraneTaskCommand.Barcode = task.PalletCode; |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = (short)WorkType.Cargo; |
| | | stackerCraneTaskCommand.TrayType = 0; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup) |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |