1
wangxinhui
6 天以前 e719f3e5d5d16ee8a9dece97d9889610507628ac
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Ô­ÁÏ¿â/ConveyorLineJob_YL1ndFloor.cs
@@ -126,29 +126,18 @@
                                
                            }
                        }
                        else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 99 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID) && conveyorLineInfoRead.WR_Task <= 0) //出站台分配目标点
                        else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 99 && conveyorLineInfoRead.WR_Task <= 0) //出站台分配目标点
                        {
                            Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode);
                            if (task != null)
                            {
                                List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi);
                                Dt_Router? router = routers.FirstOrDefault();
                                if (routers == null || routers.Count == 0 || router == null)
                                {
                                    WriteError(item.StationName, $"未找到对应路由信息,设备编号:{item.StationCode},任务号:{task.TaskNum}");
                                    continue;
                                }
                                if (routers.Count > 1)
                                {
                                    WriteError(item.StationName, $"路由信息配置错误,设备编号:{item.StationCode},任务号:{task.TaskNum}");
                                    continue;
                                }
                                //发送目标点
                                device.SetValue(WR_CLineYLDB.WR_Task, task.TaskNum, item.StationCode);
                                device.SetValue(WR_CLineYLDB.WR_Width, task.TaskLength, item.StationCode);
                                device.SetValue(WR_CLineYLDB.WR_TMID, task.PalletCode, item.StationCode);
                                device.SetValue(WR_CLineYLDB.WR_ToHode, router.NextPosi, item.StationCode);
                                device.SetValue(WR_CLineYLDB.WR_ToHode, task.NextAddress, item.StationCode);
                                device.SetValue(WR_CLineYLDB.WR_Reresult, 86, item.StationCode);
                                _taskService.UpdateTask(task,TaskStatusEnum.Line_Executing,nextAddress: router.NextPosi);
                                _taskService.UpdateTask(task,TaskStatusEnum.Line_Executing);
                            }
                        }
                        else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && conveyorLineInfoRead.WR_Task > 0 && conveyorLineInfoRead.WR_Request == 98) //一楼老厂出库口完成