wangxinhui
2025-09-26 9ae0890dd74771ba9edd44d4830e0de37f8d9938
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPA.cs
@@ -68,7 +68,7 @@
                OtherDevice device = (OtherDevice)value;
                List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
                //获取有协议的输送线
                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData();
                foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
                {
                    DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineCPDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
@@ -82,8 +82,23 @@
                            Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
                            if (task != null)
                            {
                                Dt_StationManger stationManger = stationMangers.FirstOrDefault(x => x.StationCode == task.SourceAddress);
                                if (stationManger != null)
                                {
                                    string? local = "";
                                    switch (stationManger.AGVStationCode.ObjToInt() % 2)
                                    {
                                        case 1:
                                            local = task.Roadway + "-001-062-001-01";
                                            break;
                                        case 0:
                                            local = task.Roadway + "-002-062-001-01";
                                            break;
                                        default:
                                            WriteError(item.StationName, $"未找到可分配巷道{task.TaskNum}");
                                            break;
                                    }
                                //分配货位
                                string? local = "SC01_CP-002-064-008-01";
                                if (!string.IsNullOrEmpty(local))
                                {
                                    task.CurrentAddress = item.StackerCraneStationCode;
@@ -95,6 +110,7 @@
                                }
                            }
                        }
                        }
                        else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0 && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) //二楼线体出库站台
                        {
                            //获取出库站台是否存在出库待执行任务