|  |  | 
 |  |  |  | 
 |  |  |                 if (_taskRepository.QueryFirst(x => x.PalletCode == command.ConveyorLineBarcode) != null) | 
 |  |  |                 { | 
 |  |  |                     WriteInfo(conveyorLine.DeviceName, "当前托盘存在任务"); | 
 |  |  |                     List<string> strings = new List<string>() { "3637", "3633", "3629" }; | 
 |  |  |  | 
 |  |  |                     var taskExecuting = _taskRepository.QueryFirst(x => x.PalletCode == command.ConveyorLineBarcode && x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting && strings.Contains(x.TargetAddress)); | 
 |  |  |  | 
 |  |  |                     if (taskExecuting != null) | 
 |  |  |                     { | 
 |  |  |                         taskExecuting.ExceptionMessage = "未接收到线体完成信号系统内部自动完成"; | 
 |  |  |                         _taskService.Delete(taskExecuting); | 
 |  |  |                     } | 
 |  |  |  | 
 |  |  |                     ConsoleHelper.WriteErrorLine($"当前托盘存在任务:【{command.ConveyorLineBarcode}】"); | 
 |  |  |  | 
 |  |  |                     WriteInfo(conveyorLine.DeviceName, $"当前托盘存在任务{command.ConveyorLineBarcode}"); | 
 |  |  |                     return; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  | 
 |  |  |                 var content = CreateAndSendTask(taskDTO); | 
 |  |  |                 if (content.Status) | 
 |  |  |                 { | 
 |  |  |                     //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); | 
 |  |  |                     var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.ConveyorLineBarcode); | 
 |  |  |                     if (task != null) | 
 |  |  |                     { | 
 |  |  |                         //var taskCommand = MapTaskCommand(task, command); | 
 |  |  |                         //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                         //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |                         //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |  | 
 |  |  |                         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); | 
 |  |  | 
 |  |  |             var Hastask = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |             if (Hastask != null) | 
 |  |  |             { | 
 |  |  |                 //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(Hastask); | 
 |  |  |                 //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                 //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |  | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)Hastask.TaskNum, childDeviceCode); | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Hastask.NextAddress, childDeviceCode); | 
 |  |  |                 conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, Hastask.PalletCode, childDeviceCode); | 
 |  |  | 
 |  |  |                 var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode); | 
 |  |  |                 if (task != null) | 
 |  |  |                 { | 
 |  |  |                     //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |                     //conveyorLine.SendCommand(taskCommand, childDeviceCode); | 
 |  |  |                     //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); | 
 |  |  |                     //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); | 
 |  |  |  | 
 |  |  |                     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); | 
 |  |  | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 if (content.Message != "请求过于频繁,请稍后再试" || content.Message != "无法获取目标地址") | 
 |  |  |                 if (content.Message != "请求过于频繁,请稍后再试" && content.Message != "无法获取目标地址") | 
 |  |  |                 { | 
 |  |  |                     WriteInfo(conveyorLine.DeviceName, content.Message); | 
 |  |  |                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode); |