1
wangxinhui
6 天以前 e719f3e5d5d16ee8a9dece97d9889610507628ac
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPD.cs
@@ -100,12 +100,31 @@
                                //更新任务信息
                                task.CurrentAddress = item.StationCode;
                                task.NextAddress = router.NextPosi;
                                task.PalletType = 1;
                                task.PalletCode = conveyorLineInfoRead.PalletCode;
                                _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
                                WriteInfo(item.StationName, $"任务号{conveyorLineInfoRead.TaskNo}下一步");
                            }
                        }
                        else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)
                        {
                            Dt_Task task = _taskRepository.QueryFirst(x =>x.TaskNum== conveyorLineInfoRead.TaskNo &&  x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
                            if (task != null)
                            {
                                //分配巷道 å­˜å…¥æ‰˜ç›˜æ•°æ®
                                List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi);
                                Dt_Router router = routers.FirstOrDefault();
                                if (router == null)
                                {
                                    WriteError(item.StationName, $"任务号:{task.TaskNum}未找到路由配置信息");
                                    return Task.CompletedTask;
                                }
                                //更新任务信息
                                task.CurrentAddress = router.StartPosi;
                                task.NextAddress = task.TargetAddress;
                                task.DeviceCode = router.NextPosi;
                                _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute);
                                WriteInfo(item.StationName, $"任务号{conveyorLineInfoRead.TaskNo}下一步");
                            }
                        }
                    }
                    else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null)
                    {