Kaynağa Gözat

字段修改

wangliang 4 yıl önce
ebeveyn
işleme
131a0f01b7

+ 14 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/SysController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.themis.backend.config.DictionaryConfig;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
+import com.qmth.themis.business.dto.response.TEExamActivityDto;
 import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.DownloadFileEnum;
 import com.qmth.themis.business.enums.RoleEnum;
@@ -65,6 +66,9 @@ public class SysController {
     @Resource
     TBRoleService tbRoleService;
 
+    @Resource
+    TEExamActivityService teExamActivityService;
+
     @ApiOperation(value = "菜单查询接口")
     @RequestMapping(value = "/getMenu", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "菜单信息", response = TBPrivilege.class)})
@@ -227,4 +231,14 @@ public class SysController {
         map.put(SystemConstant.RECORDS, tbRoleList);
         return ResultUtil.ok(map);
     }
+
+    @ApiOperation(value = "考试场次查询接口")
+    @RequestMapping(value = "/examActivity/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "角色信息", response = TEExamActivity.class)})
+    public Result examActivityQuery() {
+        List<TEExamActivity> teExamActivityList = teExamActivityService.list();
+        Map map = new HashMap();
+        map.put(SystemConstant.RECORDS, teExamActivityList);
+        return ResultUtil.ok(map);
+    }
 }

+ 6 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TEStudentController.java

@@ -10,6 +10,7 @@ import com.qmth.themis.business.dto.response.TEStudentDto;
 import com.qmth.themis.business.dto.response.TEStudentExamRecordDto;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEStudent;
+import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.service.TEStudentService;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
@@ -107,13 +108,13 @@ public class TEStudentController {
     }
 
     @ApiOperation(value = "学生考试记录查询接口")
-    @RequestMapping(value = "/studentExamRecordQuery", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEStudentExamRecordDto.class)})
-    public Result studentExamRecordQuery(@ApiParam(value = "学生id", required = true) @RequestParam Long id, @ApiParam(value = "批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        if (Objects.isNull(id) || Objects.equals(id, "")) {
+    @RequestMapping(value = "/exam_record/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "学生考试记录信息", response = TOeExamRecord.class)})
+    public Result examRecordQuery(@ApiParam(value = "学生ID", required = true) @RequestParam Long studentId, @ApiParam(value = "考试id", required = false) @RequestParam(required = false) Long examId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        if (Objects.isNull(studentId) || Objects.equals(studentId, "")) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_ID_IS_NULL);
         }
-        IPage<TEStudentExamRecordDto> teStudentExamRecordDtoIPage = teStudentService.studentExamRecordQuery(new Page<>(pageNumber, pageSize), id, name);
+        IPage<TEStudentExamRecordDto> teStudentExamRecordDtoIPage = teStudentService.studentExamRecordQuery(new Page<>(pageNumber, pageSize), studentId, examId);
         BasePage basePage = new BasePage(teStudentExamRecordDtoIPage.getRecords(), teStudentExamRecordDtoIPage.getCurrent(), teStudentExamRecordDtoIPage.getSize(), teStudentExamRecordDtoIPage.getTotal());
         Map map = new HashMap<>();
         map.put(SystemConstant.RECORDS, basePage);

+ 1 - 1
themis-backend/src/main/resources/application.properties

@@ -160,4 +160,4 @@ prefix.url.admin=api/admin
 
 #\u65E0\u9700\u9274\u6743\u7684url
 no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/admin/user/login/account,/api/admin/sys/org/queryByOrgCode,/file/**,/upload/**,/client/**,/base_photo/**
-common.system.urls=/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query
+common.system.urls=/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query,/api/admin/sys/examActivity/query

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/dao/TEStudentMapper.java

@@ -35,9 +35,9 @@ public interface TEStudentMapper extends BaseMapper<TEStudent> {
      * 学生考试记录查询
      *
      * @param iPage
-     * @param id
-     * @param name
+     * @param studentId
+     * @param examId
      * @return
      */
-    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, @Param("id") Long id, @Param("name") String name);
+    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, @Param("studentId") Long studentId, @Param("examId") Long examId);
 }

+ 92 - 1
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEStudentExamRecordDto.java

@@ -1,5 +1,7 @@
 package com.qmth.themis.business.dto.response;
 
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+
 import java.io.Serializable;
 
 /**
@@ -11,5 +13,94 @@ import java.io.Serializable;
  */
 public class TEStudentExamRecordDto implements Serializable {
 
-    private Long id;
+    private Long examId;//考试批次id
+    private String examName;//考试名称
+    private Long examStudentId;//考生id
+    private Long examRecordId;//考试记录id
+    private String courseCode;//科目编码
+    private String courseName;//科目名称
+    private String identity;//证件号
+    private String name;//姓名
+    private Double objectiveScore;//客观分数
+    private ExamRecordStatusEnum status;//考试状态
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public Long getExamRecordId() {
+        return examRecordId;
+    }
+
+    public void setExamRecordId(Long examRecordId) {
+        this.examRecordId = examRecordId;
+    }
+
+    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 String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Double getObjectiveScore() {
+        return objectiveScore;
+    }
+
+    public void setObjectiveScore(Double objectiveScore) {
+        this.objectiveScore = objectiveScore;
+    }
+
+    public ExamRecordStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(ExamRecordStatusEnum status) {
+        this.status = status;
+    }
 }

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/service/TEStudentService.java

@@ -32,9 +32,9 @@ public interface TEStudentService extends IService<TEStudent> {
      * 学生考试记录查询
      *
      * @param iPage
-     * @param id
-     * @param name
+     * @param studentId
+     * @param examId
      * @return
      */
-    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, Long id, String name);
+    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, Long studentId, Long examId);
 }

+ 4 - 4
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEStudentServiceImpl.java

@@ -43,12 +43,12 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
      * 学生考试记录查询
      *
      * @param iPage
-     * @param id
-     * @param name
+     * @param studentId
+     * @param examId
      * @return
      */
     @Override
-    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, Long id, String name) {
-        return teStudentMapper.studentExamRecordQuery(iPage, id, name);
+    public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, Long studentId, Long examId) {
+        return teStudentMapper.studentExamRecordQuery(iPage, studentId, examId);
     }
 }

+ 29 - 1
themis-business/src/main/resources/mapper/TEStudentMapper.xml

@@ -32,6 +32,34 @@
     </select>
 
     <select id="studentExamRecordQuery" resultType="com.qmth.themis.business.dto.response.TEStudentExamRecordDto">
-
+        select
+            tee.id as examId,
+            tee.name as examName,
+            tees.id as examStudentId,
+            toer.id as examRecordId,
+            tees.course_code as courseCode,
+            teec.course_name as courseName,
+            tees.`identity`,
+            tees.name,
+            toer.objective_score as objectiveScore,
+            toer.status
+        from
+            t_e_exam_student tees
+        left join t_e_exam_course teec on
+            teec.course_code = tees.course_code
+        left join t_e_exam tee on
+            tee.id = tees.exam_id
+        inner join t_oe_exam_record toer on
+            toer.exam_student_id = tees.id and toer.exam_id = tee.id
+        left join t_e_student tes on
+            tes.id = tees.student_id
+            <where>
+                <if test="studentId != null and studentId != ''">
+                    and tes.id = #{studentId}
+                </if>
+                <if test="examId != null and examId != ''">
+                    and tee.id = #{examId}
+                </if>
+            </where>
     </select>
 </mapper>

+ 1 - 1
themis-exam/src/main/resources/application.properties

@@ -146,5 +146,5 @@ spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/MET
 prefix.url.exam=api/oe
 
 #\u65E0\u9700\u9274\u6743\u7684url
-no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/api/oe/monitor/live_url,/api/oe/monitor/call/apply,/api/oe/monitor/call/cancel,/api/oe/monitor/call/list
+no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/api/oe/monitor/live_url,/api/oe/monitor/call/apply,/api/oe/monitor/call/cancel,/api/oe/monitor/call/list,/api/oe/monitor/call/query
 common.system.urls=/api/oe/student/logout,/api/oe/exam/file/upload