|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|