From 553dfb0714e78ca05a62fcf352cc1da2c0be5b70 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期三, 27 十一月 2024 09:49:21 +0800
Subject: [PATCH] 更新

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs"
index 952104b..be0efdc 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs"
@@ -89,7 +89,7 @@
                             if (vueDictionaryDTO != null)
                             {
                                 vueDictionaryDTOs.Add(vueDictionaryDTO);
-                                if (!_cacheService.Exists(item))
+                                if (!_cacheService.Exists(item) && vueDictionaryDTO.SaveCache)
                                 {
                                     _cacheService.Add(item, vueDictionaryDTO.Serialize());
                                 }
@@ -528,6 +528,33 @@
                             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;
                     case "stockStatusEmun":
                         {
                             List<object> data = new List<object>();

--
Gitblit v1.9.3