package com.ym.mec.biz.service;

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

import com.ym.mec.biz.dal.entity.Organization;
import com.ym.mec.biz.dal.page.EducationBaseQueryInfo;
import com.ym.mec.common.service.BaseService;

public interface OrganizationService extends BaseService<Integer, Organization> {

    Set<Integer>  EXCLUDE_ORGAN_IDS = new HashSet<>(Arrays.asList(36,38,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56,2,27,22,24));

    /**
     * 获取员工所在分部列表
     * @return
     */
    List<Organization> queryEmployeeOrgan() throws Exception;
    
    List<Organization> queryAllOrganWithNoAuth(Integer tenantId);

    /**
     * 获取员工坐在分部列表
     * @return
     */
    List<Organization> queryEmployeeOrganByUser() throws Exception;

    /**
     * 获取分部名称
     * @return
     */
    String getOrganName(String organId);

    /**
     * 获取分部学年制的年级列表
     * @param id
     */
    Map<Integer, String> getGradeList(Integer id);

    /**
    * @description: 获取员工能访问的分部列表
     * @param userId 当前用户
     * @param organIds 用户选择的分部
     * @param isSuper 是否超管
    * @return java.lang.String
    * @author zx
    * @date 2022/1/5 12:44
    */
    String getEmployeeOrgan(Integer userId,String organIds,Boolean isSuper);

    /**
    * @description: 获取员工能访问的分部列表
     * @param organIds 用户选择的分部
    * @return java.lang.String
    * @author zx
    * @date 2022/1/5 12:44
    */
    String getEmployeeOrgan(Object organIds);

    /**
    * @description: 获取老师所在分部列表（包含流动分部）
    * @return java.lang.String
    * @author zx
    * @date 2022/1/5 12:44
    */
    String getTeacherOrgan();

    List<Organization> findAllOrgans(Integer tenantId);

    List<Organization> findOrgans(List<Integer> organIds,Integer tenantId);
    
    List<Organization> queryEmployeeOrgan(String organId);

    /**
    * @description: 校验当前用户是否只有教务老师角色,并给教务老师角色赋值
     * @param queryInfo
    * @return T
    * @author zx
    * @date 2022/1/6 18:11
    */
    <T extends EducationBaseQueryInfo> T onlyEducation(T queryInfo);
    
    boolean updateBasicInfo(Organization organization);

    Long add(Organization organization);
}
