From b513ce3a4527e998da66c6f179a279472c7262a8 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 18 十一月 2025 10:59:46 +0800
Subject: [PATCH] 代码更新优化

---
 项目代码/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs |  148 +++++++++++++++++++++++++++---------------------
 1 files changed, 83 insertions(+), 65 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
index 25e77a2..f3d1a28 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
@@ -109,22 +109,6 @@
                 }
                 vueDictionaryDTOs.AddRange(selectDics);
             }
-
-            //object GetSourceData(string dicNo, string dbSql, object data)
-            //{
-            //    if (string.IsNullOrEmpty(dbSql))
-            //    {
-            //        return data;
-            //    }
-            //    return BaseDal.QueryObjectDataBySql(dbSql, null);
-            //}
-            //List<VueDictionaryDTO> vueDictionaryDTOs = dicConfig.Select(item => new VueDictionaryDTO
-            //{
-            //    DicNo = item.dicNo,
-            //    Config = item.config,
-            //    Data = GetSourceData(item.dicNo, item.dbSql, item.list)
-            //}).ToList();
-
             try
             {
                 List<string> dicList = dicNos.ToList();
@@ -423,33 +407,6 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
-                    case "taskTypeEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            //{
-                            //    Type type = typeof(TaskTypeEnum);
-                            //    List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList();
-                            //    int index = 0;
-                            //    foreach (var item in enums)
-                            //    {
-                            //        FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)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 "taskStatusEnum":
                         {
                             List<object> data = new List<object>();
@@ -474,25 +431,6 @@
                                 }
                             }
 
-                            //{
-                            //    Type type = typeof(TaskStatusEnum);
-                            //    List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList();
-                            //    int index = 0;
-                            //    foreach (var item in enums)
-                            //    {
-                            //        FieldInfo? fieldInfo = typeof(TaskStatusEnum).GetField(((TaskStatusEnum)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;
@@ -690,17 +628,71 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
+                    case "materielUnitEnum":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                Type type = typeof(MaterielUnitEnum);
+                                List<string> enumNames = Enum.GetNames(typeof(MaterielUnitEnum)).ToList();
+                                int index = 0;
+                                foreach (var item in enumNames)
+                                {
+                                    FieldInfo? fieldInfo = typeof(MaterielUnitEnum).GetField((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 "agvStationAreaEnum":
                         {
                             List<object> data = new List<object>();
 
                             {
-                                Type type = typeof(AGVStationAreaEnum);
-                                List<int> enums = Enum.GetValues(typeof(AGVStationAreaEnum)).Cast<int>().ToList();
+                                Type type = typeof(StationAreaEnum);
+                                List<string> enumNames = Enum.GetNames(typeof(StationAreaEnum)).ToList();
+                                int index = 0;
+                                foreach (var item in enumNames)
+                                {
+                                    FieldInfo? fieldInfo = typeof(StationAreaEnum).GetField((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 "printAreaEnum":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                Type type = typeof(PrintAreaEnum);
+                                List<int> enums = Enum.GetValues(typeof(PrintAreaEnum)).Cast<int>().ToList();
                                 int index = 0;
                                 foreach (var item in enums)
                                 {
-                                    FieldInfo? fieldInfo = typeof(AGVStationAreaEnum).GetField(((AGVStationAreaEnum)item).ToString());
+                                    FieldInfo? fieldInfo = typeof(PrintAreaEnum).GetField(((PrintAreaEnum)item).ToString());
                                     DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                     if (description != null)
                                     {
@@ -743,6 +735,32 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
+                    case "inOrderTypeEnum":
+                        {
+                            List<object> data = new List<object>();
+                            {
+                                Type type = typeof(InOrderTypeEnum);
+                                List<int> enums = Enum.GetValues(typeof(InOrderTypeEnum)).Cast<int>().ToList();
+                                int index = 0;
+                                foreach (var item in enums)
+                                {
+                                    FieldInfo? fieldInfo = typeof(InOrderTypeEnum).GetField(((InOrderTypeEnum)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;
             }

--
Gitblit v1.9.3