diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs
index 66f6f7c25..8841da681 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs
@@ -94,6 +94,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success(data);
}
+ ///
+ /// 获取树形数据
+ ///
+ /// 父级id
+ ///
+ [HttpGet]
+ [AjaxOnly]
+ public ActionResult GetTree(string parentId)
+ {
+ var data = cdDeptIBLL.GetTree(parentId);
+ return JsonResult(data);
+ }
+
#endregion
#region 提交数据
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 c31f74746..cfd7413b7 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
@@ -2,6 +2,8 @@
using System;
using System.Data;
using System.Collections.Generic;
+using Learun.Cache.Base;
+using Learun.Cache.Factory;
namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
@@ -15,6 +17,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public class CdDeptBLL : CdDeptIBLL
{
private CdDeptService cdDeptService = new CdDeptService();
+ #region 缓存定义
+ private ICache cache = CacheFactory.CaChe();
+ private string cacheKey = "Learun_adms_cddept";
+
+ #endregion
#region 获取数据
@@ -201,5 +208,70 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion
+ #region 扩展数据
+ ///
+ /// 获取列表数据
+ ///
+ ///
+ public List GetList()
+ {
+ try
+ {
+ List list = cache.Read>(cacheKey);
+ if (list == null)
+ {
+ list = (List)cdDeptService.GetList();
+ cache.Write>(cacheKey, list, CacheId.company);
+ }
+ return list;
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ public List GetTree(string parentId)
+ {
+ try
+ {
+ List list = GetList();
+ List treeList = new List();
+ foreach (var item in list)
+ {
+ TreeModel node = new TreeModel
+ {
+ id = item.DeptNo,
+ text = item.DeptName,
+ value = item.DeptNo,
+ showcheck = false,
+ checkstate = 0,
+ isexpand = true,
+ parentId = item.DeptId
+ };
+ treeList.Add(node);
+ }
+ return treeList.ToTree();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ #endregion
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs
index 979da4bec..9b0ea2300 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs
@@ -55,5 +55,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
IEnumerable GetListBySchoolId(string schoolId);
IEnumerable GetAllList();
+
+ #region 扩展数据
+ ///
+ /// 获取树形数据
+ ///
+ /// 父级id
+ ///
+ List GetTree(string parentId);
+
+ ///
+ /// 获取列表数据
+ ///
+ ///
+ List GetList();
+ #endregion
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs
index 507cdd93a..b3a7fb925 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs
@@ -250,5 +250,34 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ #region 扩展数据
+ ///
+ /// 获取公司列表信息(全部)
+ ///
+ ///
+ public IEnumerable GetList()
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(" * ");
+ strSql.Append(" FROM CdDept t WHERE 1=1 order by t.deptSort ");
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ #endregion
}
}