浏览代码

加入开课课程考试总览-列表接口

wangliang 4 年之前
父节点
当前提交
78d2f7a405

+ 107 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TAExamCourseResult.java

@@ -0,0 +1,107 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.qmth.teachcloud.report.business.entity.TAExamCourse;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: TAExamCourseResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/8
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TAExamCourseResult extends TAExamCourse implements Serializable {
+
+    @ApiModelProperty(value = "全体平均分-赋分前")
+    private BigDecimal avgScoreBefore;
+
+    @ApiModelProperty(value = "全体不及格率-赋分前")
+    private BigDecimal notPassRateBefore;
+
+    @ApiModelProperty(value = "应届平均分-赋分前")
+    private BigDecimal currentAvgScoreBefore;
+
+    @ApiModelProperty(value = "应届不及格率-赋分前")
+    private BigDecimal currentNotPassRateBefore;
+
+    @ApiModelProperty(value = "全体平均分-赋分后")
+    private BigDecimal avgScoreAfter;
+
+    @ApiModelProperty(value = "全体不及格率-赋分后")
+    private BigDecimal notPassRateAfter;
+
+    @ApiModelProperty(value = "应届平均分-赋分后")
+    private BigDecimal currentAvgScoreAfter;
+
+    @ApiModelProperty(value = "应届不及格率-赋分后")
+    private BigDecimal currentNotPassRateAfter;
+
+    public BigDecimal getAvgScoreBefore() {
+        return avgScoreBefore;
+    }
+
+    public void setAvgScoreBefore(BigDecimal avgScoreBefore) {
+        this.avgScoreBefore = avgScoreBefore;
+    }
+
+    public BigDecimal getNotPassRateBefore() {
+        return notPassRateBefore;
+    }
+
+    public void setNotPassRateBefore(BigDecimal notPassRateBefore) {
+        this.notPassRateBefore = notPassRateBefore;
+    }
+
+    public BigDecimal getCurrentAvgScoreBefore() {
+        return currentAvgScoreBefore;
+    }
+
+    public void setCurrentAvgScoreBefore(BigDecimal currentAvgScoreBefore) {
+        this.currentAvgScoreBefore = currentAvgScoreBefore;
+    }
+
+    public BigDecimal getCurrentNotPassRateBefore() {
+        return currentNotPassRateBefore;
+    }
+
+    public void setCurrentNotPassRateBefore(BigDecimal currentNotPassRateBefore) {
+        this.currentNotPassRateBefore = currentNotPassRateBefore;
+    }
+
+    public BigDecimal getAvgScoreAfter() {
+        return avgScoreAfter;
+    }
+
+    public void setAvgScoreAfter(BigDecimal avgScoreAfter) {
+        this.avgScoreAfter = avgScoreAfter;
+    }
+
+    public BigDecimal getNotPassRateAfter() {
+        return notPassRateAfter;
+    }
+
+    public void setNotPassRateAfter(BigDecimal notPassRateAfter) {
+        this.notPassRateAfter = notPassRateAfter;
+    }
+
+    public BigDecimal getCurrentAvgScoreAfter() {
+        return currentAvgScoreAfter;
+    }
+
+    public void setCurrentAvgScoreAfter(BigDecimal currentAvgScoreAfter) {
+        this.currentAvgScoreAfter = currentAvgScoreAfter;
+    }
+
+    public BigDecimal getCurrentNotPassRateAfter() {
+        return currentNotPassRateAfter;
+    }
+
+    public void setCurrentNotPassRateAfter(BigDecimal currentNotPassRateAfter) {
+        this.currentNotPassRateAfter = currentNotPassRateAfter;
+    }
+}

+ 1 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TBExamResult.java

@@ -9,7 +9,7 @@ import java.io.Serializable;
 import java.util.Objects;
 
 /**
- * @Description:
+ * @Description: TBExamResult
  * @Param:
  * @return:
  * @Author: wangliang

+ 1 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TBExamStudentResult.java

@@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
 
 /**
- * @Description:
+ * @Description: TBExamStudentResult
  * @Param:
  * @return:
  * @Author: wangliang

+ 15 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseMapper.java

@@ -1,7 +1,13 @@
 package com.qmth.teachcloud.report.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+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;
 
 /**
  * <p>
@@ -13,4 +19,13 @@ import com.qmth.teachcloud.report.business.entity.TAExamCourse;
  */
 public interface TAExamCourseMapper extends BaseMapper<TAExamCourse> {
 
+    /**
+     * 开课课程考试总览列表接口
+     *
+     * @param examId
+     * @param semester
+     * @param schoolId
+     * @return
+     */
+    List<TAExamCourseResult> surveyTeacherList(@Param("examId") Long examId, @Param("semester") String semester, @Param("schoolId") Long schoolId);
 }

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

@@ -1,7 +1,11 @@
 package com.qmth.teachcloud.report.business.service;
 
 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.SemesterEnum;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,13 @@ import com.qmth.teachcloud.report.business.entity.TAExamCourse;
  */
 public interface TAExamCourseService extends IService<TAExamCourse> {
 
+    /**
+     * 开课课程考试总览列表接口
+     *
+     * @param examId
+     * @param semester
+     * @param schoolId
+     * @return
+     */
+    List<TAExamCourseResult> surveyTeacherList(Long examId, SemesterEnum semester, Long schoolId);
 }

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

@@ -1,11 +1,16 @@
 package com.qmth.teachcloud.report.business.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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 com.qmth.teachcloud.report.business.mapper.TAExamCourseMapper;
 import com.qmth.teachcloud.report.business.service.TAExamCourseService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.List;
+
 /**
  * <p>
  * 考试课程维度分析表 服务实现类
@@ -17,4 +22,19 @@ import org.springframework.stereotype.Service;
 @Service
 public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAExamCourse> implements TAExamCourseService {
 
+    @Resource
+    TAExamCourseMapper taExamCourseMapper;
+
+    /**
+     * 开课课程考试总览列表接口
+     *
+     * @param examId
+     * @param semester
+     * @param schoolId
+     * @return
+     */
+    @Override
+    public List<TAExamCourseResult> surveyTeacherList(Long examId, SemesterEnum semester, Long schoolId) {
+        return taExamCourseMapper.surveyTeacherList(examId, semester.name(), schoolId);
+    }
 }

+ 34 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseMapper.xml

@@ -2,4 +2,38 @@
 <!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">
+        select
+            taec.course_code as courseCode,
+            taec.course_name as courseName,
+            taec.teach_college_id as teachCollegeId,
+            taec.teach_college_name as teachCollegeName,
+            taec.inspect_college_count as inspectCollegeCount,
+            taec.reality_count as realityCount ,
+            taec.current_reality_rate as currentRealityRate,
+            taec.current_total_count as currentTotalCount,
+            taec.current_reality_count as currentRealityCount,
+            taec.past_reality_rate as pastRealityRate,
+            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
+        from t_a_exam_course taec
+        join t_b_exam tbe
+        on tbe.id = taec.exam_id
+        <where>
+            <if test="schoolId != null and schoolId != ''">
+                and taec.school_id = #{schoolId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and taec.exam_id = #{examId}
+            </if>
+            <if test="semester != null and semester != ''">
+                and tbe.semester = #{courseCode}
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -1,27 +1,34 @@
 package com.qmth.teachcloud.report.api;
 
 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.TBExamStudentResult;
+import com.qmth.teachcloud.report.business.entity.TAExamCourse;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
+import com.qmth.teachcloud.report.business.service.TAExamCourseService;
 import io.swagger.annotations.*;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+
 @Api(tags = "课程Controller")
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.reportCourse}")
 public class CourseController {
 
+    @Resource
+    TAExamCourseService taExamCourseService;
+
     @ApiOperation(value = "开课课程考试总览列表接口")
     @RequestMapping(value = "/survey_teacher/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TAExamCourse.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) {
-        return ResultUtil.ok();
+        return ResultUtil.ok(taExamCourseService.surveyTeacherList(SystemConstant.convertIdToLong(examId), semester, SystemConstant.convertIdToLong(schoolId)));
     }
 }