|  |  | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |                 //HandleTaskOut(conveyorLine, command, childDeviceCode, task); | 
 |  |  |                 // && command.ConveyorLineBarcode != "NoRead" && !command.ConveyorLineBarcode.IsNotEmptyOrNull() | 
 |  |  |                 var log = $"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】任务号:【{command.ConveyorLineTaskNum}】设备编码:【{childDeviceCode}】"; | 
 |  |  |                 ConsoleHelper.WriteSuccessLine(log); | 
 |  |  |  | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |                     //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                     //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode); | 
 |  |  | 
 |  |  |         /// <param name="childDeviceCode">子设备编号</param> | 
 |  |  |         public void RequestInNextAddress(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) | 
 |  |  |         { | 
 |  |  |             //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); | 
 |  |  |             Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode); | 
 |  |  |             if (task != null) | 
 |  |  |             { | 
 |  |  | 
 |  |  |             var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |             if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish) | 
 |  |  |             { | 
 |  |  |                 //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); | 
 |  |  |  | 
 |  |  |                 WebResponseContent content = _taskService.UpdateTaskStatusToNext(task); | 
 |  |  |  | 
 |  |  |                 if (content.Status) | 
 |  |  | 
 |  |  |             //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.ConveyorLineBarcode); | 
 |  |  |             if (task != null) | 
 |  |  |             { | 
 |  |  |                 //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |                 //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                 //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |  | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode); | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode); | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode); | 
 |  |  | 
 |  |  |                     Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); | 
 |  |  |                     if (newTask != null) | 
 |  |  |                     { | 
 |  |  |                         //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); | 
 |  |  |                         //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                         //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |  | 
 |  |  |                         conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)newTask.TaskNum, childDeviceCode); | 
 |  |  |                         conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode); | 
 |  |  |                         conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, newTask.PalletCode, childDeviceCode); | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |                     //taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode); | 
 |  |  |                     //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                     //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |  | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode); | 
 |  |  | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |                     conveyorLine.Communicator.Write(address, 1); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                     var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationArea == "Call" && x.stationType == 12); | 
 |  |  |                     CommonConveyorLine_BZ? commonConveyorBZ = Storage.Devices.FirstOrDefault(x => x.DeviceCode == station.stationPLC) as CommonConveyorLine_BZ; | 
 |  |  |                     if (commonConveyorBZ != null) | 
 |  |  |                     { | 
 |  |  |                         ConveyorLineTaskCommand_After readSignal = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationLocation); | 
 |  |  |                         if (readSignal.Reserved5 == 1) | 
 |  |  |                         { | 
 |  |  |                             var tasks = _taskRepository.QueryData(x => x.TargetAddress == childDeviceCode); | 
 |  |  |                             if (tasks.Count == 0) | 
 |  |  |                             { | 
 |  |  |                                 commonConveyorBZ.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), station.stationLocation); | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     WriteInfo($"{conveyorLine.DeviceName}输送线出库完成", $"子节点【{childDeviceCode}】托盘号:【{command.ConveyorLineBarcode}】"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  | 
 |  |  |                                 _needBarcodeRepository.UpdateData(needBarcode); | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                         content = _taskService.UpdateTaskStatusToNext(task); | 
 |  |  |                         taskNext.ExceptionMessage = log; | 
 |  |  |                         content = _taskService.UpdateTaskStatusToNext(taskNext); | 
 |  |  |                         var proAddress = conveyorLine.DeviceProDTOs | 
 |  |  |                                         .FirstOrDefault(x => x.DeviceChildCode == childDeviceCode && x.DeviceProParamName == ConveyorLineDBName_After.InteractiveSignal.ToString()) | 
 |  |  |                                         ?.DeviceProAddress; | 
 |  |  | 
 |  |  |                         conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode); | 
 |  |  |                         conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |                         conveyorLine.Communicator.Write(address, 1); | 
 |  |  |  | 
 |  |  |                         var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationArea == "Call" && x.stationType == 12); | 
 |  |  |                         CommonConveyorLine_BZ? commonConveyorBZ = Storage.Devices.FirstOrDefault(x => x.DeviceCode == station.stationPLC) as CommonConveyorLine_BZ; | 
 |  |  |                         if (commonConveyorBZ != null) | 
 |  |  |                         { | 
 |  |  |                             ConveyorLineTaskCommand_After readSignal = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationLocation); | 
 |  |  |                             if (readSignal.Reserved5 == 1) | 
 |  |  |                             { | 
 |  |  |                                 var tasks = _taskRepository.QueryData(x => x.TargetAddress == childDeviceCode); | 
 |  |  |                                 if (tasks.Count == 0) | 
 |  |  |                                 { | 
 |  |  |                                     commonConveyorBZ.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), station.stationLocation); | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                         WriteInfo($"{conveyorLine.DeviceName}输送线出库完成", $"子节点【{childDeviceCode}】托盘号:【{command.ConveyorLineBarcode}】"); | 
 |  |  |                     } | 
 |  |  |                 } |