Explorar o código

新增学生个人报告

wangliang %!s(int64=4) %!d(string=hai) anos
pai
achega
0f876dcbfa

+ 119 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TBStudentReportResult.java

@@ -0,0 +1,119 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 学生个人报告result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/9
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TBStudentReportResult implements Serializable {
+
+    @ApiModelProperty(value = "学院名称")
+    private String collegeName;
+
+    @ApiModelProperty(value = "考试编码")
+    private String examCode;
+
+    @ApiModelProperty(value = "科目编码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(value = "学校id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long schoolId;
+
+    @ApiModelProperty(value = "考试名称")
+    private String examName;
+
+    @ApiModelProperty(value = "学生名称")
+    private String studentName;
+
+    @ApiModelProperty(value = "班级名称")
+    private String clazzName;
+
+    @ApiModelProperty(value = "是否缺考")
+    private Boolean absent;
+
+    public String getCollegeName() {
+        return collegeName;
+    }
+
+    public void setCollegeName(String collegeName) {
+        this.collegeName = collegeName;
+    }
+
+    public String getExamCode() {
+        return examCode;
+    }
+
+    public void setExamCode(String examCode) {
+        this.examCode = examCode;
+    }
+
+    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;
+    }
+
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getClazzName() {
+        return clazzName;
+    }
+
+    public void setClazzName(String clazzName) {
+        this.clazzName = clazzName;
+    }
+
+    public Boolean getAbsent() {
+        return absent;
+    }
+
+    public void setAbsent(Boolean absent) {
+        this.absent = absent;
+    }
+}

+ 16 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBExamStudentMapper.java

@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.teachcloud.report.business.bean.result.InspectCollegeResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
+import com.qmth.teachcloud.report.business.bean.result.TBStudentReportResult;
 import com.qmth.teachcloud.report.business.bean.result.TeachCollegeResult;
 import com.qmth.teachcloud.report.business.entity.TBExamStudent;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -96,4 +98,18 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
     IPage<InspectCollegeResult> listInspectCollegeResult(@Param("page") Page<InspectCollegeResult> page, @Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("teachCollegeId") Long teachCollegeId, @Param("teacherId") Long teacherId, @Param("studentParam") String studentParam);
 
     List<InspectCollegeResult> listInspectCollegeResult(@Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("current") Boolean current, @Param("teachCollegeId") Long teachCollegeId, @Param("teacherId") Long teacherId, @Param("studentParam") String studentParam);
+
+    /**
+     * 学生报告预览-列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param collegeId
+     * @param courseCode
+     * @param clazzId
+     * @param absent
+     * @return
+     */
+    IPage<TBStudentReportResult> reportList(IPage<Map> iPage, @Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("collegeId") Long collegeId, @Param("courseCode") String courseCode, @Param("clazzId") Long clazzId, @Param("absent") Boolean absent);
 }

+ 18 - 3
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExamStudentService.java

@@ -2,15 +2,15 @@ package com.qmth.teachcloud.report.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.teachcloud.report.business.bean.result.InspectCollegeResult;
-import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
-import com.qmth.teachcloud.report.business.bean.result.TeachCollegeResult;
+import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.TBExamStudent;
+import com.qmth.teachcloud.report.business.enums.SemesterEnum;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -79,6 +79,7 @@ public interface TBExamStudentService extends IService<TBExamStudent> {
 
     /**
      * 导入异常考试类型
+     *
      * @param examId
      * @param file
      * @throws IOException
@@ -130,4 +131,18 @@ public interface TBExamStudentService extends IService<TBExamStudent> {
      * @param response
      */
     void exportInspectCollegeResult(String semester, Long examId, String courseCode, Boolean current, Long teachCollegeId, Long teacherId, String studentParam, HttpServletResponse response) throws Exception;
+
+    /**
+     * 学生报告预览-列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param collegeId
+     * @param courseCode
+     * @param clazzId
+     * @param absent
+     * @return
+     */
+    IPage<TBStudentReportResult> reportList(IPage<Map> iPage, Long schoolId, Long examId, Long collegeId, String courseCode, Long clazzId, Boolean absent);
 }

+ 19 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamStudentServiceImpl.java

@@ -16,6 +16,7 @@ import com.qmth.teachcloud.common.util.excel.ExcelError;
 import com.qmth.teachcloud.report.business.bean.dto.ExamStudentTypeDto;
 import com.qmth.teachcloud.report.business.bean.result.InspectCollegeResult;
 import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
+import com.qmth.teachcloud.report.business.bean.result.TBStudentReportResult;
 import com.qmth.teachcloud.report.business.bean.result.TeachCollegeResult;
 import com.qmth.teachcloud.report.business.entity.TBExamStudent;
 import com.qmth.teachcloud.report.business.mapper.TBExamStudentMapper;
@@ -31,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -190,4 +192,21 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
         List<InspectCollegeResult> list = tbExamStudentMapper.listInspectCollegeResult(schoolId, semester, examId, courseCode, current, teachCollegeId, teacherId, studentParam);
         ExcelUtil.excelExport("开课成绩查询", TeachCollegeResult.class, list, response);
     }
+
+    /**
+     * 学生报告预览-列表接口
+     *
+     * @param iPage
+     * @param schoolId
+     * @param examId
+     * @param collegeId
+     * @param courseCode
+     * @param clazzId
+     * @param absent
+     * @return
+     */
+    @Override
+    public IPage<TBStudentReportResult> reportList(IPage<Map> iPage, Long schoolId, Long examId, Long collegeId, String courseCode, Long clazzId, Boolean absent) {
+        return tbExamStudentMapper.reportList(iPage, schoolId, examId, collegeId, courseCode, clazzId, absent);
+    }
 }

+ 92 - 86
teachcloud-report-business/src/main/resources/mapper/TBExamStudentMapper.xml

@@ -14,96 +14,98 @@
         </if>
     </sql>
 
-    <select id="selectTeachCollegeList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
+    <select id="selectTeachCollegeList"
+            resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
-            DISTINCT tbes.teach_college_id as teachCollegeId,
-            so.name as teachCollegeName,
-            so.code as teachCollegeCode
+        DISTINCT tbes.teach_college_id as teachCollegeId,
+        so.name as teachCollegeName,
+        so.code as teachCollegeCode
         from
-            t_b_exam_student tbes
+        t_b_exam_student tbes
         join sys_org so on
-            so.id = tbes.teach_college_id
+        so.id = tbes.teach_college_id
         <where>
-           <include refid="conditionSql" />
+            <include refid="conditionSql"/>
         </where>
     </select>
 
-    <select id="selectInspectCollegeList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
+    <select id="selectInspectCollegeList"
+            resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
-            DISTINCT tbes.inspect_college_id as inspectCollegeId,
-            so.name as inspectCollegeName,
-            so.code as inspectCollegeCode
+        DISTINCT tbes.inspect_college_id as inspectCollegeId,
+        so.name as inspectCollegeName,
+        so.code as inspectCollegeCode
         from
-            t_b_exam_student tbes
+        t_b_exam_student tbes
         join sys_org so on
-            so.id = tbes.inspect_college_id
+        so.id = tbes.inspect_college_id
         <where>
-            <include refid="conditionSql" />
+            <include refid="conditionSql"/>
         </where>
     </select>
 
     <select id="selectTeachList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
-            DISTINCT tbes.teacher_id as teacherId,
-            su.real_name as teachName
+        DISTINCT tbes.teacher_id as teacherId,
+        su.real_name as teachName
         from
-            t_b_exam_student tbes
+        t_b_exam_student tbes
         join sys_user su on
-            su.id = tbes.teacher_id
+        su.id = tbes.teacher_id
         <where>
-            <include refid="conditionSql" />
+            <include refid="conditionSql"/>
         </where>
     </select>
 
     <select id="selectClassList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
-            DISTINCT tbes.clazz_id as clazzId,
-            tbsc.clazz_name as clazzName,
-            tbsc.clazz_code as clazzCode
+        DISTINCT tbes.clazz_id as clazzId,
+        tbsc.clazz_name as clazzName,
+        tbsc.clazz_code as clazzCode
         from
-            t_b_exam_student tbes
+        t_b_exam_student tbes
         join t_b_school_clazz tbsc on
-            tbsc.id = tbes.clazz_id
+        tbsc.id = tbes.clazz_id
         <where>
-            <include refid="conditionSql" />
+            <include refid="conditionSql"/>
         </where>
     </select>
     <select id="listTeachCollegeResult"
             resultType="com.qmth.teachcloud.report.business.bean.result.TeachCollegeResult">
         SELECT
-            d.semester,
-            d.exam_name examName,
-            a.course_code courseCode,
-            a.course_name courseName,
-            a.ticket_number ticketNumber,
-            a.student_code studentCode,
-            a.name,
-            case a.current when true then '应届' else '非应届' end as current,
-            b.objective_score objectiveScore,
-            b.subjective_score subjectiveScore,
-            b.total_score totalScore,
-            c.assigned_score assignedScore,
-            e.clazz_code clazzCode,
-            e.clazz_name clazzName,
-            f.college_name teachCollegeName,
-            g.college_name inspectCollegeName,
-            h.teacher_name teacherName
+        d.semester,
+        d.exam_name examName,
+        a.course_code courseCode,
+        a.course_name courseName,
+        a.ticket_number ticketNumber,
+        a.student_code studentCode,
+        a.name,
+        case a.current when true then '应届' else '非应届' end as current,
+        b.objective_score objectiveScore,
+        b.subjective_score subjectiveScore,
+        b.total_score totalScore,
+        c.assigned_score assignedScore,
+        e.clazz_code clazzCode,
+        e.clazz_name clazzName,
+        f.college_name teachCollegeName,
+        g.college_name inspectCollegeName,
+        h.teacher_name teacherName
         FROM
-            t_b_exam_student a
-                LEFT JOIN
-            t_b_exam_record b ON a.id = b.exam_student_id
-                LEFT JOIN
-            t_a_exam_course_record c ON b.id = c.exam_record_id
-                LEFT JOIN
-            t_b_exam d ON a.exam_id = d.id
-                LEFT JOIN
-            t_b_school_clazz e ON a.clazz_id = e.id
-                LEFT JOIN
-            t_b_school_college f ON a.teach_college_id = f.id
-                LEFT JOIN
-            t_b_school_college g ON a.inspect_college_id = g.id
-                LEFT JOIN
-            t_b_school_teacher h ON a.teacher_id = h.id
+        t_b_exam_student a
+        LEFT JOIN
+        t_b_exam_record b ON a.id = b.exam_student_id
+        LEFT JOIN
+        t_a_exam_course_record c ON b.id = c.exam_record_id
+        LEFT JOIN
+        t_b_exam d ON a.exam_id = d.id
+        LEFT JOIN
+        t_b_school_clazz e ON a.clazz_id = e.id
+        LEFT JOIN
+        t_b_school_college f ON a.teach_college_id = f.id
+        LEFT JOIN
+        t_b_school_college g ON a.inspect_college_id = g.id
+        LEFT JOIN
+        t_b_school_teacher h ON a.teacher_id = h.id
         <where>
             and d.school_id = #{schoolId}
             <if test="semester != null and semester != ''">
@@ -134,36 +136,36 @@
     <select id="listInspectCollegeResult"
             resultType="com.qmth.teachcloud.report.business.bean.result.InspectCollegeResult">
         SELECT
-            d.semester,
-            d.exam_name examName,
-            a.course_code courseCode,
-            a.course_name courseName,
-            a.ticket_number ticketNumber,
-            a.student_code studentCode,
-            a.name,
-            case a.current when true then '应届' else '非应届' end as current,
-            c.assigned_score assignedScore,
-            e.clazz_code clazzCode,
-            e.clazz_name clazzName,
-            f.college_name teachCollegeName,
-            g.college_name inspectCollegeName,
-            h.teacher_name teacherName
+        d.semester,
+        d.exam_name examName,
+        a.course_code courseCode,
+        a.course_name courseName,
+        a.ticket_number ticketNumber,
+        a.student_code studentCode,
+        a.name,
+        case a.current when true then '应届' else '非应届' end as current,
+        c.assigned_score assignedScore,
+        e.clazz_code clazzCode,
+        e.clazz_name clazzName,
+        f.college_name teachCollegeName,
+        g.college_name inspectCollegeName,
+        h.teacher_name teacherName
         FROM
-            t_b_exam_student a
-                LEFT JOIN
-            t_b_exam_record b ON a.id = b.exam_student_id
-                LEFT JOIN
-            t_a_exam_course_record c ON b.id = c.exam_record_id
-                LEFT JOIN
-            t_b_exam d ON a.exam_id = d.id
-                LEFT JOIN
-            t_b_school_clazz e ON a.clazz_id = e.id
-                LEFT JOIN
-            t_b_school_college f ON a.teach_college_id = f.id
-                LEFT JOIN
-            t_b_school_college g ON a.inspect_college_id = g.id
-                LEFT JOIN
-            t_b_school_teacher h ON a.teacher_id = h.id
+        t_b_exam_student a
+        LEFT JOIN
+        t_b_exam_record b ON a.id = b.exam_student_id
+        LEFT JOIN
+        t_a_exam_course_record c ON b.id = c.exam_record_id
+        LEFT JOIN
+        t_b_exam d ON a.exam_id = d.id
+        LEFT JOIN
+        t_b_school_clazz e ON a.clazz_id = e.id
+        LEFT JOIN
+        t_b_school_college f ON a.teach_college_id = f.id
+        LEFT JOIN
+        t_b_school_college g ON a.inspect_college_id = g.id
+        LEFT JOIN
+        t_b_school_teacher h ON a.teacher_id = h.id
         <where>
             and d.school_id = #{schoolId}
             <if test="semester != null and semester != ''">
@@ -191,4 +193,8 @@
             </if>
         </where>
     </select>
+
+    <select id="reportList" resultType="com.qmth.teachcloud.report.business.bean.result.TBStudentReportResult">
+
+    </select>
 </mapper>

+ 22 - 3
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/StudentReportController.java

@@ -1,26 +1,45 @@
 package com.qmth.teachcloud.report.api;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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.enums.SemesterEnum;
+import com.qmth.teachcloud.report.business.service.TBExamStudentService;
 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.reportExamStudent}")
 public class StudentReportController {
 
+    @Resource
+    TBExamStudentService tbExamStudentService;
+
     @ApiOperation(value = "学生报告预览-列表接口")
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result reportList(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
-                                  @ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester) {
-        return ResultUtil.ok();
+    public Result reportList(@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 = true) @RequestParam String courseCode,
+                             @ApiParam(value = "班级id", required = true) @RequestParam String clazzId,
+                             @ApiParam(value = "是否缺考", required = true) @RequestParam Boolean absent,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(tbExamStudentService.reportList(new Page<>(pageNumber, pageSize), SystemConstant.convertIdToLong(schoolId),
+                SystemConstant.convertIdToLong(examId),
+                SystemConstant.convertIdToLong(collegeId),
+                courseCode,
+                SystemConstant.convertIdToLong(clazzId),
+                absent));
     }
 }