huangxiaoqiang
2025-10-15 b7da1f32d5d9997378b5ac535593a3f6144af46b
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs
@@ -25,20 +25,20 @@
        /// <returns></returns>
        public IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, bool executeSql = true)
        {
            List<Sys_Dictionary> Dictionaries = GetAllDictionary();
            List<Sys_Dictionary> Dictionaries = GetAllDictionary(dicNos);
            foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo)))
            {
                if (executeSql)
                {
                    //  2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql
                    string sql = item.DBSql;
                    if (!string.IsNullOrEmpty(sql))
                    {
                        item.DicList = Query(sql);
                    }
                }
            }
            //foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo)))
            //{
            //    if (executeSql)
            //    {
            //        //  2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql
            //        string sql = item.DBSql;
            //        if (!string.IsNullOrEmpty(sql))
            //        {
            //            item.DicList = Query(sql);
            //        }
            //    }
            //}
            return Dictionaries;
        }
@@ -59,10 +59,11 @@
            }
        }
        private List<Sys_Dictionary> GetAllDictionary()
        private List<Sys_Dictionary> GetAllDictionary(IEnumerable<string> dicNos)
        {
            //base.QueryData().ToList();
            List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1).ToList();
            //List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1).ToList();
            List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1 && dicNos.Contains(x.DicNo)).ToList();
            return _dictionaries;
        }
    }