package com.cm.common.plugin.oauth.service.department;

import com.alibaba.fastjson.JSONArray;
import com.cm.common.exception.AccessTokenException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.dtos.department.DepartmentSortDTO;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IDepartmentService
 * @Description: 组织部门
 * @Author: WangGeng
 * @Date: 2019-07-29 21:45
 * @Version: 1.0
 **/
public interface IDepartmentService {

    /**
     * 组织部门列表
     *
     * @param params
     * @return
     * @throws AccessTokenException
     * @throws AccessTokenException
     * @throws SearchException
     */
    JSONArray listDepartments(Map<String, Object> params) throws AccessTokenException, AccessTokenException, SearchException;

    /**
     * 组织部门列表
     *
     * @param parentId
     * @return
     * @throws AccessTokenException
     * @throws SearchException
     */
    JSONArray listDepartmentsAllByParentId(String parentId) throws AccessTokenException, SearchException;

    /**
     * 部门人员列表
     *
     * @param departmentParentId
     * @return
     * @throws AccessTokenException
     * @throws SearchException
     */
    JSONArray listZTreeDepartmentWithUser(String departmentParentId) throws AccessTokenException, SearchException;

    /**
     * 部门ZTree列表
     *
     * @param params
     * @return
     * @throws AccessTokenException
     * @throws SearchException
     */
    JSONArray listZTreeDepartment(Map<String, Object> params) throws AccessTokenException, SearchException;

    /**
     * 部门列表
     *
     * @param type 部门类型
     * @return
     */
    List<DepartmentSortDTO> listSortByType(String type);

    /**
     * 部门列表
     *
     * @param parentId 上级ID
     * @return
     */
    List<DepartmentSortDTO> listSortByParentId(String parentId);
}
