From 7ff298c6834275b63b612af49651673689a39660 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期三, 27 十一月 2024 11:33:18 +0800 Subject: [PATCH] 更新 --- WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs | 25 ++++--------------------- 1 files changed, 4 insertions(+), 21 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs b/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs index e04fe7a..8814ec7 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs @@ -40,7 +40,7 @@ List<string> cacheDicNos = new List<string>(); foreach (string n in dicNos) { - string str = _cacheService.Get(n); + string? str = _cacheService.Get(n); if (!string.IsNullOrEmpty(str)) { VueDictionaryDTO? vueDictionary = JsonConvert.DeserializeObject<VueDictionaryDTO>(str); @@ -76,14 +76,15 @@ { Config = v.Config, DicNo = v.DicNo, - Data = BaseDal.QueryDynamicDataBySql(v.DBSql) + Data = BaseDal.QueryDynamicDataBySql(v.DBSql), + SaveCache = false, }); } } foreach (var item in selectDics) { - if (!_cacheService.Exists(item.DicNo)) + if (!_cacheService.Exists(item.DicNo) && item.SaveCache) { _cacheService.Add(item.DicNo, item.Serialize()); } @@ -91,25 +92,7 @@ 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(); - - return vueDictionaryDTOs; } - - } } -- Gitblit v1.9.3