xiaof 4 år sedan
förälder
incheckning
4f470ace8e

+ 169 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/entity/TAExamCourse.java

@@ -106,6 +106,175 @@ public class TAExamCourse implements Serializable {
     @TableField(value = "standard_deviation")
     private BigDecimal standardDeviation;
 
+    @ApiModelProperty(value = "总体卷面平均分")
+    @TableField(value = "paper_avg_score")
+    private BigDecimal paperAvgScore;
+
+    @ApiModelProperty(value = "应届卷面平均分")
+    @TableField(value = "paper_current_avg_score")
+    private BigDecimal paperCurrentAvgScore;
+
+    @ApiModelProperty(value = "总体卷面成绩通过率")
+    @TableField(value = "paper_pass_rate")
+    private BigDecimal paperPassRate;
+
+    @ApiModelProperty(value = "应届卷面成绩通过率")
+    @TableField(value = "paper_current_pass_rate")
+    private BigDecimal paperCurrentPassRate;
+
+    @ApiModelProperty(value = "赋分系数")
+    @TableField(value = "coefficient")
+    private BigDecimal coefficient;
+
+    @ApiModelProperty(value = "开课学院id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    @TableField(value = "teach_college_id")
+    private Long teachCollegeId;
+
+    @ApiModelProperty(value = "开课学院名称")
+    @TableField(value = "teach_college_name")
+    private String teachCollegeName;
+
+    @ApiModelProperty(value = "考察学院数量")
+    @TableField(value = "inspect_college_count")
+    private Integer inspectCollegeCount;
+
+    @ApiModelProperty(value = "应届实际考试人数占比")
+    @TableField(value = "current_reality_rate")
+    private BigDecimal currentRealityRate;
+
+    @ApiModelProperty(value = "应届总考试人数")
+    @TableField(value = "current_total_count")
+    private Integer currentTotalCount;
+
+    @ApiModelProperty(value = "应届实际考试人数")
+    @TableField(value = "current_reality_count")
+    private Integer currentRealityCount;
+
+    @ApiModelProperty(value = "往届实际考试人数占比")
+    @TableField(value = "past_reality_rate")
+    private BigDecimal pastRealityRate;
+
+    @ApiModelProperty(value = "往届总考试人数")
+    @TableField(value = "past_total_count")
+    private Integer pastTotalCount;
+
+    @ApiModelProperty(value = "往届实际考试人数")
+    @TableField(value = "past_reality_count")
+    private Integer pastRealityCount;
+
+    public Long getTeachCollegeId() {
+        return teachCollegeId;
+    }
+
+    public void setTeachCollegeId(Long teachCollegeId) {
+        this.teachCollegeId = teachCollegeId;
+    }
+
+    public String getTeachCollegeName() {
+        return teachCollegeName;
+    }
+
+    public void setTeachCollegeName(String teachCollegeName) {
+        this.teachCollegeName = teachCollegeName;
+    }
+
+    public Integer getInspectCollegeCount() {
+        return inspectCollegeCount;
+    }
+
+    public void setInspectCollegeCount(Integer inspectCollegeCount) {
+        this.inspectCollegeCount = inspectCollegeCount;
+    }
+
+    public BigDecimal getCurrentRealityRate() {
+        return currentRealityRate;
+    }
+
+    public void setCurrentRealityRate(BigDecimal currentRealityRate) {
+        this.currentRealityRate = currentRealityRate;
+    }
+
+    public Integer getCurrentTotalCount() {
+        return currentTotalCount;
+    }
+
+    public void setCurrentTotalCount(Integer currentTotalCount) {
+        this.currentTotalCount = currentTotalCount;
+    }
+
+    public Integer getCurrentRealityCount() {
+        return currentRealityCount;
+    }
+
+    public void setCurrentRealityCount(Integer currentRealityCount) {
+        this.currentRealityCount = currentRealityCount;
+    }
+
+    public BigDecimal getPastRealityRate() {
+        return pastRealityRate;
+    }
+
+    public void setPastRealityRate(BigDecimal pastRealityRate) {
+        this.pastRealityRate = pastRealityRate;
+    }
+
+    public Integer getPastTotalCount() {
+        return pastTotalCount;
+    }
+
+    public void setPastTotalCount(Integer pastTotalCount) {
+        this.pastTotalCount = pastTotalCount;
+    }
+
+    public Integer getPastRealityCount() {
+        return pastRealityCount;
+    }
+
+    public void setPastRealityCount(Integer pastRealityCount) {
+        this.pastRealityCount = pastRealityCount;
+    }
+
+    public BigDecimal getPaperAvgScore() {
+        return paperAvgScore;
+    }
+
+    public void setPaperAvgScore(BigDecimal paperAvgScore) {
+        this.paperAvgScore = paperAvgScore;
+    }
+
+    public BigDecimal getPaperCurrentAvgScore() {
+        return paperCurrentAvgScore;
+    }
+
+    public void setPaperCurrentAvgScore(BigDecimal paperCurrentAvgScore) {
+        this.paperCurrentAvgScore = paperCurrentAvgScore;
+    }
+
+    public BigDecimal getPaperPassRate() {
+        return paperPassRate;
+    }
+
+    public void setPaperPassRate(BigDecimal paperPassRate) {
+        this.paperPassRate = paperPassRate;
+    }
+
+    public BigDecimal getPaperCurrentPassRate() {
+        return paperCurrentPassRate;
+    }
+
+    public void setPaperCurrentPassRate(BigDecimal paperCurrentPassRate) {
+        this.paperCurrentPassRate = paperCurrentPassRate;
+    }
+
+    public BigDecimal getCoefficient() {
+        return coefficient;
+    }
+
+    public void setCoefficient(BigDecimal coefficient) {
+        this.coefficient = coefficient;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

+ 16 - 3
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseMapper.java

@@ -2,13 +2,10 @@ package com.qmth.teachcloud.report.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.google.common.primitives.Longs;
 import com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourse;
-import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -32,5 +29,21 @@ public interface TAExamCourseMapper extends BaseMapper<TAExamCourse> {
      */
     IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, @Param("examId") Long examId, @Param("semester") String semester, @Param("schoolId") Long schoolId);
 
+
     TAExamCourse getOverview(@Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("courseCode") String courseCode);
+
+    /**
+     * 赋分管理列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param courseCode
+     * @param publishStatus
+     * @return
+     */
+    IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, @Param("schoolId") Long schoolId, @Param("examId") Long examId,
+                                                 @Param("courseCode") String courseCode,
+                                                 @Param("publishStatus") String publishStatus);
+
 }

+ 15 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourse;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 
 import java.util.List;
@@ -30,5 +31,19 @@ public interface TAExamCourseService extends IService<TAExamCourse> {
      */
     IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, Long examId, SemesterEnum semester, Long schoolId);
 
+
     TAExamCourse getOverview(String semester, Long examId, String courseCode);
+
+    /**
+     * 赋分管理列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param courseCode
+     * @param publishStatus
+     * @return
+     */
+    IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus);
+
 }

+ 16 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourse;
+import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import com.qmth.teachcloud.report.business.mapper.TAExamCourseMapper;
 import com.qmth.teachcloud.report.business.service.TAExamCourseService;
@@ -42,9 +43,24 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         return taExamCourseMapper.surveyTeacherList(iPage, examId, semester.name(), schoolId);
     }
 
+
     @Override
     public TAExamCourse getOverview(String semester, Long examId, String courseCode) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         return taExamCourseMapper.getOverview(schoolId, semester, examId, courseCode);
     }
+    /**
+     * 赋分管理列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param courseCode
+     * @param publishStatus
+     * @return
+     */
+    @Override
+    public IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus) {
+        return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, publishStatus.name());
+    }
 }

+ 5 - 0
teachcloud-report-business/src/main/resources/db/init-table.sql

@@ -762,6 +762,11 @@ CREATE TABLE `t_a_exam_course` (
   `current_mode` varchar(64) DEFAULT NULL COMMENT '众数',
   `current_standard_deviation` decimal(12,4) DEFAULT NULL COMMENT '标准差',
   `difficulty` varchar(16) DEFAULT NULL COMMENT '本次科目难度(应届)',
+  `paper_avg_score` decimal(12,4) DEFAULT NULL COMMENT '总体卷面平均分',
+  `paper_current_avg_score` decimal(12,4) DEFAULT NULL COMMENT '应届卷面平均分',
+  `paper_pass_rate` decimal(12,4) DEFAULT NULL COMMENT '总体卷面成绩通过率',
+  `paper_current_pass_rate` decimal(12,4) DEFAULT NULL COMMENT '应届卷面成绩通过率',
+  `coefficient` decimal(12,4) DEFAULT NULL COMMENT '赋分系数',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='考试课程维度分析表';
 /*!40101 SET character_set_client = @saved_cs_client */;

+ 51 - 10
teachcloud-report-business/src/main/resources/mapper/TAExamCourseMapper.xml

@@ -2,7 +2,7 @@
 <!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.TAExamCourseMapper">
 
-    <select id="surveyTeacherList" resultType="com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult">
+    <sql id="commonHead">
         select
             taec.id,
             taec.course_code as courseCode,
@@ -18,23 +18,61 @@
             taec.past_total_count as pastTotalCount,
             taec.past_reality_count as pastRealityCount,
             taec.absent_count as absentCount,
-            taec.avg_score as avgScoreBefore,
-            (1 - taec.pass_rate) as notPassRateBefore,
-            taec.current_avg_score as currentAvgScoreBefore,
-            (1 - taec.current_pass_rate) as currentNotPassRateBefore
+            taec.paper_avg_score as avgScoreBefore,
+            (1 - taec.paper_pass_rate) as notPassRateBefore,
+            taec.paper_current_avg_score as currentAvgScoreBefore,
+            (1 - taec.paper_current_pass_rate) as currentNotPassRateBefore,
+            taec.avg_score as avgScoreAfter,
+            (1 - taec.pass_rate) as notPassRateAfter,
+            taec.current_avg_score as currentAvgScoreAfter,
+            (1 - taec.current_pass_rate) as currentNotPassRateAfter,
+            taec.coefficient
+    </sql>
+
+    <sql id="commonCondition">
+        <if test="schoolId != null and schoolId != ''">
+            and taec.school_id = #{schoolId}
+        </if>
+        <if test="examId != null and examId != ''">
+            and taec.exam_id = #{examId}
+        </if>
+    </sql>
+
+    <sql id="commonMiddle">
         from t_a_exam_course taec
-        join t_b_exam tbe
+            join t_b_exam tbe
         on tbe.id = taec.exam_id
+    </sql>
+
+    <select id="surveyTeacherList" resultType="com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult">
+        <include refid="commonHead" />
+        <include refid="commonMiddle" />
         <where>
-            <if test="schoolId != null and schoolId != ''">
-                and taec.school_id = #{schoolId}
+            <include refid="commonCondition" />
+            <if test="semester != null and semester != ''">
+                and tbe.semester = #{semester}
             </if>
-            <if test="examId != null and examId != ''">
-                and taec.exam_id = #{examId}
+        </where>
+    </select>
+
+    <select id="surveyAspointsList" resultType="com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult">
+        <include refid="commonHead" />
+        ,tbec.publish_status as status
+        <include refid="commonMiddle" />
+        join t_b_exam_course tbec
+        on tbec.course_code = taec.course_code and tbec.exam_id = taec.exam_id
+        and tbec.school_id = taec.school_id
+        <where>
+            <include refid="commonCondition" />
+            <if test="courseCode != null and courseCode != ''">
+                and taec.course_code = #{courseCode}
             </if>
             <if test="semester != null and semester != ''">
                 and tbe.semester = #{semester}
             </if>
+            <if test="publishStatus != null and publishStatus != ''">
+                and tbec.publish_status = #{publishStatus}
+            </if>
         </where>
     </select>
     <select id="getOverview" resultType="com.qmth.teachcloud.report.business.entity.TAExamCourse">
@@ -60,6 +98,9 @@
             <if test="examId != null">
                 and a.exam_id = #{examId}
             </if>
+            <if test="courseCode != null and courseCode != ''">
+                and a.course_code = #{courseCode}
+            </if>
         </where>
     </select>
 </mapper>

+ 4 - 4
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -5,6 +5,7 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourse;
 import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
@@ -27,7 +28,7 @@ public class CourseController {
 
     @ApiOperation(value = "开课课程考试总览列表接口")
     @RequestMapping(value = "/survey_teacher/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourse.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourseResult.class)})
     public Result surveyTeacherList(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
                                     @ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
                                     @ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
@@ -38,14 +39,13 @@ public class CourseController {
 
     @ApiOperation(value = "赋分管理列表接口")
     @RequestMapping(value = "/survey_aspoints/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourse.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourseResult.class)})
     public Result surveyAspointsList(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
                                      @ApiParam(value = "考试id", required = true) @RequestParam String examId,
-                                     @ApiParam(value = "学院id", required = true) @RequestParam String collegeId,
                                      @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
                                      @ApiParam(value = "发布状态", required = false) @RequestParam(required = false) PublishStatusEnum publishStatus,
                                      @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                                      @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        return ResultUtil.ok();
+        return ResultUtil.ok(taExamCourseService.surveyAspointsList(new Page<>(pageNumber, pageSize), SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, publishStatus));
     }
 }