package com.ssj.service.sys.situation.service;


import com.ssj.bean.sys.knowledge.domain.KnowDimension;
import com.ssj.bean.sys.situation.domain.LearningSituation;
import com.ssj.framework.core.common.service.BaseService;
import com.ssj.framework.core.security.exception.CommonException;
import com.ssj.framework.core.util.ResponseEntity;
import com.ssj.service.conch.parents.dto.HomeworkAccuracyRateDto;
import com.ssj.service.conch.parents.dto.LearningSituationDetail2Dto;
import com.ssj.service.conch.parents.dto.LearningSituationDetailDto;
import com.ssj.service.conch.parents.dto.LearningSituationDetailNewDto;
import com.ssj.service.conch.teacher.request.teacherorg.SubjectLearningSituationReq;

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

public interface LearningSituationService extends BaseService<LearningSituation, String> {
    /**
     * 查询所有在service表中有记录的学生，用于定时任务计算学情数据
     * @return
     */
    List<String> getServiceStudentIds();
    


    /**
     * 查询学生的学情数据, 全部学生的学情数据
     * @param studentId
     * @return
     */
    List<LearningSituation> getLearningSituation(String studentId);

    /**
     * 查询学生的学情数据, 全部学生的学情数据
     * @param courseName
     * @param studentId
     * @return
     */
    List<LearningSituation> getLearningSituation(String courseName, String studentId);


    /**
     * 学情
     * @param vipId
     * @param subject
     * @return
     */
    LearningSituationDetailDto learningSituationDetail(String vipId, String subject);

    /**
     * 学情
     * @param vipId
     * @param subject
     * @return
     */
    LearningSituationDetail2Dto learningSituationDetail2(String vipId, String subject);

    /**
     * 查询学生时间区间内作业日统计数据，用于计算每天正确率
     * @param vipId 学生id
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @return 统计数据列表
     */
    List<HomeworkAccuracyRateDto> getHomeworkAccuracyRateList(String vipId, Date beginTime, Date endTime);

    /**
     * 查询学生的学情维度
     * @param subject
     * @param vipId
     * @param type
     * @param semester
     * @param grade
     * @return
     */
    List<LearningSituation> findByCourseNameAndStudentIdAndType(String subject, String vipId, Integer type, Integer semester, String grade);

    /**
     * 查询维度
     * @param subject
     * @param type
     * @return
     */
    Map<String, String> getDimension(String subject, int type);

    /**
     * 查询未掌握的知识点
     * @param subject
     * @param vipId
     * @return
     */
    List<Map<String, Object>> getNoKnowledgePoint(String subject, String vipId);

    /**
     * 查询学情各维度
     * @return
     */
    List<KnowDimension> findKnowDimesion();

    /**
     * 查询知识维度
     * @return
     */
    List<Map<String, Object>> findKnowledgeDimesion();


    /**
     * 查询作业各知识维度数量
     * @param vipId 学生id, id为空查询所有人的错题
     * @param subject 科目
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @param type 类型，1错题
     * @return
     */
    List<Map<String, Object>> getHomeworkKnowModuleData(String vipId, String subject, String beginTime, String endTime, int type);


    /**
     * 查询作业理解、记忆、应用类数量
     * @param vipId 学生id
     * @param subject 科目
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @param type 类型，1错题，2全部
     * @return
     */
    List<Map<String, Object>> getHomeworkKnowClassData(String vipId, String subject, String beginTime, String endTime, int type);

    /**
     * 查询学生的错题一对一技能维度
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @return
     */
    List<String> get121SkillWrongData(String vipId, String subject, String beginTime, String endTime);

    /**
     * 查询学生一对一技能维度
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @return
     */
    List<String> get121SkillData(String vipId, String subject, String beginTime, String endTime);

    /**
     * 查询一对一学生的错题知识维度数量
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @return
     */
    List<Map<String, Object>> get121WrongKnowModuleData(String vipId, String subject, String beginTime, String endTime);

    /**
     * 查询一对一知识维度总量
     * @param vipId
     * @param subject
     * @param beginTIme
     * @param endTime
     * @return
     */
    List<Map<String, Object>> get121KnowModuleData(String vipId, String subject, String beginTIme, String endTime);

    /**
     * 清空表数据
     */
    void truncateTable();

    /**
     * 查询手动勾选的知识点的各维度数量
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @param type
     * @return
     */
    List<Map<String, Object>> getHomeworkKnowHowModuleData(String vipId, String subject, String beginTime, String endTime, int type);

    /**
     * 查询手动勾选知识点各分类知识点错题数量
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @return
     */
    List<Map<String, Object>> getHomeworkWrongKnowHowClassData(String vipId, String subject, String beginTime, String endTime);

    /**
     * 查询手动勾选知识点各分类知识点全部数量
     * @param vipId
     * @param subject
     * @param beginTime
     * @param endTime
     * @return
     */
    List<Map<String, Object>> getHomeworkAllKnowHowClassData(String vipId, String subject, String beginTime, String endTime);

    LearningSituationDetailNewDto learningSituationDetailNew(SubjectLearningSituationReq req) throws CommonException;

	List<Map<String, Object>> getNoKnowledgePointDemo(String subject, String vipId, String dimension, String grade);

    ResponseEntity learningSituationHistory(String vipId, String subject) throws Exception;
}
