Selaa lähdekoodia

考察院长看板

caozixuan 4 vuotta sitten
vanhempi
commit
acbe819c42

+ 222 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/CollegeCourseInfo.java

@@ -0,0 +1,222 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: 考察学院-课程数据
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class CollegeCourseInfo implements Serializable {
+
+    @ApiModelProperty(value = "学校众数")
+    private String schMode;
+
+    private BigDecimal colLowerQuartile;
+
+    @ApiModelProperty(value = "学院标准差")
+    private BigDecimal colStandardDeviation;
+
+    private String courseCode;
+
+    private BigDecimal colMinScore;
+
+    private BigDecimal schAvgScore;
+
+    private BigDecimal schLowerQuartile;
+
+    private BigDecimal colMaxScore;
+
+    @ApiModelProperty(value = "学院众数")
+    private String colMode;
+
+    private BigDecimal schMaxScore;
+
+    private BigDecimal colRealityCount;
+
+    @ApiModelProperty(value = "学校标准差")
+    private BigDecimal schStandardDeviation;
+
+    @ApiModelProperty(value = "课程名称")
+    private String courseName;
+
+    private BigDecimal schMinScore;
+
+    private BigDecimal colAvgScore;
+
+    @ApiModelProperty(value = "学院上四分位数")
+    private BigDecimal colUpperQuartile;
+
+    private BigDecimal colMedian;
+
+    @ApiModelProperty(value = "学院相对位置")
+    private BigDecimal colRelativePosition;
+
+    @ApiModelProperty(value = "学校上四分位数")
+    private BigDecimal schUpperQuartile;
+
+    private String schMedian;
+
+    public String getSchMode() {
+        return schMode;
+    }
+
+    public void setSchMode(String schMode) {
+        this.schMode = schMode;
+    }
+
+    public BigDecimal getColLowerQuartile() {
+        return colLowerQuartile;
+    }
+
+    public void setColLowerQuartile(BigDecimal colLowerQuartile) {
+        this.colLowerQuartile = colLowerQuartile;
+    }
+
+    public BigDecimal getColStandardDeviation() {
+        return colStandardDeviation;
+    }
+
+    public void setColStandardDeviation(BigDecimal colStandardDeviation) {
+        this.colStandardDeviation = colStandardDeviation;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public BigDecimal getColMinScore() {
+        return colMinScore;
+    }
+
+    public void setColMinScore(BigDecimal colMinScore) {
+        this.colMinScore = colMinScore;
+    }
+
+    public BigDecimal getSchAvgScore() {
+        return schAvgScore;
+    }
+
+    public void setSchAvgScore(BigDecimal schAvgScore) {
+        this.schAvgScore = schAvgScore;
+    }
+
+    public BigDecimal getSchLowerQuartile() {
+        return schLowerQuartile;
+    }
+
+    public void setSchLowerQuartile(BigDecimal schLowerQuartile) {
+        this.schLowerQuartile = schLowerQuartile;
+    }
+
+    public BigDecimal getColMaxScore() {
+        return colMaxScore;
+    }
+
+    public void setColMaxScore(BigDecimal colMaxScore) {
+        this.colMaxScore = colMaxScore;
+    }
+
+    public String getColMode() {
+        return colMode;
+    }
+
+    public void setColMode(String colMode) {
+        this.colMode = colMode;
+    }
+
+    public BigDecimal getSchMaxScore() {
+        return schMaxScore;
+    }
+
+    public void setSchMaxScore(BigDecimal schMaxScore) {
+        this.schMaxScore = schMaxScore;
+    }
+
+    public BigDecimal getColRealityCount() {
+        return colRealityCount;
+    }
+
+    public void setColRealityCount(BigDecimal colRealityCount) {
+        this.colRealityCount = colRealityCount;
+    }
+
+    public BigDecimal getSchStandardDeviation() {
+        return schStandardDeviation;
+    }
+
+    public void setSchStandardDeviation(BigDecimal schStandardDeviation) {
+        this.schStandardDeviation = schStandardDeviation;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public BigDecimal getSchMinScore() {
+        return schMinScore;
+    }
+
+    public void setSchMinScore(BigDecimal schMinScore) {
+        this.schMinScore = schMinScore;
+    }
+
+    public BigDecimal getColAvgScore() {
+        return colAvgScore;
+    }
+
+    public void setColAvgScore(BigDecimal colAvgScore) {
+        this.colAvgScore = colAvgScore;
+    }
+
+    public BigDecimal getColUpperQuartile() {
+        return colUpperQuartile;
+    }
+
+    public void setColUpperQuartile(BigDecimal colUpperQuartile) {
+        this.colUpperQuartile = colUpperQuartile;
+    }
+
+    public BigDecimal getColMedian() {
+        return colMedian;
+    }
+
+    public void setColMedian(BigDecimal colMedian) {
+        this.colMedian = colMedian;
+    }
+
+    public BigDecimal getColRelativePosition() {
+        return colRelativePosition;
+    }
+
+    public void setColRelativePosition(BigDecimal colRelativePosition) {
+        this.colRelativePosition = colRelativePosition;
+    }
+
+    public BigDecimal getSchUpperQuartile() {
+        return schUpperQuartile;
+    }
+
+    public void setSchUpperQuartile(BigDecimal schUpperQuartile) {
+        this.schUpperQuartile = schUpperQuartile;
+    }
+
+    public String getSchMedian() {
+        return schMedian;
+    }
+
+    public void setSchMedian(String schMedian) {
+        this.schMedian = schMedian;
+    }
+}

+ 36 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/CollegeInfo.java

@@ -0,0 +1,36 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: 学院数据
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class CollegeInfo implements Serializable {
+
+    @ApiModelProperty(value = "学院课程数据集合")
+    private List<CollegeCourseInfo> collegeCourseInfoList;
+
+    @ApiModelProperty(value = "低于平均分的数据")
+    private LowAvgInfo lowAvgInfo;
+
+    public List<CollegeCourseInfo> getCollegeCourseInfoList() {
+        return collegeCourseInfoList;
+    }
+
+    public void setCollegeCourseInfoList(List<CollegeCourseInfo> collegeCourseInfoList) {
+        this.collegeCourseInfoList = collegeCourseInfoList;
+    }
+
+    public LowAvgInfo getLowAvgInfo() {
+        return lowAvgInfo;
+    }
+
+    public void setLowAvgInfo(LowAvgInfo lowAvgInfo) {
+        this.lowAvgInfo = lowAvgInfo;
+    }
+}

+ 134 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/ExamBaseInfo.java

@@ -0,0 +1,134 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 考试基础信息
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class ExamBaseInfo implements Serializable {
+
+    @ApiModelProperty(value = "考试时间")
+    private String examTime;
+
+    @ApiModelProperty(value = "考察学院总数")
+    private Integer collegeCount;
+
+    @ApiModelProperty(value = "课程总数")
+    private Integer courseCount;
+
+    @ApiModelProperty(value = "公共课总数")
+    private Integer publicCourseCount;
+
+    @ApiModelProperty(value = "专业课总数")
+    private Integer majorCourseCount;
+
+    @ApiModelProperty(value = "总课次")
+    private int totalCourseTimes;
+
+    @ApiModelProperty(value = "实际课次")
+    private int realityCourseTimes;
+
+    @ApiModelProperty(value = "缺考课次")
+    private int absentCourseTimes;
+
+    @ApiModelProperty(value = "总人数")
+    private Integer totalCount;
+
+    @ApiModelProperty(value = "实际参考人数")
+    private Integer realityCount;
+
+    @ApiModelProperty(value = "缺考人数")
+    private Integer absentCount;
+
+    public String getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(String examTime) {
+        this.examTime = examTime;
+    }
+
+    public Integer getCollegeCount() {
+        return collegeCount;
+    }
+
+    public void setCollegeCount(Integer collegeCount) {
+        this.collegeCount = collegeCount;
+    }
+
+    public Integer getCourseCount() {
+        return courseCount;
+    }
+
+    public void setCourseCount(Integer courseCount) {
+        this.courseCount = courseCount;
+    }
+
+    public Integer getPublicCourseCount() {
+        return publicCourseCount;
+    }
+
+    public void setPublicCourseCount(Integer publicCourseCount) {
+        this.publicCourseCount = publicCourseCount;
+    }
+
+    public Integer getMajorCourseCount() {
+        return majorCourseCount;
+    }
+
+    public void setMajorCourseCount(Integer majorCourseCount) {
+        this.majorCourseCount = majorCourseCount;
+    }
+
+    public int getTotalCourseTimes() {
+        return totalCourseTimes;
+    }
+
+    public void setTotalCourseTimes(int totalCourseTimes) {
+        this.totalCourseTimes = totalCourseTimes;
+    }
+
+    public int getRealityCourseTimes() {
+        return realityCourseTimes;
+    }
+
+    public void setRealityCourseTimes(int realityCourseTimes) {
+        this.realityCourseTimes = realityCourseTimes;
+    }
+
+    public int getAbsentCourseTimes() {
+        return absentCourseTimes;
+    }
+
+    public void setAbsentCourseTimes(int absentCourseTimes) {
+        this.absentCourseTimes = absentCourseTimes;
+    }
+
+    public Integer getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(Integer totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    public Integer getRealityCount() {
+        return realityCount;
+    }
+
+    public void setRealityCount(Integer realityCount) {
+        this.realityCount = realityCount;
+    }
+
+    public Integer getAbsentCount() {
+        return absentCount;
+    }
+
+    public void setAbsentCount(Integer absentCount) {
+        this.absentCount = absentCount;
+    }
+}

+ 34 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/InspectCourseTotalReportResult.java

@@ -0,0 +1,34 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 考察课程考试总览报告
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class InspectCourseTotalReportResult implements Serializable {
+
+    @ApiModelProperty(value = "考试基础信息")
+    private ExamBaseInfo examBaseInfo;
+    @ApiModelProperty(value = "该考察学院信息")
+    private CollegeInfo collegeInfo;
+
+    public ExamBaseInfo getExamBaseInfo() {
+        return examBaseInfo;
+    }
+
+    public void setExamBaseInfo(ExamBaseInfo examBaseInfo) {
+        this.examBaseInfo = examBaseInfo;
+    }
+
+    public CollegeInfo getCollegeInfo() {
+        return collegeInfo;
+    }
+
+    public void setCollegeInfo(CollegeInfo collegeInfo) {
+        this.collegeInfo = collegeInfo;
+    }
+}

+ 28 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/LowAvgCourse.java

@@ -0,0 +1,28 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+/**
+ * @Description: 低于平均分的课程信息
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class LowAvgCourse {
+
+    private String courseCode;
+    private String courseName;
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+}

+ 29 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/inspectCourseExamTotal/LowAvgInfo.java

@@ -0,0 +1,29 @@
+package com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal;
+
+import java.util.List;
+
+/**
+ * @Description: 第一平均分的数据
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public class LowAvgInfo {
+    private int lowAvgCount;
+    private List<LowAvgCourse> lowAvgCourseList;
+
+    public int getLowAvgCount() {
+        return lowAvgCount;
+    }
+
+    public void setLowAvgCount(int lowAvgCount) {
+        this.lowAvgCount = lowAvgCount;
+    }
+
+    public List<LowAvgCourse> getLowAvgCourseList() {
+        return lowAvgCourseList;
+    }
+
+    public void setLowAvgCourseList(List<LowAvgCourse> lowAvgCourseList) {
+        this.lowAvgCourseList = lowAvgCourseList;
+    }
+}

+ 20 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/CourseReportMapper.java

@@ -0,0 +1,20 @@
+package com.qmth.teachcloud.report.business.mapper;
+
+import com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.CollegeCourseInfo;
+import com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.ExamBaseInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: CaoZixuan
+ * @Date:
+ */
+public interface CourseReportMapper {
+
+    List<ExamBaseInfo> findExamTotalByExamId(@Param("examId") Long examId);
+
+    List<CollegeCourseInfo> findCollegeCourseInfo(@Param("examId") Long examId,@Param("collegeId") Long collegeId);
+}

+ 14 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/CourseReportService.java

@@ -0,0 +1,14 @@
+package com.qmth.teachcloud.report.business.service;
+
+import com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.InspectCourseTotalReportResult;
+
+/**
+ * @Description: 考察课程考试总览
+ * @Author: CaoZixuan
+ * @Date: 2021-06-10
+ */
+public interface CourseReportService {
+
+    InspectCourseTotalReportResult findInfoInspectCourseExamTotal(Long examId,Long collegeId);
+
+}

+ 64 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/CourseReportServiceImpl.java

@@ -0,0 +1,64 @@
+package com.qmth.teachcloud.report.business.service.impl;
+
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.*;
+import com.qmth.teachcloud.report.business.mapper.CourseReportMapper;
+import com.qmth.teachcloud.report.business.service.CourseReportService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author: CaoZixuan
+ * @Date:
+ */
+@Service
+public class CourseReportServiceImpl implements CourseReportService {
+    @Resource
+    private CourseReportMapper courseReportMapper;
+
+    @Override
+    public InspectCourseTotalReportResult findInfoInspectCourseExamTotal(Long examId, Long collegeId) {
+        // 考试总览数据
+        List<ExamBaseInfo> examBaseInfoList = courseReportMapper.findExamTotalByExamId(examId);
+        if (examBaseInfoList.size() != 1){
+            throw ExceptionResultEnum.ERROR.exception("考试分析数据异常");
+        }
+
+        // 学院下各课程数据和学校对比数据
+        List<CollegeCourseInfo> collegeCourseInfoList = courseReportMapper.findCollegeCourseInfo(examId,collegeId);
+
+        // 低于平均分课程数据源
+        List<CollegeCourseInfo> lowAvgDatasource = collegeCourseInfoList
+                .stream().filter(e -> e.getColRelativePosition().doubleValue() < 0).collect(Collectors.toList());
+
+
+        int lowAvgCount = lowAvgDatasource.size();
+        List<LowAvgCourse> lowAvgCourseList = new ArrayList<>();
+        for (CollegeCourseInfo lowCell : lowAvgDatasource) {
+            String courseName = lowCell.getCourseName();
+            String courseCode = lowCell.getCourseCode();
+            LowAvgCourse lowAvgCourse = new LowAvgCourse();
+            lowAvgCourse.setCourseName(courseName);
+            lowAvgCourse.setCourseCode(courseCode);
+            lowAvgCourseList.add(lowAvgCourse);
+        }
+        LowAvgInfo lowAvgInfo = new LowAvgInfo();// 低于平均分的学科信息
+        lowAvgInfo.setLowAvgCount(lowAvgCount);
+        lowAvgInfo.setLowAvgCourseList(lowAvgCourseList);
+
+        CollegeInfo collegeInfo = new CollegeInfo();
+        collegeInfo.setCollegeCourseInfoList(collegeCourseInfoList);
+        collegeInfo.setLowAvgInfo(lowAvgInfo);
+
+        InspectCourseTotalReportResult inspectCourseTotalReportResult = new InspectCourseTotalReportResult();
+        inspectCourseTotalReportResult.setExamBaseInfo(examBaseInfoList.get(0));
+        inspectCourseTotalReportResult.setCollegeInfo(collegeInfo);
+
+        return inspectCourseTotalReportResult;
+    }
+}

+ 58 - 0
teachcloud-report-business/src/main/resources/mapper/CourseReportMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmth.teachcloud.report.business.mapper.CourseReportMapper">
+
+    <select id="findCollegeCourseInfo"
+            resultType="com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.CollegeCourseInfo">
+        SELECT
+            col.course_code AS courseCode,
+            col.course_name AS courseName,
+            col.reality_count AS colRealityCount,
+            round( col.avg_score, 2 ) AS colAvgScore,
+            round( col.min_score, 2 ) AS colMinScore,
+            round( col.max_score, 2 ) AS colMaxScore,
+            round( col.upper_quartile, 2 ) AS colUpperQuartile,
+            round( col.median, 2 ) AS colMedian,
+            round( col.lower_quartile, 2 ) AS colLowerQuartile,
+            col.mode AS colMode,
+            round( col.standard_deviation, 2 ) AS colStandardDeviation,
+            round( relative_position, 2 ) AS colRelativePosition,
+            round( pap.avg_score, 2 ) AS schAvgScore,
+            round( pap.current_min_score, 2 ) AS schMinScore,
+            round( pap.current_max_score, 2 ) AS schMaxScore,
+            round( pap.current_upper_quartile, 2 ) AS schUpperQuartile,
+            round( pap.current_median, 2 ) AS schMedian,
+            round( pap.current_lower_quartile, 2 ) AS schLowerQuartile,
+            pap.current_mode AS schMode,
+            round( pap.current_standard_deviation, 2 ) AS schStandardDeviation
+        FROM
+            t_a_exam_course_college_inspect col
+                INNER JOIN t_a_exam_course pap ON col.exam_id = pap.exam_id
+                AND col.course_code = pap.course_code
+                AND col.school_id = pap.school_id
+        WHERE
+            col.exam_id = #{examId}
+          AND col.college_id = #{collegeId}
+        ORDER BY
+            col.course_code;
+    </select>
+    <select id="findExamTotalByExamId"
+            resultType="com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.ExamBaseInfo">
+        SELECT
+            college_count AS collegeCount,
+            course_count AS courseCount,
+            public_course_count AS publicCourseCount,
+            major_course_count AS majorCourseCount,
+            total_course_times AS totalCourseTimes,
+            reality_course_times AS realityCourseTimes,
+            absent_course_times AS absentCourseTimes,
+            total_count AS totalCount,
+            reality_count AS realityCount,
+            absent_count AS absentCount,
+            exam_time AS examTime
+        FROM
+            t_a_exam_total
+        WHERE
+            exam_id = #{examId}
+    </select>
+</mapper>

+ 30 - 0
teachcloud-report/src/test/java/com/qmth/teachcloud/report/report/CourseReportTest.java

@@ -0,0 +1,30 @@
+package com.qmth.teachcloud.report.report;
+
+import com.alibaba.fastjson.JSON;
+import com.qmth.teachcloud.report.TeachcloudReportApplication;
+import com.qmth.teachcloud.report.business.service.CourseReportService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description:
+ * @Author: CaoZixuan
+ * @Date:
+ */
+@SpringBootTest(classes = {TeachcloudReportApplication.class})
+@RunWith(SpringRunner.class)
+public class CourseReportTest {
+    @Resource
+    private CourseReportService courseReportService;
+
+    @Test
+    public void inspectTotal(){
+        Long examId = 1L;
+        Long collegeId = 135697788569649152L;
+        System.out.println(JSON.toJSONString(courseReportService.findInfoInspectCourseExamTotal(examId,collegeId)));
+    }
+}