From 3e0726a15881d5fd9cb5f5c6a09eb67e44c93f82 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 9 Aug 2022 10:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=B7=A6=E4=BE=A7=E6=A0=91=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CdDept/CdDeptBLL.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs index 7f1f837a3..265df897c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs @@ -18,6 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { private CdDeptService cdDeptService = new CdDeptService(); + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_cddept"; + + #endregion #region 获取数据 public List GetTree(string parentId) @@ -62,12 +67,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - //List list = cache.Read>(cacheKey); - //if (list == null) - //{ - // list = (List)cdDeptService.GetList(); - // cache.Write>(cacheKey, list, CacheId.company); - //} + List list = cache.Read>(cacheKey); + if (list == null) + { + list = (List)cdDeptService.GetList(); + cache.Write>(cacheKey, list, CacheId.company); + } return list; } catch (Exception ex)