package com.ym.mec.biz.service;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ym.mec.auth.api.entity.SysUser;
import com.ym.mec.biz.dal.dto.*;
import com.ym.mec.biz.dal.entity.*;
import com.ym.mec.biz.dal.enums.GradeTypeEnum;
import com.ym.mec.biz.dal.enums.PeriodEnum;
import com.ym.mec.biz.dal.page.*;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.page.QueryInfo;
import com.ym.mec.common.service.BaseService;

public interface StudentService extends BaseService<Integer, Student> {
	
	boolean register(StudentPreRegistration studentPreRegistration);

    PageInfo findStudentVipGroupList(StudentQueryInfo queryInfo);

    Long upSet(Student student);

    /**
     * 更新学生运营指标
     * @return
     * @throws ParseException
     */
    boolean updateOperatingTempTag();

    /**
     * @describe 初始化教师编号
     * @author Joburgess
     * @date 2020/4/16
     * @return void
     */
    void initTeacherId();

    /**
     * 修改学员的指导老师
     * @param teacherId
     */
    void batchUpdateAdviser(Integer teacherId,String studentIds);

    /**
     * 升级学生的年级
     */
    Integer updateGrade();

    /**
     * 根据学制和年级数字获取年级
     * @param gradeType
     * @param gradeNum
     * @return
     */
    String getStudentGrade(GradeTypeEnum gradeType,Integer gradeNum);

    /**
     * @describe 更新学员指导老师和声部信息
     * @author Joburgess
     * @date 2021/3/29 0029
     * @return void
     */
    void updateStudentTeacherAndSubject();


    /**
     * 获取学生的教务老师
     * @param userId
     * @return
     */
    CooperationOrgan getStudentEduTeacher(Integer userId);

    /**
    * @description: 根据开始时间和周期计算会员截止日期
     * @param periodEnum
     * @param endTime
     * @param memberNum
    * @return java.util.Date
    * @author zx
    * @date 2021/12/23 14:07
    */
    Date getMembershipEndTime(PeriodEnum periodEnum,Date endTime,Integer memberNum);

    /**
     * 更新学员会员信息
     */
    void updateMemberRank(CloudTeacherOrder cloudTeacherOrder);
    
    void updateMemberRank(Integer userId, PeriodEnum periodEnum, int times, Integer memberRankSettingId);

    /**
     * 更新服务指标
     * @param studentId
     * @param studentIds
     * @param serviceTag
     */
    void updateStudentServiceTag(Integer studentId,List<Integer> studentIds,Integer serviceTag);

    List<String> getStudentNames(List<Integer> studentIdList);

    Student getLocked(Integer userId);

    void cleanMember(Integer userId);

    /**
     * 延长会员试用期
     * @param studentIds
     * @param rankId
     * @param endTime
     */
    void updateMemberExperience(String studentIds, Integer rankId, Date endTime);
    /**
     * @describe 分部各类型学员数据统计
     * @author Joburgess
     * @date 2021/8/16 0016
     * @param queryInfo:
     * @return com.ym.mec.biz.dal.dto.StatDto
     */
    StatDto organStudentData(StudentQueryInfo queryInfo);
    StatDto exportOrganStudentData(StudentQueryInfo queryInfo);

    List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds);

    PageInfo<EduOrganStudentDataDto> queryOrganStudentOverView(List<Integer> organIds, OrganCloudStudyStudentDataQueryInfo queryInfo);

    CloudStudyStudentDataDto getCloudStudyStudentOverView(List<Integer> organIds);
    
    List<IndexCloudStudyListDto> getCloudStudyStudentOverViewList(List<Integer> organIds);

    /**
     * @describe 清理学员云教练连续使用天数
     * @author Joburgess
     * @date 2021/8/17 0017
     * @param :
     * @return void
     */
    void cleanStudentCloudStudySequenceDays();

    /**
     * 云教练活动统计
     * @param organIds
     * @param queryInfo
     * @return
     */
    Map<String,Object> countCloudTeacherActive(List<Integer> organIds, CloudTeacherActiveQueryInfo queryInfo);

    /**
     * 云教练活动统计详情
     * @param queryInfo
     * @return
     */
    PageInfo<CloudTeacherActiveTargetDetailDto> countCloudTeacherActiveDetail(CloudTeacherActiveQueryInfo queryInfo);

    /**
    * @description: 根据手机号检测学员是否存在，存在就更新，不存在插入
     * @param student
    * @return com.ym.mec.auth.api.entity.SysUser
    * @author zx
    * @date 2022/1/7 11:02
    */
    <T extends BaseStudentDto> SysUser upSetStudent(T student);

    PageInfo<SysUserDto> queryStudentBasicInfo(UserBasicQueryInfo queryInfo);

    /**
     * 获取和当前指导老师关联的学员
     *
     * @return
     */
    PageInfo<BasicUserDto> queryStudent(QueryInfo queryInfo);

    /**
    * @description: 获取分部学员声部列表
     * @param organIds
    * @return java.util.List<com.ym.mec.biz.dal.entity.Subject>
    * @author zx
    * @date 2022/7/19 15:21
    */
    List<BaseMapDto> queryStuSubjectId(String organIds);
}
