xiatian 5 năm trước cách đây
mục cha
commit
625bee7499

+ 286 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/bean/ExamRecordDataBean.java

@@ -0,0 +1,286 @@
+package cn.com.qmth.examcloud.core.oe.student.bean;
+
+import java.util.Date;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamRecordStatus;
+import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamType;
+
+public class ExamRecordDataBean implements JsonSerializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 3881189287358373638L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 考试ID
+     */
+    private Long examId;
+
+    /**
+     * 考试类型
+     */
+    private ExamType examType;
+
+    /**
+     * 考生ID
+     */
+    private Long examStudentId;
+
+    /**
+     * 学生ID
+     */
+    private Long studentId;
+
+    /**
+     * 课程ID
+     */
+    private Long courseId;
+
+    /**
+     * 学习中心ID
+     */
+    private Long orgId;
+
+    /**
+     * 顶级机构ID
+     */
+    private Long rootOrgId;
+
+    /**
+     * 基础试卷ID
+     */
+    private String basePaperId;
+
+    /**
+     * 试卷类型
+     */
+    private String paperType;
+
+    /**
+     * 考试开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 考试结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 考试时长
+     */
+    private Long usedExamTime;
+
+    /**
+     * 是否断点续考
+     */
+    private Boolean isContinued;
+
+    /**
+     * 断点续考次数
+     */
+    private Integer continuedCount;
+
+    /**
+     * 是否达到最大断点限制
+     */
+    private Boolean isExceed;
+
+    /**
+     * 抓拍比对成功次数
+     */
+    private Integer faceSuccessCount;
+
+    /**
+     * 抓拍比对失败次数
+     */
+    private Integer faceFailedCount;
+
+    /**
+     * 抓拍存在陌生人的次数
+     */
+    private Integer faceStrangerCount;
+
+    /**
+     * 抓拍比对总次数
+     */
+    private Integer faceTotalCount;
+
+    // 考试记录状态
+    private ExamRecordStatus examRecordStatus;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public ExamType getExamType() {
+        return examType;
+    }
+
+    public void setExamType(ExamType examType) {
+        this.examType = examType;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public Long getRootOrgId() {
+        return rootOrgId;
+    }
+
+    public void setRootOrgId(Long rootOrgId) {
+        this.rootOrgId = rootOrgId;
+    }
+
+    public String getBasePaperId() {
+        return basePaperId;
+    }
+
+    public void setBasePaperId(String basePaperId) {
+        this.basePaperId = basePaperId;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Long getUsedExamTime() {
+        return usedExamTime;
+    }
+
+    public void setUsedExamTime(Long usedExamTime) {
+        this.usedExamTime = usedExamTime;
+    }
+
+    public Boolean getIsContinued() {
+        return isContinued;
+    }
+
+    public void setIsContinued(Boolean isContinued) {
+        this.isContinued = isContinued;
+    }
+
+    public Integer getContinuedCount() {
+        return continuedCount;
+    }
+
+    public void setContinuedCount(Integer continuedCount) {
+        this.continuedCount = continuedCount;
+    }
+
+    public Integer getFaceSuccessCount() {
+        return faceSuccessCount;
+    }
+
+    public void setFaceSuccessCount(Integer faceSuccessCount) {
+        this.faceSuccessCount = faceSuccessCount;
+    }
+
+    public Integer getFaceFailedCount() {
+        return faceFailedCount;
+    }
+
+    public void setFaceFailedCount(Integer faceFailedCount) {
+        this.faceFailedCount = faceFailedCount;
+    }
+
+    public Integer getFaceStrangerCount() {
+        return faceStrangerCount;
+    }
+
+    public void setFaceStrangerCount(Integer faceStrangerCount) {
+        this.faceStrangerCount = faceStrangerCount;
+    }
+
+    public Integer getFaceTotalCount() {
+        return faceTotalCount;
+    }
+
+    public void setFaceTotalCount(Integer faceTotalCount) {
+        this.faceTotalCount = faceTotalCount;
+    }
+
+    public Boolean getIsExceed() {
+        return isExceed;
+    }
+
+    public void setIsExceed(Boolean isExceed) {
+        this.isExceed = isExceed;
+    }
+
+    public ExamRecordStatus getExamRecordStatus() {
+        return examRecordStatus;
+    }
+
+    public void setExamRecordStatus(ExamRecordStatus examRecordStatus) {
+        this.examRecordStatus = examRecordStatus;
+    }
+}

+ 2 - 1
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamRecordDataService.java

@@ -1,6 +1,7 @@
 package cn.com.qmth.examcloud.core.oe.student.service;
 
 import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
+import cn.com.qmth.examcloud.core.oe.student.bean.ExamRecordDataBean;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
@@ -26,7 +27,7 @@ public interface ExamRecordDataService {
      *            是否全客观题
      * @return
      */
-    ExamRecordDataEntity createExamRecordData(ExamingSession examingSession, ExamBean examBean, CourseBean courseBean,
+    ExamRecordDataBean createExamRecordData(ExamingSession examingSession, ExamBean examBean, CourseBean courseBean,
             String basePaperId);
 
 }

+ 3 - 3
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamControlServiceImpl.java

@@ -26,8 +26,8 @@ import cn.com.qmth.examcloud.core.oe.student.base.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.student.base.helper.ExamCacheTransferHelper;
 import cn.com.qmth.examcloud.core.oe.student.base.utils.CommonUtil;
 import cn.com.qmth.examcloud.core.oe.student.base.utils.QuestionTypeUtil;
+import cn.com.qmth.examcloud.core.oe.student.bean.ExamRecordDataBean;
 import cn.com.qmth.examcloud.core.oe.student.bean.StartExamInfo;
-import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamControlService;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordPaperStructService;
@@ -136,7 +136,7 @@ public class ExamControlServiceImpl implements ExamControlService {
 
         // 生成考试记录
         startTime = System.currentTimeMillis();
-        ExamRecordDataEntity examRecordData = examRecordDataService.createExamRecordData(examingSession, examBean,
+        ExamRecordDataBean examRecordData = examRecordDataService.createExamRecordData(examingSession, examBean,
                 courseBean, paperId);
 
         // 如果开启人脸比对,将同步人脸比对结果存储到抓后结果表中
@@ -453,7 +453,7 @@ public class ExamControlServiceImpl implements ExamControlService {
      * @param examRecordData
      * @param examBean
      */
-    public void initializeExamRecordSession(ExamingSession examSessionInfo, ExamRecordDataEntity examRecordData,
+    public void initializeExamRecordSession(ExamingSession examSessionInfo, ExamRecordDataBean examRecordData,
             final ExamBean examBean) {
         examSessionInfo.setExamRecordDataId(examRecordData.getId());
         examSessionInfo.setStartTime(examRecordData.getStartTime().getTime());

+ 7 - 2
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordDataServiceImpl.java

@@ -2,11 +2,13 @@ package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
 import java.util.Date;
 
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
+import cn.com.qmth.examcloud.core.oe.student.bean.ExamRecordDataBean;
 import cn.com.qmth.examcloud.core.oe.student.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamRecordStatus;
@@ -29,7 +31,7 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
 
     @Transactional
     @Override
-    public ExamRecordDataEntity createExamRecordData(ExamingSession examingSession, ExamBean examBean,
+    public ExamRecordDataBean createExamRecordData(ExamingSession examingSession, ExamBean examBean,
             CourseBean courseBean, String basePaperId) {
         ExamRecordDataEntity examRecordData = new ExamRecordDataEntity();
         examRecordData.setExamId(examBean.getId());
@@ -53,7 +55,10 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         examRecordData.setFaceFailedCount(0);
         examRecordData.setFaceStrangerCount(0);
         examRecordData.setExamRecordStatus(ExamRecordStatus.EXAM_ING);
-        return examRecordDataRepo.save(examRecordData);
+        examRecordDataRepo.save(examRecordData);
+        ExamRecordDataBean bean=new ExamRecordDataBean();
+        BeanUtils.copyProperties(bean, examRecordData);
+        return bean;
     }
 
 }