Переглянути джерело

查看试卷增加主观题明细

wangliang 2 роки тому
батько
коміт
e6f81ec8a3

+ 14 - 1
themis-business/src/main/java/com/qmth/themis/business/cache/bean/ExamRecordPaperViewBean.java

@@ -59,6 +59,9 @@ public class ExamRecordPaperViewBean implements Serializable {
     @ApiModelProperty(value = "乱序后的试卷结构json,没有则为null")
     private String randomPaperStructPath;
 
+    @ApiModelProperty(value = "主观题分数明细")
+    private String subjectiveScoreDetailJson;
+
     public ExamRecordPaperViewBean() {
 
     }
@@ -74,7 +77,8 @@ public class ExamRecordPaperViewBean implements Serializable {
                                    String paperStructJson,
                                    String answerJson,
                                    String examStudentAnswerJson,
-                                   String randomPaperStructPath) {
+                                   String randomPaperStructPath,
+                                   String subjectiveScoreDetailJson) {
         this.examRecordId = examRecordId;
         this.examStudentName = examStudentName;
         this.identity = identity;
@@ -87,6 +91,15 @@ public class ExamRecordPaperViewBean implements Serializable {
         this.answerJson = answerJson;
         this.examStudentAnswerJson = examStudentAnswerJson;
         this.randomPaperStructPath = randomPaperStructPath;
+        this.subjectiveScoreDetailJson = subjectiveScoreDetailJson;
+    }
+
+    public String getSubjectiveScoreDetailJson() {
+        return subjectiveScoreDetailJson;
+    }
+
+    public void setSubjectiveScoreDetailJson(String subjectiveScoreDetailJson) {
+        this.subjectiveScoreDetailJson = subjectiveScoreDetailJson;
     }
 
     public String getRandomPaperStructPath() {

+ 16 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TSyncExamStudentScoreMapper.java

@@ -0,0 +1,16 @@
+package com.qmth.themis.business.dao;
+
+import com.qmth.themis.business.base.CustomBaseMapper;
+import com.qmth.themis.business.entity.TSyncExamStudentScore;
+
+/**
+ * <p>
+ * 同步云阅卷考生成绩表 Mapper 接口
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-07-14
+ */
+public interface TSyncExamStudentScoreMapper extends CustomBaseMapper<TSyncExamStudentScore> {
+
+}

+ 315 - 0
themis-business/src/main/java/com/qmth/themis/business/entity/TSyncExamStudentScore.java

@@ -0,0 +1,315 @@
+package com.qmth.themis.business.entity;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.themis.business.constant.SystemConstant;
+import com.qmth.themis.business.util.UidUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 同步云阅卷考生成绩表
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-07-14
+ */
+@ApiModel(value = "TSyncExamStudentScore对象", description = "同步云阅卷考生成绩表")
+public class TSyncExamStudentScore implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "考试批次id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long examBatchId;
+
+    @ApiModelProperty(value = "学院")
+    private String college;
+
+    @ApiModelProperty(value = "客观题分数")
+    private Double objectiveScore;
+
+    @ApiModelProperty(value = "卷型")
+    private String paperType;
+
+    @ApiModelProperty(value = "考试编码")
+    private String examCode;
+
+    @ApiModelProperty(value = "学号")
+    private String studentCode;
+
+    @ApiModelProperty(value = "班级")
+    private String clazzName;
+
+    @ApiModelProperty(value = "主观题分数明细")
+    private String subjectiveScoreDetail;
+
+    @ApiModelProperty(value = "准考证号")
+    private String examNumber;
+
+    @ApiModelProperty(value = "总分")
+    private Double totalScore;
+
+    @ApiModelProperty(value = "原卷url")
+    private String sheetUrls;
+
+    @ApiModelProperty(value = "教师")
+    private String teacher;
+
+    @ApiModelProperty(value = "客观题分数明细")
+    private String objectiveScoreDetail;
+
+    @ApiModelProperty(value = "云阅卷考试id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long examId;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "主观题分数")
+    private Double subjectiveScore;
+
+    @ApiModelProperty(value = "科目编码")
+    private String subjectCode;
+
+    @ApiModelProperty(value = "科目名称")
+    private String subjectName;
+
+    @ApiModelProperty(value = "考生状态,1-正常,2-缺考(包含未上传),3-违纪")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long createId;
+
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    public TSyncExamStudentScore() {
+
+    }
+
+    public TSyncExamStudentScore(Map map) {
+        this.id = UidUtil.nextId();
+        this.examBatchId = Long.parseLong(String.valueOf(map.get("exam_batch_id")));
+        this.examId = Long.parseLong(String.valueOf(map.get("examId")));
+        this.examCode = (String) map.get("examCode");
+        this.examNumber = (String) map.get("examNumber");
+        this.studentCode = (String) map.get("studentCode");
+        this.name = (String) map.get("name");
+        this.subjectCode = (String) map.get("subjectCode");
+        this.subjectName = (String) map.get("subjectName");
+        this.paperType = (String) map.get("paperType");
+        this.college = (String) map.get("college");
+        this.clazzName = (String) map.get("className");
+        this.teacher = (String) map.get("teacher");
+        this.status = (Integer) map.get("status");
+        JSONArray jsonArray = (JSONArray) map.get("sheetUrls");
+        if (Objects.nonNull(jsonArray) && jsonArray.size() > 0) {
+            this.sheetUrls = jsonArray.toJSONString();
+        }
+        this.totalScore = Double.parseDouble(String.valueOf(map.get("totalScore")));
+        this.objectiveScore = Double.parseDouble(String.valueOf(map.get("objectiveScore")));
+        this.subjectiveScore = Double.parseDouble(String.valueOf(map.get("subjectiveScore")));
+        this.createId = (Long) map.get(SystemConstant.CREATE_ID);
+        this.createTime = System.currentTimeMillis();
+
+        JSONArray objectiveScoreDetailJsonArray = (JSONArray) map.get("objectiveScoreDetail");
+        JSONArray subjectiveScoreDetailJsonArray = (JSONArray) map.get("subjectiveScoreDetail");
+        if (Objects.nonNull(objectiveScoreDetailJsonArray) && objectiveScoreDetailJsonArray.size() > 0) {
+            this.objectiveScoreDetail = objectiveScoreDetailJsonArray.toJSONString();
+        }
+        if (Objects.nonNull(subjectiveScoreDetailJsonArray) && subjectiveScoreDetailJsonArray.size() > 0) {
+            this.subjectiveScoreDetail = subjectiveScoreDetailJsonArray.toJSONString();
+        }
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getExamBatchId() {
+        return examBatchId;
+    }
+
+    public void setExamBatchId(Long examBatchId) {
+        this.examBatchId = examBatchId;
+    }
+
+    public String getCollege() {
+        return college;
+    }
+
+    public void setCollege(String college) {
+        this.college = college;
+    }
+
+    public Double getObjectiveScore() {
+        return objectiveScore;
+    }
+
+    public void setObjectiveScore(Double objectiveScore) {
+        this.objectiveScore = objectiveScore;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public String getExamCode() {
+        return examCode;
+    }
+
+    public void setExamCode(String examCode) {
+        this.examCode = examCode;
+    }
+
+    public String getStudentCode() {
+        return studentCode;
+    }
+
+    public void setStudentCode(String studentCode) {
+        this.studentCode = studentCode;
+    }
+
+    public String getClazzName() {
+        return clazzName;
+    }
+
+    public void setClazzName(String clazzName) {
+        this.clazzName = clazzName;
+    }
+
+    public String getSubjectiveScoreDetail() {
+        return subjectiveScoreDetail;
+    }
+
+    public void setSubjectiveScoreDetail(String subjectiveScoreDetail) {
+        this.subjectiveScoreDetail = subjectiveScoreDetail;
+    }
+
+    public String getExamNumber() {
+        return examNumber;
+    }
+
+    public void setExamNumber(String examNumber) {
+        this.examNumber = examNumber;
+    }
+
+    public Double getTotalScore() {
+        return totalScore;
+    }
+
+    public void setTotalScore(Double totalScore) {
+        this.totalScore = totalScore;
+    }
+
+    public String getSheetUrls() {
+        return sheetUrls;
+    }
+
+    public void setSheetUrls(String sheetUrls) {
+        this.sheetUrls = sheetUrls;
+    }
+
+    public String getTeacher() {
+        return teacher;
+    }
+
+    public void setTeacher(String teacher) {
+        this.teacher = teacher;
+    }
+
+    public String getObjectiveScoreDetail() {
+        return objectiveScoreDetail;
+    }
+
+    public void setObjectiveScoreDetail(String objectiveScoreDetail) {
+        this.objectiveScoreDetail = objectiveScoreDetail;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Double getSubjectiveScore() {
+        return subjectiveScore;
+    }
+
+    public void setSubjectiveScore(Double subjectiveScore) {
+        this.subjectiveScore = subjectiveScore;
+    }
+
+    public String getSubjectCode() {
+        return subjectCode;
+    }
+
+    public void setSubjectCode(String subjectCode) {
+        this.subjectCode = subjectCode;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+}

+ 16 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TSyncExamStudentScoreService.java

@@ -0,0 +1,16 @@
+package com.qmth.themis.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.themis.business.entity.TSyncExamStudentScore;
+
+/**
+ * <p>
+ * 同步云阅卷考生成绩表 服务类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-07-14
+ */
+public interface TSyncExamStudentScoreService extends IService<TSyncExamStudentScore> {
+
+}

+ 11 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -20,6 +20,7 @@ import com.qmth.themis.business.dto.response.MarkResultDto;
 import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamAnswer;
 import com.qmth.themis.business.entity.TOeExamRecord;
+import com.qmth.themis.business.entity.TSyncExamStudentScore;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.*;
@@ -99,6 +100,9 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     @Resource
     TOeExamAnswerService tOeExamAnswerService;
 
+    @Resource
+    TSyncExamStudentScoreService tSyncExamStudentScoreService;
+
     /**
      * 获取考试未完列表
      *
@@ -1444,6 +1448,11 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(tOeExamRecord.getExamStudentId());
         Optional.ofNullable(examStudentCacheBean).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_STUDENT));
 
+        QueryWrapper<TSyncExamStudentScore> tSyncExamStudentScoreQueryWrapper = new QueryWrapper<>();
+        tSyncExamStudentScoreQueryWrapper.lambda().eq(TSyncExamStudentScore::getExamNumber, examRecordId)
+                .eq(TSyncExamStudentScore::getStatus, 1);
+        TSyncExamStudentScore tSyncExamStudentScore = tSyncExamStudentScoreService.getOne(tSyncExamStudentScoreQueryWrapper);
+
         JSONObject paperStructJson = null, answerJson = null, randomPaperStructJson = null;
         String examStudentAnswerJson = null;
         if (Objects.nonNull(teExamPaper.getPaperViewPath())) {
@@ -1480,7 +1489,8 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
                 Objects.nonNull(paperStructJson) ? paperStructJson.toJSONString() : null,
                 Objects.nonNull(answerJson) ? answerJson.toJSONString() : null,
                 examStudentAnswerJson,
-                Objects.nonNull(randomPaperStructJson) ? randomPaperStructJson.toJSONString() : null);
+                Objects.nonNull(randomPaperStructJson) ? randomPaperStructJson.toJSONString() : null,
+                Objects.nonNull(tSyncExamStudentScore) && Objects.nonNull(tSyncExamStudentScore.getSubjectiveScoreDetail()) ? tSyncExamStudentScore.getSubjectiveScoreDetail() : null);
     }
 
     /**

+ 20 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TSyncExamStudentScoreServiceImpl.java

@@ -0,0 +1,20 @@
+package com.qmth.themis.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.themis.business.dao.TSyncExamStudentScoreMapper;
+import com.qmth.themis.business.entity.TSyncExamStudentScore;
+import com.qmth.themis.business.service.TSyncExamStudentScoreService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 同步云阅卷考生成绩表 服务实现类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-07-14
+ */
+@Service
+public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStudentScoreMapper, TSyncExamStudentScore> implements TSyncExamStudentScoreService {
+
+}

+ 5 - 0
themis-business/src/main/resources/mapper/TSyncExamStudentScoreMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmth.themis.business.dao.TSyncExamStudentScoreMapper">
+
+</mapper>