| | |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Reflection; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IMapper _mapper; |
| | | private readonly IDt_StationManagerService _stationManagerService; |
| | | |
| | | public CommonConveyorLine_AfterJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository) |
| | | public CommonConveyorLine_AfterJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository,IDt_StationManagerService stationManagerService) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _mapper = mapper; |
| | | _taskRepository = taskRepository; |
| | | _stationManagerService = stationManagerService; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | CommonConveyorLine_After conveyorLine = (CommonConveyorLine_After)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (conveyorLine != null) |
| | | { |
| | | List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode); |
| | | List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode); |
| | | //List<Task> tasks = new List<Task>(); |
| | | foreach (string childDeviceCode in childDeviceCodes) |
| | |
| | | /// <param name="conveyorLine">输送线实例对象</param> |
| | | /// <param name="command">读取的请求信息</param> |
| | | /// <param name="childDeviceCode">子设备编号</param> |
| | | /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param> |
| | | public void RequestInbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) |
| | | { |
| | | var taskNew = _taskService.QueryCraneConveyorLineTask(command.ConveyorLineTaskNum.ObjToInt(), childDeviceCode); |
| | | if (taskNew == null) |
| | | { |
| | | string barcode = command.ConveyorLineBarcode.TrimEnd(); |
| | | if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Status) |
| | | if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Result.Status) |
| | | { |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |