From b7da1f32d5d9997378b5ac535593a3f6144af46b Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 15 十月 2025 17:15:38 +0800
Subject: [PATCH] 新增AGV与堆垛机移库判断及缓存优化

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs"
index d60dbd6..4ed2cf3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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;
         }
     }

--
Gitblit v1.9.3