分支自 SuZhouGuanHong/TaiYuanTaiZhong

WMS
dengjunjie
2024-01-16 92b129a783ff748a4e5365803aa862888fa4470e
代码管理/WMS/WMS_Server/WIDESEA_System/Services/System/Partial/Sys_DictionaryService.cs
@@ -31,17 +31,18 @@
            get { return DictionaryManager.Dictionaries; }
        }
        public object GetVueDictionary(string[] dicNos)
        public async Task<object> GetVueDictionary(string[] dicNos)
        {
            if (dicNos == null || dicNos.Count() == 0) return new string[] { };
            var dicConfig = DictionaryManager.GetDictionaries(dicNos, false).Select(s => new
            {
                dicNo = s.DicNo,
                config = s.Config,
                dbSql = s.DbSql,
                list = s.Sys_DictionaryList.OrderByDescending(o => o.OrderNo)
                          .Select(list => new { key = list.DicValue, value = list.DicName })
            }).ToList();
            var dicConfig = await Task.FromResult(
                      DictionaryManager.GetDictionaries(dicNos, false).Select(s => new
                      {
                          dicNo = s.DicNo,
                          config = s.Config,
                          dbSql = s.DbSql,
                          list = s.Sys_DictionaryList.OrderByDescending(o => o.OrderNo)
                           .Select(list => new { key = list.DicValue, value = list.DicName })
                      }).ToList());
            object GetSourceData(string dicNo, string dbSql, object data)
            {
@@ -61,6 +62,36 @@
            }).ToList();
        }
        //public object GetVueDictionary(string[] dicNos)
        //{
        //    if (dicNos == null || dicNos.Count() == 0) return new string[] { };
        //    var dicConfig = DictionaryManager.GetDictionaries(dicNos, false).Select(s => new
        //    {
        //        dicNo = s.DicNo,
        //        config = s.Config,
        //        dbSql = s.DbSql,
        //        list = s.Sys_DictionaryList.OrderByDescending(o => o.OrderNo)
        //                  .Select(list => new { key = list.DicValue, value = list.DicName })
        //    }).ToList();
        //    object GetSourceData(string dicNo, string dbSql, object data)
        //    {
        //        //  2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql
        //        dbSql = DictionaryHandler.GetCustomDBSql(dicNo, dbSql);
        //        if (string.IsNullOrEmpty(dbSql))
        //        {
        //            return data as object;
        //        }
        //        return repository.DapperContext.QueryList<object>(dbSql, null);
        //    }
        //    return dicConfig.Select(item => new
        //    {
        //        item.dicNo,
        //        item.config,
        //        data = GetSourceData(item.dicNo, item.dbSql, item.list)
        //    }).ToList();
        //}
        /// <summary>
        /// 閫氳繃杩滅▼鎼滅储