Commit 3056cf48 authored by 黄奎's avatar 黄奎

新增方法

parent 349daad7
......@@ -84,11 +84,43 @@ namespace Edu.Module.User
/// <summary>
/// 获取当前部门的所有上级部门
/// </summary>
/// <param name="currentIds"></param>
/// <param name="DeptId"></param>
/// <returns></returns>
public List<RB_Department_ViewModel> GetAllSuperiorDepartmentListModule(object DeptId)
{
return departmentRepository.GetAllSuperiorDepartmentListRepository(DeptId);
}
/// <summary>
/// 获取当前部门的所有上级部门编号【例如:1,2,3...】
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public string GetAllSuperiorDepartmentIdsModule(object DeptId)
{
return departmentRepository.GetAllSuperiorDepartmentIdsRepository(DeptId);
}
/// <summary>
/// 获取当前部门和当前部门所有的下级部门列表
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public List<RB_Department_ViewModel> GetCurrentAndChildDepartmentListModule(object DeptId)
{
return departmentRepository.GetCurrentAndChildDepartmentListRepository(DeptId);
}
/// <summary>
/// 获取当前部门和当前部门所有的下级部门【例如:1,2,3...】
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public List<RB_Department_ViewModel> GetAllSuperiorDepartmentListModule(object DeptIds)
public string GetCurrentAndChildDepartmentIdsModule(object DeptId)
{
return departmentRepository.GetAllSuperiorDepartmentListRepository(DeptIds);
return departmentRepository.GetCurrentAndChildDepartmentIdsRepository(DeptId);
}
/// <summary>
......
......@@ -131,15 +131,60 @@ WHERE 1=1
/// <summary>
/// 获取当前部门的所有上级部门
/// 获取当前部门的所有上级部门编号【例如:1,2,3...】
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public string GetAllSuperiorDepartmentIdsRepository(object DeptId)
{
string deptIds = "";
var list = GetAllSuperiorDepartmentListRepository(DeptId);
if (list != null)
{
deptIds = string.Join(",", list.Select(qitem => qitem.DeptId));
}
return deptIds;
}
/// <summary>
/// 获取当前部门的所有上级部门列表
/// </summary>
/// <param name="currentIds"></param>
/// <returns></returns>
public List<RB_Department_ViewModel> GetAllSuperiorDepartmentListRepository(object DeptIds)
public List<RB_Department_ViewModel> GetAllSuperiorDepartmentListRepository(object DeptId)
{
var parameters = new DynamicParameters();
string procName = "proc_getsuperiordepartment";
parameters.Add("QDeptIds", DeptIds, direction: ParameterDirection.Input);
parameters.Add("QDeptIds", DeptId, direction: ParameterDirection.Input);
return Get<RB_Department_ViewModel>(procName, parameters, commandType: CommandType.StoredProcedure).ToList();
}
/// <summary>
/// 获取当前部门和当前部门所有的下级部门【例如:1,2,3...】
/// </summary>
/// <param name="DeptIds"></param>
/// <returns></returns>
public string GetCurrentAndChildDepartmentIdsRepository(object DeptId)
{
string deptIds = "";
var list = GetCurrentAndChildDepartmentListRepository(DeptId);
if (list != null)
{
deptIds = string.Join(",", list.Select(qitem => qitem.DeptId));
}
return deptIds;
}
/// <summary>
/// 获取当前部门和当前部门所有的下级部门列表
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public List<RB_Department_ViewModel> GetCurrentAndChildDepartmentListRepository(object DeptId)
{
var parameters = new DynamicParameters();
string procName = "proc_getchilddepartment";
parameters.Add("QDeptIds", DeptId, direction: ParameterDirection.Input);
return Get<RB_Department_ViewModel>(procName, parameters, commandType: CommandType.StoredProcedure).ToList();
}
}
......
......@@ -759,6 +759,22 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取当前部门和当前部门所有的下级部门列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCurrentAndChildDepartment()
{
int DeptId = base.ParmJObj.GetInt("DeptId");
if (DeptId<=0)
{
return ApiResult.ParamIsNull(message: "请选择部门编号!");
}
var list = departmentModule.GetCurrentAndChildDepartmentListModule(DeptId);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取部门树形列表
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment