Browse Source

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

wangliang 4 năm trước cách đây
mục cha
commit
81728bb890

+ 14 - 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;
 
 /**
@@ -31,4 +28,18 @@ public interface TAExamCourseMapper extends BaseMapper<TAExamCourse> {
      * @return
      */
     IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, @Param("examId") Long examId, @Param("semester") String semester, @Param("schoolId") Long schoolId);
+
+    /**
+     * 赋分管理列表接口
+     *
+     * @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("courseCode") String publishStatus);
 }

+ 13 - 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;
@@ -29,4 +30,16 @@ public interface TAExamCourseService extends IService<TAExamCourse> {
      * @return
      */
     IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, Long examId, SemesterEnum semester, Long schoolId);
+
+    /**
+     * 赋分管理列表接口
+     *
+     * @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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 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.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;
@@ -40,4 +41,19 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     public IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, Long examId, SemesterEnum semester, Long schoolId) {
         return taExamCourseMapper.surveyTeacherList(iPage, examId, semester.name(), schoolId);
     }
+
+    /**
+     * 赋分管理列表接口
+     *
+     * @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());
+    }
 }

+ 46 - 12
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,57 @@
             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}
-            </if>
-            <if test="examId != null and examId != ''">
-                and taec.exam_id = #{examId}
-            </if>
+            <include refid="commonCondition" />
             <if test="semester != null and semester != ''">
                 and tbe.semester = #{courseCode}
             </if>
         </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" />
+        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="publishStatus != null and publishStatus != ''">
+                and tbec.publish_status = #{publishStatus}
+            </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));
     }
 }