huangxiaoqiang
2025-08-27 5a8b16b77cbbbe8137603ba9381f81f95f58135f
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPA.cs
@@ -67,9 +67,8 @@
            {
                OtherDevice device = (OtherDevice)value;
                List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
                //获取有协议的输送线-z
                //获取有协议的输送线
                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                //让每个输送线启动-z
                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();
@@ -83,22 +82,17 @@
                            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)
                            {
                                string local = "";
                                //分配货位
                                if (task.HeightType==1)
                                string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway);
                                if (!string.IsNullOrEmpty(local))
                                {
                                    local = "SC02_CP-001-064-001-01";
                                    task.CurrentAddress = item.StackerCraneStationCode;
                                    task.TargetAddress = local;
                                    task.NextAddress = local;
                                    task.DeviceCode = item.StackerCraneCode;
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
                                    WriteInfo(item.StationName, $"任务号:{task.TaskNum}进行堆垛机入库");
                                }
                                else if (task.HeightType == 2)
                                {
                                    local = "SC02_CP-001-063-001-01";
                                }
                                task.CurrentAddress = item.StackerCraneStationCode;
                                task.TargetAddress= local;
                                task.NextAddress = local;
                                task.DeviceCode = item.StackerCraneCode;
                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
                                WriteInfo(item.StationName, $"任务号:{task.TaskNum}进行堆垛机入库");
                            }
                        }
                        else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0 && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) //二楼线体出库站台