hutongqing
2024-12-16 d6ce83b1f1bb87b88c11df1e0fe96169de5b571f
代码管理/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;
        }
    }
}