package ink.wgink.service.department.service;

import ink.wgink.interfaces.department.IDepartmentUserBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.pos.DepartmentPO;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.department.pojo.vos.DepartmentUserSortVO;
import ink.wgink.service.user.pojo.pos.UserPO;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IDepartmentUserService
 * @Description: 组织部门用户
 * @Author: wanggeng
 * @Date: 2021/1/28 4:21 下午
 * @Version: 1.0
 */
public interface IDepartmentUserService extends IDepartmentUserBaseService {

    /**
     * 用户加入组织组织
     */
    String USER_DEPARTMENT_TYPE_JOIN = "join";
    /**
     * 用户离开组织组织
     */
    String USER_DEPARTMENT_TYPE_LEAVE = "leave";

    /**
     * 新增用户ID
     *
     * @param departmentId      部门ID
     * @param departmentName    部门名称
     * @param departmentUserIds 新增的用户ID列表
     */
    void save(String departmentId, String departmentName, List<String> departmentUserIds);

    /**
     * 新增用户ID
     *
     * @param departmentId 部门ID
     * @param userIds      新增的用户ID列表
     */
    void save(String departmentId, List<String> userIds);


    /**
     * 删除用户
     *
     * @param departmentId   部门ID
     * @param departmentName 部门名称
     * @param userIds        用户ID列表
     */
    void delete(String departmentId, String departmentName, List<String> userIds);

    /**
     * 删除用户
     *
     * @param departmentId 部门ID
     */
    void delete(String departmentId);

    /**
     * 更新用户
     *
     * @param departmentId 部门ID
     * @param saveIds      新增ID
     * @param deleteIds    删除ID
     */
    void update(String departmentId, List<String> saveIds, List<String> deleteIds);

    /**
     * 更新用户排序
     *
     * @param departmentId
     * @param departmentUserSortVO
     */
    void updateSort(String departmentId, DepartmentUserSortVO departmentUserSortVO);

    /**
     * @param departmentId
     * @param userIds
     * @return
     */
    List<DepartmentUserDTO> listByDepartmentIdAndUserIds(String departmentId, List<String> userIds);

    /**
     * 部门列表
     *
     * @param userId 用户ID
     * @return
     */
    List<DepartmentPO> listDepartmentPOByUserId(String userId);

    /**
     * 部门列表（简单）
     *
     * @param departmentPOs
     * @return
     */
    List<DepartmentSimpleDTO> listSimple(List<DepartmentPO> departmentPOs);

    /**
     * 部门用户列表
     *
     * @param params
     * @return
     */
    List<DepartmentUserDTO> listWithUser(Map<String, Object> params);

    /**
     * 机构用户分页列表
     *
     * @param successResultList
     * @return
     */
    SuccessResultList<List<DepartmentUserDTO>> listPageExcludeDepartmentUser(SuccessResultList<List<UserDTO>> successResultList);

    /**
     * 机构用户分页列表
     *
     * @param userDTOs
     * @return
     */
    List<DepartmentUserDTO> listExcludeDepartmentUser(List<UserDTO> userDTOs);

    /**
     * 机构用户分页列表
     *
     * @param successResultList
     * @param hasDepartmentUsers
     * @return
     */
    SuccessResultList<List<DepartmentUserDTO>> listPageDepartmentUser(SuccessResultList<List<UserDTO>> successResultList, List<DepartmentUserDTO> hasDepartmentUsers);

    /**
     * 用户列表
     *
     * @param requestParams
     * @return
     */
    List<UserDTO> listUser(Map<String, Object> requestParams);

    /**
     * 用户分页
     *
     * @param page
     * @return
     */
    SuccessResultList<List<UserDTO>> listPageUser(ListPage page);

    /**
     * 用户列表
     *
     * @param params
     * @return
     */
    List<UserPO> listUserPO(Map<String, Object> params);

    /**
     * 用户列表
     *
     * @param departmentId
     * @return
     */
    List<UserPO> listUserPOByDepartmentId(String departmentId);

    /**
     * 用户列表
     *
     * @param departmentIds
     * @return
     */
    List<UserPO> listUserPOByDepartmentIds(List<String> departmentIds);


}
