| | |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_QuartzJob.DeviceEnum; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; |
| | | using WIDESEAWCS_Common; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.System |
| | | { |
| | |
| | | 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)) |
| | | { |
| | |
| | | |
| | | foreach (var item in cusDics) |
| | | { |
| | | if (vueDictionaryDTOs.Where(x => x.DicNo == item).Count() > 0) |
| | | { |
| | | continue; |
| | | } |
| | | VueDictionaryDTO vueDictionaryDTO = GetVueDictionary(item.Trim()); |
| | | if (vueDictionaryDTO != null) |
| | | { |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskState": |
| | | { |
| | | Type type = typeof(TaskStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | List<object> data = new List<object>(); |
| | | 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; |
| | | } |
| | | return result; |
| | | } |