yanjinhui
2026-03-17 17c97e7fb4f5c007887816168e89c107421e26c8
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -22,6 +22,7 @@
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_QuartzJob.DeviceEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Common.LocationEnum;
namespace WIDESEAWCS_WCSServer.Controllers.System
{
@@ -413,6 +414,54 @@
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "RGVLocationTypeEnum":
                        {
                            List<object> data = new List<object>();
                            Type type = typeof(RGVLocationTypeEnum);
                            List<int> enums = Enum.GetValues(typeof(RGVLocationTypeEnum)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(RGVLocationTypeEnum).GetField(((RGVLocationTypeEnum)item).ToString());
                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = item.ToString(), value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = item.ToString(), value = item.ToString() });
                                }
                                index++;
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "LocationTypeEnum":
                        {
                            List<object> data = new List<object>();
                            Type type = typeof(LocationTypeEnum);
                            List<int> enums = Enum.GetValues(typeof(LocationTypeEnum)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(LocationTypeEnum).GetField(((LocationTypeEnum)item).ToString());
                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = item.ToString(), value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = item.ToString(), value = item.ToString() });
                                }
                                index++;
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                }
                return result;
            }