1
huangxiaoqiang
2025-10-22 d4b0b578752a1478f6c11b352fbb8d2bad1f9e1d
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs
@@ -486,6 +486,96 @@
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
                case "OrderStateEmun":
                    {
                        List<object> data = new List<object>();
                        #region OrderStateEmun
                        {
                            Type type = typeof(OrderStateEmun);
                            List<int> enums = Enum.GetValues(typeof(OrderStateEmun)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(OrderStateEmun).GetField(((OrderStateEmun)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++;
                            }
                        }
                        #endregion
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
                case "OrderTypeEmun":
                    {
                        List<object> data = new List<object>();
                        #region OrderTypeEmun
                        {
                            Type type = typeof(OrderTypeEmun);
                            List<int> enums = Enum.GetValues(typeof(OrderTypeEmun)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(OrderTypeEmun).GetField(((OrderTypeEmun)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++;
                            }
                        }
                        #endregion
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
                case "OrderCreateTypeEmun":
                    {
                        List<object> data = new List<object>();
                        #region OrderCreateTypeEmun
                        {
                            Type type = typeof(OrderCreateTypeEmun);
                            List<int> enums = Enum.GetValues(typeof(OrderCreateTypeEmun)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(OrderCreateTypeEmun).GetField(((OrderCreateTypeEmun)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++;
                            }
                        }
                        #endregion
                        result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                    }
                    break;
                    
            }
            return result;