package com.xhkjedu.smarking.controller.report;

import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
import com.xhkjedu.smarking.service.report.report.MsrStudentService;
import com.xhkjedu.smarking.service.report.report.MsrSubjectService;
import com.xhkjedu.smarking.vo.report.reportstu.StudentParams;
import com.xhkjedu.utils.N_Utils;
import com.xhkjedu.vo.ResultVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 *@Description 校级报告
 *@Author ywx
 *Date 2025/1/10 14:31
 **/
@RestController
@RequestMapping("/rxj")
public class XjReportController {
    @Resource
    private MsrSubjectService msrSubjectService;
    @Resource
    private MsrStudentService msrStudentService;

    /**
     * @Description 总体情况汇总分析-总分基本情况成绩分析
     * @Date 2025/1/10 14:54
     * @Author YWX
     * @Param [subject]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/hz_zf")
    public ResultVo getExamForHzZf(@RequestBody MsrSubject subject) {
        Integer examid = subject.getExamid();
        N_Utils.validation(new Object[]{examid, "考试id", 1});
        return new ResultVo(0, "获取成功", msrSubjectService.getExamForHzZf(examid));
    }

    /**
     * @Description 总体情况汇总分析-各学科基本数据对比情况
     * @Date 2025/1/10 15:04
     * @Author YWX
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/hz_xk")
    public ResultVo listSubjectForHzXk(@RequestBody StudentParams params) {
        N_Utils.validation(new Object[]{params.getExamid(), "考试id", 1});
        return new ResultVo(0, "获取成功", msrSubjectService.listSubjectForHzXk(params));
    }

    /**
     * @Description 总分分布
     * @Date 2025/1/10 17:28
     * @Author YWX
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/zffb")
    public ResultVo listScoreForZfFb(@RequestBody StudentParams params) {
        N_Utils.validation(new Object[]{params.getExamid(), "考试id", 1});
        return new ResultVo(0, "获取成功", msrStudentService.listScoreForZfFb(params));
    }

}
