1
huangxiaoqiang
2025-07-30 8e49faa42ff419efa0641478702ce7d5f8455bd9
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs
@@ -79,7 +79,7 @@
        public Task Execute(IJobExecutionContext context)
        {
            Console.WriteLine(DateTime.Now.ToString() + ",线程ID:" + Thread.CurrentThread.ManagedThreadId);
            //Console.WriteLine(DateTime.Now.ToString() + ",线程ID:" + Thread.CurrentThread.ManagedThreadId);
            try
            {
                //用这种方式能确保类型转换不会有问题
@@ -164,6 +164,7 @@
                            Running = RGVWorkStatus(FirstRgv.GetValue<RGVDBName, bool>(RGVDBName.Running)),
                            LevelPoint = FirstRgv.GetValue<RGVDBName, int>(RGVDBName.LevelPoint),
                            CurrentTaskNum = FirstRgv.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum),
                            RGVAlarm = FirstRgv.GetValue<RGVDBName, uint>(RGVDBName.RGVAlarm),
                            FirstRgv.DeviceCode,
                            FirstRgv.DeviceName,
                        };
@@ -175,16 +176,16 @@
                }
                else
                {
                    if (commonRGVFirst == null)
                        Console.WriteLine($"RGV01未找到设备对象的值");
                    else
                        Console.WriteLine($"RGV01设备对象类型错误");
                    //if (commonRGVFirst == null)
                    //    Console.WriteLine($"RGV01未找到设备对象的值");
                    //else
                    //    Console.WriteLine($"RGV01设备对象类型错误");
                }
                #endregion
                #region  RGV02调度
                if (commonRGVSecond != null && commonRGVFirst is CommonRGV_FirstFloor SecondRgv)//这样能看出来传参到底哪里有问题
                if (commonRGVSecond != null && commonRGVSecond is CommonRGV_FirstFloor SecondRgv)//这样能看出来传参到底哪里有问题
                {
                    if (SecondRgv.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.WorkCompleted))
                    {
@@ -254,6 +255,7 @@
                            Running = RGVWorkStatus(SecondRgv.GetValue<RGVDBName, bool>(RGVDBName.Running)),
                            LevelPoint = SecondRgv.GetValue<RGVDBName, int>(RGVDBName.LevelPoint),
                            CurrentTaskNum = SecondRgv.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum),
                            RGVAlarm = SecondRgv.GetValue<RGVDBName, uint>(RGVDBName.RGVAlarm),
                            SecondRgv.DeviceCode,
                            SecondRgv.DeviceName,
                        };
@@ -265,10 +267,10 @@
                }
                else
                {
                    if (commonRGVSecond == null)
                        Console.WriteLine($"RGV02未找到设备对象的值");
                    else
                        Console.WriteLine($"RGV02设备对象类型错误");
                    //if (commonRGVSecond == null)
                    //    Console.WriteLine($"RGV02未找到设备对象的值");
                    //else
                    //    Console.WriteLine($"RGV02设备对象类型错误");
                }
                #endregion
                //}
@@ -435,7 +437,7 @@
            {
                var tasks = _taskService.QueryRGVTask();
                Dt_Task task;
                if (tasks == null && tasks.Count() == 0)
                if (tasks.Count() == 0)
                {
                    return null;
                }