|  |  | 
 |  |  |  | 
 |  |  |             if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) | 
 |  |  |             { | 
 |  |  |                 if (OutTaskStationIsOccupied(task) != null) | 
 |  |  |                 if (OutTaskStationIsOccupied(task) == null) | 
 |  |  |                 { | 
 |  |  |                     return task; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     bool flag = false; | 
 |  |  |                     List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); | 
 |  |  |                     List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); | 
 |  |  |                     foreach (var item in tasks) | 
 |  |  |                     { | 
 |  |  |                         if (OutTaskStationIsOccupied(task) != null) | 
 |  |  |                         { | 
 |  |  |                             return task; | 
 |  |  |                             flag = true; | 
 |  |  |                             break; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); | 
 |  |  |                     if (!flag) | 
 |  |  |                     { | 
 |  |  |                         task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |  | 
 |  |  | 
 |  |  |             stackerCraneTaskCommand.Barcode = task.PalletCode; | 
 |  |  |             stackerCraneTaskCommand.TaskNum = task.TaskNum; | 
 |  |  |             stackerCraneTaskCommand.WorkType = 1; | 
 |  |  |             stackerCraneTaskCommand.TrayType = 1; | 
 |  |  |             stackerCraneTaskCommand.TrayType = (Int16)task.PalletType; | 
 |  |  |             if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ | 
 |  |  |             { | 
 |  |  |                 string[] startCodes = task.CurrentAddress.Split("-"); |