From 81cfbb34ad9092b19a2e3692786ee97f3646014b Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 16 十二月 2024 21:30:46 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs | 26 +++++--------------------- 1 files changed, 5 insertions(+), 21 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs" index ebb2da4..8814ec7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs" @@ -7,6 +7,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; +using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Caches; @@ -39,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); @@ -75,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()); } @@ -90,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