|
|
|
|
|
|
|
|
|
|
|
|
|
|
//----------SysDept开始----------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Model.Sys;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Admin.Core.IService.ISys
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 部门表IService
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISysDeptService : IBaseServices<SysDept>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询部门管理数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="pageQuery"> 部门信息 </param>
|
|
|
|
|
/// <returns> 部门信息集合 </returns>
|
|
|
|
|
Task<PageModel<DeptView>> SelectDeptList(PageQuery<SysDept> pageQuery);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构建前端所需要树结构
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="depts"> 部门列表 </param>
|
|
|
|
|
/// <returns> 树结构列表 </returns>
|
|
|
|
|
List<DeptView> BuildDeptTree(List<DeptView> depts);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构建前端所需要下拉树结构
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="depts"> 部门列表 </param>
|
|
|
|
|
/// <returns> 下拉树结构列表 </returns>
|
|
|
|
|
List<TreeSelect> BuildDeptTreeSelect(List<SysDept> depts);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据角色ID查询部门树信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="roleId"> 角色ID </param>
|
|
|
|
|
/// <returns> 选中部门列表 </returns>
|
|
|
|
|
Task<List<int>> SelectDeptListByRoleId(int roleId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据部门ID查询信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 部门信息 </returns>
|
|
|
|
|
Task<SysDept> SelectDeptById(int deptId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询部门全部数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns> 部门信息 </returns>
|
|
|
|
|
Task<List<SysDept>> SelectDeptAll();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据ID查询所有子部门(正常状态)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 子部门数 </returns>
|
|
|
|
|
Task<int> SelectNormalChildrenDeptById(int deptId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据ID查询所有子部门(正常状态)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 子部ID及当前选中节点部门ID的List </returns>
|
|
|
|
|
Task<List<int>> SelectNormalChildrenIDsById(int deptId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否存在部门子节点
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 结果 </returns>
|
|
|
|
|
Task<bool> HasChildByDeptId(int deptId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询部门是否存在用户
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 结果 true 存在 false 不存在 </returns>
|
|
|
|
|
Task<bool> CheckDeptExistUser(int deptId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 校验部门名称是否唯一
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dept"> 部门信息 </param>
|
|
|
|
|
/// <returns> 结果 </returns>
|
|
|
|
|
Task<bool> CheckDeptNameUnique(SysDept dept);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增保存部门信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dept"> 部门信息 </param>
|
|
|
|
|
/// <returns> 结果 </returns>
|
|
|
|
|
Task<int> InsertDept(SysDept dept);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 修改保存部门信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dept"> 部门信息 </param>
|
|
|
|
|
/// <returns> 结果 </returns>
|
|
|
|
|
Task<bool> UpdateDept(SysDept dept);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除部门管理信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deptId"> 部门ID </param>
|
|
|
|
|
/// <returns> 结果 </returns>
|
|
|
|
|
Task<bool> DeleteDeptById(int deptId, string updateBy);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//----------SysDept结束----------
|
|
|
|
|
|