From b6837f097e9cdb2645368aed4ddb03f580c331e4 Mon Sep 17 00:00:00 2001 From: z8018 <1282578289@qq.com> Date: 星期一, 05 五月 2025 17:29:07 +0800 Subject: [PATCH] 1 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs | 230 ++------------------------------------------------------- 1 files changed, 9 insertions(+), 221 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" index e4b2121..cdb20b7 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" @@ -21,8 +21,7 @@ using WIDESEAWCS_Core.Enums; using WIDESEAWCS_Core.Caches; using WIDESEAWCS_QuartzJob.DeviceEnum; -using WIDESEAWCS_Common.TaskEnum; -using WIDESEAWCS_DTO.Enum; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; namespace WIDESEAWCS_WCSServer.Controllers.System { @@ -48,6 +47,10 @@ List<string> cacheDicNos = new List<string>(); foreach (string n in dicNos) { + if(vueDictionaryDTOs.Where(x => x.DicNo == n).Count() > 0) + { + continue; + } string str = _cacheService.Get(n); if (!string.IsNullOrEmpty(str)) { @@ -78,6 +81,10 @@ foreach (var item in cusDics) { + if (vueDictionaryDTOs.Where(x => x.DicNo == item).Count() > 0) + { + continue; + } VueDictionaryDTO vueDictionaryDTO = GetVueDictionary(item.Trim()); if (vueDictionaryDTO != null) { @@ -170,153 +177,6 @@ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } break; - case "taskType": - { - List<object> data = new List<object>(); - - #region TaskInboundTypeEnum - { - Type type = typeof(TaskInboundTypeEnum); - List<int> enums = Enum.GetValues(typeof(TaskInboundTypeEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskInboundTypeEnum).GetField(((TaskInboundTypeEnum)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 - - #region TaskOutboundTypeEnum - { - Type type = typeof(TaskOutboundTypeEnum); - List<int> enums = Enum.GetValues(typeof(TaskOutboundTypeEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskOutboundTypeEnum).GetField(((TaskOutboundTypeEnum)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 - - #region TaskRelocationTypeEnum - { - Type type = typeof(TaskRelocationTypeEnum); - List<int> enums = Enum.GetValues(typeof(TaskRelocationTypeEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskRelocationTypeEnum).GetField(((TaskRelocationTypeEnum)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 - - #region TaskOtherTypeEnum - { - Type type = typeof(TaskOtherTypeEnum); - List<int> enums = Enum.GetValues(typeof(TaskOtherTypeEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskOtherTypeEnum).GetField(((TaskOtherTypeEnum)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 "taskState": - { - List<object> data = new List<object>(); - - #region TaskInStatusEnum - { - Type type = typeof(TaskInStatusEnum); - List<int> enums = Enum.GetValues(typeof(TaskInStatusEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskInStatusEnum).GetField(((TaskInStatusEnum)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 - - #region TaskOutStatusEnum - { - Type type = typeof(TaskOutStatusEnum); - List<int> enums = Enum.GetValues(typeof(TaskOutStatusEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskOutStatusEnum).GetField(((TaskOutStatusEnum)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 "devicePlcType": { Type type = typeof(BaseCommunicator); @@ -336,78 +196,6 @@ { data.Add(new { key = deviceType.Name, value = deviceType.Name }); } - } - - result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; - } - break; - case "inOutType": - { - List<object> data = new List<object>(); - Type type = typeof(RouterInOutType); - List<int> enums = Enum.GetValues(typeof(RouterInOutType)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(RouterInOutType).GetField(((RouterInOutType)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 "agvStationEnum": - { - List<object> data = new List<object>(); - Type type = typeof(AgvStationEnum); - List<int> enums = Enum.GetValues(typeof(AgvStationEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(AgvStationEnum).GetField(((AgvStationEnum)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 "agvareaEnum": - { - List<object> data = new List<object>(); - Type type = typeof(AgvareaEnum); - List<int> enums = Enum.GetValues(typeof(AgvareaEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(AgvareaEnum).GetField(((AgvareaEnum)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 }; -- Gitblit v1.9.3