|  |  | 
 |  |  |                         } | 
 |  |  |                         if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) | 
 |  |  |                         { | 
 |  |  |                             Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) && x.SourceAddress == item.StationCode); | 
 |  |  |                             Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt()) && (x.SourceAddress == item.StationCode || x.CurrentAddress == item.AGVStationCode || x.CurrentAddress == item.StationCode)); | 
 |  |  |                             if (task != null) | 
 |  |  |                             { | 
 |  |  |                                 string oldAddress = task.NextAddress; | 
 |  |  | 
 |  |  |                                 if (stationManger == null) | 
 |  |  |                                 { | 
 |  |  |                                     WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); | 
 |  |  |                                     break; | 
 |  |  |                                     continue; | 
 |  |  |                                 } | 
 |  |  |                                 string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); | 
 |  |  |                                 if (string.IsNullOrEmpty(locationCode)) | 
 |  |  |                                 { | 
 |  |  |                                     WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); | 
 |  |  |                                     break; | 
 |  |  |                                     continue; | 
 |  |  |                                 } | 
 |  |  |                                 task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); | 
 |  |  |                                 task.CurrentAddress = stationManger.StackerCraneStationCode; | 
 |  |  |                                 task.TargetAddress = locationCode; | 
 |  |  |                                 task.NextAddress = locationCode; | 
 |  |  | 
 |  |  |                             if (stationManger == null) | 
 |  |  |                             { | 
 |  |  |                                 WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); | 
 |  |  |                                 break; | 
 |  |  |                                 continue; | 
 |  |  |                             } | 
 |  |  |                             string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); | 
 |  |  |                             if (string.IsNullOrEmpty(locationCode)) | 
 |  |  |                             { | 
 |  |  |                                 WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); | 
 |  |  |                                 break; | 
 |  |  |                                 continue; | 
 |  |  |                             } | 
 |  |  |                             string oldAddress = task.NextAddress; | 
 |  |  |                             int oldStatus = task.TaskState; |