package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.dto.SimpleUserDto;
import com.ym.mec.biz.dal.dto.SysEmployeePositionDto;
import com.ym.mec.biz.dal.entity.SysEmployeePosition;
import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
import com.ym.mec.common.service.BaseService;

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

public interface SysEmployeePositionService extends BaseService<Integer, SysEmployeePosition> {

    void batchAddPosition(Integer userId, List<Integer> positionIds, Integer tenantId);

    void delPosition(Integer userId, Integer tenantId);

    /**
    * @description: 获取分部下所有职位，员工列表
     * @param
    * @return void
    * @author zx
    * @date 2022/1/8 11:29
    */
    Map<String, List<SimpleUserDto>> findOrganPosition(String organIds, Integer tenantId);

    /**
    * @description: 查询当前用户是否只有指定角色
     * @param role
     * @param userId
    * @return java.lang.Boolean
    * @author zx
    * @date 2022/1/8 14:15
    */
    Boolean onlyForRole(SysUserRoleEnum role, Integer userId,Boolean isSuper);

    /**
    * @description: 获取用户所有角色
     * @param
    * @return java.util.List<com.ym.mec.biz.dal.enums.SysUserRoleEnum>
    * @author zx
    * @date 2022/1/8 16:06
    */
    List<SysUserRoleEnum> queryAllRole(Integer userId,Boolean isSuper);

    /**
     * @description: 获取分部的管理人员
     * @param roleArr
     * @param organId
     * @return java.util.Set<java.lang.Integer>
     * @author zx
     * @date 2022/1/4 11:36
     */
    Set<Integer> queryUserIdByRoleId(SysUserRoleEnum[] roleArr, Integer organId);

    List<SysEmployeePositionDto> queryByUserId(Integer userId);
}