package cn.estsh.i3plus.core.api.iservice.busi;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.model.platform.CommonTreeModel;
import cn.estsh.i3plus.pojo.platform.bean.SysDepartment;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.i3plus.pojo.platform.bean.SysOrganize;
import cn.estsh.i3plus.pojo.platform.bean.SysPosition;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import java.util.Map;

/**
 * @Description : 通用树查询服务
 * @Reference :
 * @Author : wei.peng
 * @Date : 2018-10-24 11:16
 * @Modify :
 **/
public interface ICoreTreeService {

    /**
     * 获取岗位树
     * @param parentId
     * @return
     */
    @ApiOperation(value = "获取岗位树",notes = "根据父节点获取岗位树集合")
    List<SysPosition> findSysPositionTreeByParentId(long parentId);

    /**
     * 获取岗位树
     * @param id
     * @return
     */
    @ApiOperation(value = "获取岗位树",notes = "根据父节点获取岗位树")
    SysPosition getSysPositionTreeById(long id);

    /**
     * 生成子集树递归方法
     * @param parent 父类对象
     * @param step 层级
     */
    @ApiOperation(value = "封装岗位树",notes = "封装当前岗位树")
    void findSysPositionChildrenTreePack(SysPosition parent,int step);

    /**
     * 检查父节点是否是子节点ID或者为当前节点ID
     * @param position
     */
    @ApiOperation(value = "父节点检查",notes = "检查岗位的父节点是否是当前节点的子节点")
    void doValidatorSysPositionParentId(SysPosition position) ;

    /**
     * 获取部门树
     * @param parentId
     * @return
     */
    @ApiOperation(value = "获取部门树",notes = "根据父节点获取部门树集合")
    List<SysDepartment> findSysDepartmentTreeByParentId(long parentId);

    /**
     * 获取部门树
     * @param id
     * @return
     */
    @ApiOperation(value = "获取部门树",notes = "根据父节点获取部门树")
    SysDepartment getSysDepartmentTreeById(long id);

    @ApiOperation(value = "获取部门ID集合",notes = "根据组织ID获取部门子集ID集合")
    List<Long> findSysDepartmentIdByOrganizeId(long id);

    @ApiOperation(value = "获取部门ID集合",notes = "获取部门子集ID集合")
    List<Long> findSysDepartmentChildIds(SysDepartment department);

    /**
     * 生成子集树递归方法
     * @param parent 父类对象
     * @param step 层级
     */
    @ApiOperation(value = "封装部门树",notes = "封装当前部门树")
    void findSysDepartmentChildrenTreePack(SysDepartment parent,int step);

    /**
     * 检查父节点是否是子节点ID或者为当前节点ID
     * @param department
     */
    @ApiOperation(value = "父节点检查",notes = "检查部门的父节点是否是当前节点的子节点")
    void doValidatorSysDepartmentParentId(SysDepartment department) ;

    /**
     * 获取组织树
     * @param parentId
     * @return
     */
    @ApiOperation(value = "获取组织树",notes = "根据父节点获取组织树集合")
    List<SysOrganize> findSysOrganizeTreeByParentId(long parentId);

    @ApiOperation(value = "获取组织子集ID集合",notes = "获取组织子集ID集合")
    List<Long> findSysOrganizeChildIds(SysOrganize organize);

    /**
     * 获取组织树
     * @param id
     * @return
     */
    @ApiOperation(value = "获取组织树",notes = "根据父节点获取组织树")
    SysOrganize getSysOrganizeTreeById(long id);

    /**
     * 生成子集树递归方法
     * @param parent 父类对象
     * @param step 层级
     */
    @ApiOperation(value = "封装组织树",notes = "封装当前组织树")
    void findSysOrganizeChildrenTreePack(SysOrganize parent,int step);

    /**
     * 检查父节点是否是子节点ID或者为当前节点ID
     * @param organize
     */
    @ApiOperation(value = "父节点检查",notes = "检查组织的父节点是否是当前节点的子节点")
    void doValidatorSysOrganizeParentId(SysOrganize organize) ;

    /**
     * 获取菜单树
     * @param parentId
     * @return
     */
    @ApiOperation(value = "获取菜单树",notes = "根据父节点获取菜单树集合")
    List<SysMenu> findSysMenuTreeByParentId(long parentId);

    /**
     * 获取菜单树
     * @param id
     * @return
     */
    @ApiOperation(value = "获取菜单树",notes = "根据父节点获取菜单树")
    SysMenu getSysMenuTreeById(long id);

    /**
     * 生成子集树递归方法
     * @param parent 父类对象
     * @param step 层级
     */
    @ApiOperation(value = "封装菜单树",notes = "封装当前菜单树")
    void findSysMenuChildrenTreePack(SysMenu parent, int step);

    @ApiOperation(value = "封装菜单树",notes = "根据角色ID封装当前菜单树")
    void findSysMenuChildrenTreeByRoleIdPack(SysMenu parent,Long roleId, int step);

    @ApiOperation(value = "封装菜单树",notes = "根据用户ID封装当前菜单树")
    void findSysMenuChildrenTreeByUserIdPack(SysMenu parent,Long userId, int step);

    @ApiOperation(value = "封装菜单树",notes = "根据用户ID 内存中封装当前菜单树")
    void findMemSysMenuChildrenTreeByUserIdPack(SysMenu parent, List<SysMenu> cacheMenuList, int step);

    /**
     * 检查父节点是否是子节点ID或者为当前节点ID
     * @param menu
     */
    @ApiOperation(value = "父节点检查",notes = "检查菜单的父节点是否是当前节点的子节点")
    void doValidatorSysMenuParentId(SysMenu menu) ;

    /**
     * 获取组织树
     * @param parentId
     * @return
     */
    @ApiOperation(value = "获取组织部门树",notes = "根据父节点获取组织部门树集合")
    List<CommonTreeModel> findOrganizeDepartment(long parentId);

    /**
     * 获取组织树
     * @param id
     * @return
     */
    @ApiOperation(value = "获取组织部门树",notes = "根据父节点获取组织部门树")
    CommonTreeModel getOrganizeById(long id);

    /**
     * 生成子集树递归方法
     * @param parent 父类对象
     * @param step 层级
     */
    @ApiOperation(value = "封装菜单树",notes = "封装当前组织部门树")
    void findOrganizeTreePack(CommonTreeModel parent, int step);

}
