package com.qmth.teachcloud.report.business.service;

import com.qmth.teachcloud.common.entity.BasicAttachment;
import com.qmth.teachcloud.common.entity.TBSession;
import com.qmth.teachcloud.common.enums.UploadFileEnum;
import com.qmth.teachcloud.report.business.bean.result.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @Description: 教研公共服务
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/4
 */
public interface ReportCommonService {

    /**
     * 学院学科报表查询科目信息
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @return
     */
    CourseInfoResult findCourseInfo(Long examId, String courseCode, Long collegeId);

    /**
     * 学院学科报表科目描述
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @return
     */
    CollegeAndSchoolGradeDistributionResult findCourseDistribution(Long examId, String courseCode, Long collegeId);

    /**
     * 开课学院分数段
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @param filter
     * @return
     */
    List<SurveyTeacherGradeDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, Long collegeId, boolean filter);

    /**
     * 学院学科报表查询维度
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @param teacherId
     * @return
     */
    DimensionAnalyzeResult findDimensionInfo(Long examId, String courseCode, Long collegeId, Long teacherId);

    /**
     * 查找题目相关
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @param teacherId
     * @return
     */
    QuestionInfoResult findSituationOfQuestions(Long examId, String courseCode, Long collegeId, Long teacherId);

    /**
     * 查找老师信息
     *
     * @param examId
     * @param courseCode
     * @param collegeId
     * @return
     */
    TeacherInfoListResult findTeacherInfo(Long examId, String courseCode, Long collegeId);

    /**
     * 根据参数查找题目信息
     *
     * @param examId           考试id
     * @param courseCode       课程编号
     * @param teachCollegeId   开课学院id
     * @param inspectCollegeId 考察学院id
     * @param teacherId        授课教师id
     * @return 结果
     */
    QuestionListResult findQuestionInfo(Long examId, String courseCode, Long teachCollegeId, Long inspectCollegeId, Long teacherId);

    /**
     * 取总体平均分
     *
     * @param schoolId
     * @param courseCode
     * @param examId
     * @param filter
     * @return
     */
    SurveyTeacherExamCourseResult findAvgScore(Long schoolId, String courseCode, Long examId, boolean filter);

    /**
     * 武汉大学退出
     */
    public void whuLogout() throws IOException;

    /**
     * 第三方退出
     *
     * @param tbSession
     */
    public void thirdLogout(TBSession tbSession) throws IOException;

    /**
     * 获取开课课程考试课程总览
     *
     * @param semesterId
     * @param examId
     * @param courseCode
     * @return
     */
    TeachCourseSurveyResult getTeachCourseSurveyInfo(Long semesterId, Long examId, String courseCode);

    /**
     * 保存附件
     *
     * @param file file
     * @param md5  md5
     * @param type type
     * @return 返回
     */
    public BasicAttachment saveAttachment(MultipartFile file, String md5, UploadFileEnum type);

    /**
     * 保存附件公用
     *
     * @param file  file
     * @param md5   md5
     * @param type  type
     * @param objId objId
     * @return 结果
     */
    public BasicAttachment saveAttachmentCommon(MultipartFile file, String md5, UploadFileEnum type, Long objId);
}
