| | |
| | | using Autofac.Core; |
| | | using HslCommunication; |
| | | using Mapster; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Helper; |
| | |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | private readonly IProcessRepository _processRepository; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly INoticeService _noticeService; |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService) |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _processRepository = processRepository; |
| | | _cacheService = cacheService; |
| | | _noticeService = noticeService; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | { |
| | | //Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | ConsoleHelper.WriteColorLine($"【{commonStackerCrane.DeviceName}】任务完成,任务号:【{e.TaskNum}】", ConsoleColor.Blue); |
| | | if (commonStackerCrane.DeviceCode.Contains("GW")) |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | | |
| | | var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.TargetAddress); |
| | | |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == station.stationPLC); |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device; |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, task.TargetAddress); |
| | | } |
| | | else |
| | | return; |
| | | } |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |