package com.qmth.distributed.print.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.deepoove.poi.data.TableRenderData;
import com.qmth.distributed.print.business.bean.dto.CourseWeightDto;
import com.qmth.distributed.print.business.bean.dto.report.CourseTargetWordDto;
import com.qmth.distributed.print.business.bean.dto.report.ReportCourseEvaluationResultDto;
import com.qmth.distributed.print.business.bean.dto.report.ReportScoreViewDto;
import com.qmth.distributed.print.business.bean.result.CourseWeightResult;
import com.qmth.distributed.print.business.bean.result.report.PaperStructDimensionResult;
import com.qmth.distributed.print.business.bean.result.report.word.CourseReportBean;
import com.qmth.distributed.print.business.entity.TRBasicInfo;
import com.qmth.teachcloud.mark.entity.MarkPaper;

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

/**
 * <p>
 * 报告基本情况表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2024-02-18
 */
public interface TRBasicInfoService extends IService<TRBasicInfo> {

    /**
     * 根据考试id/课程编码/试卷编码查询数据库数据
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public TRBasicInfo queryBasicInfo(Long examId, String courseCode, String paperNumber, Long teachCourseId);

    /**
     * 获取课程目标考核分布-分数图
     *
     * @param trBasicInfo
     * @param markPaper
     * @return
     */
    public ReportScoreViewDto getScoreList(TRBasicInfo trBasicInfo, MarkPaper markPaper);

    /**
     * 获取计算参数
     *
     * @param trBasicInfo
     * @param paperStructDimensionResultList
     * @param courseWeightResult
     * @return
     */
    public Map<String, Object> getReportCalculateParams(TRBasicInfo trBasicInfo, List<PaperStructDimensionResult> paperStructDimensionResultList, CourseWeightResult courseWeightResult);

    /**
     * 计算课程考核成绩评价结果
     *
     * @param trBasicInfo
     * @param paramsMap
     * @return
     */
    public ReportCourseEvaluationResultDto reportCalculateCourseEvaluationResult(TRBasicInfo trBasicInfo, Map<String, Object> paramsMap);

    /**
     * 获取报告
     *
     * @param trBasicInfo
     * @param markPaper
     * @param userId
     * @param courseWeightResult
     * @param teachCourseId
     * @return
     */
    public TRBasicInfo getReportView(TRBasicInfo trBasicInfo, MarkPaper markPaper, Long userId, CourseWeightResult courseWeightResult, Long teachCourseId);

    /**
     * 构建word动态表格1-课程目标与毕业要求指标点的对应关系
     *
     * @param courseTargetWordDtoList
     * @return
     */
    public TableRenderData buildWordTable1(List<CourseTargetWordDto> courseTargetWordDtoList);

    /**
     * 构建word动态表格2-课程目标达成考核/评价环节及目标分值
     *
     * @param courseTargetWordDtoList
     * @return
     */
    public TableRenderData buildWordTable2(List<CourseTargetWordDto> courseTargetWordDtoList);

    /**
     * 构建word动态表格3-课后作业的具体考核内容、目标分值及对应的课程目标
     *
     * @param courseTargetWordDtoList
     * @return
     */
    public TableRenderData buildWordTable3(List<CourseTargetWordDto> courseTargetWordDtoList);

    /**
     * 构建word动态表格4-期末考试的具体考核内容、目标分值及对应的课程目标
     *
     * @param courseTargetWordDtoList
     * @return
     */
    public TableRenderData buildWordTable4(List<CourseTargetWordDto> courseTargetWordDtoList);

    /**
     * 构建word动态表格5-各课程目标考核样本数据详情
     *
     * @param trBasicInfo
     * @param courseReportBean
     * @return
     */
    public TableRenderData buildWordTable5(TRBasicInfo trBasicInfo, CourseReportBean courseReportBean);

    /**
     * 根据考试id/课程编码/试卷编码删除数据
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public Boolean remove(Long examId, String courseCode, String paperNumber, Long teachCourseId);

    /**
     * 查找课程评价值
     *
     * @param teachCourseId
     * @return
     */
    public CourseWeightResult findCourseWeightResultRmi(Long teachCourseId);

    /**
     * 查找课程评价值
     *
     * @param teachCourseId
     * @return
     */
    public List<CourseWeightDto> findCourseWeightDtoRmi(Long teachCourseId);

    /**
     * 清除报告数据
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @param clearDimension
     */
    public void clearReportData(Long examId, String courseCode, String paperNumber, Long teachCourseId, boolean clearDimension);
}
