xiatian hace 5 años
padre
commit
b65c1650d5

+ 0 - 10
examcloud-core-oe-student-base/pom.xml

@@ -51,16 +51,6 @@
             <artifactId>examcloud-core-questions-api-client</artifactId>
             <version>${examcloud.version}</version>
         </dependency>
-        <dependency>
-            <groupId>cn.com.qmth.examcloud.rpc</groupId>
-            <artifactId>examcloud-core-oe-admin-api-client</artifactId>
-            <version>${examcloud.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>cn.com.qmth.examcloud.rpc</groupId>
-            <artifactId>examcloud-core-marking-api-client</artifactId>
-            <version>${examcloud.version}</version>
-        </dependency>
         <dependency>
             <groupId>cn.com.qmth.examcloud.rpc</groupId>
             <artifactId>examcloud-core-oe-task-api-client</artifactId>

+ 3 - 3
examcloud-core-oe-student-dao/src/main/java/cn/com/qmth/examcloud/core/oe/student/dao/entity/ExamRecordDataEntity.java

@@ -12,11 +12,11 @@ import javax.persistence.Id;
 import javax.persistence.Index;
 import javax.persistence.Table;
 
-import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamRecordStatus;
-import cn.com.qmth.examcloud.core.oe.student.dao.enums.HandInExamType;
 import org.hibernate.annotations.DynamicInsert;
 
-import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamType;
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
+import cn.com.qmth.examcloud.core.oe.student.dao.enums.HandInExamType;
+import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**

+ 0 - 46
examcloud-core-oe-student-dao/src/main/java/cn/com/qmth/examcloud/core/oe/student/dao/enums/ExamRecordStatus.java

@@ -1,46 +0,0 @@
-package cn.com.qmth.examcloud.core.oe.student.dao.enums;
-
-/**
- * 考试记录状态
- *
- * @author xudengqi
- * 2016年8月23日
- */
-public enum ExamRecordStatus {
-    /**
-     * 考试中
-     */
-    EXAM_ING,
-    /**
-     * 手工交卷处理中
-     */
-    EXAM_HAND_IN,
-    /**
-     * 系统交卷处理中
-     */
-    EXAM_AUTO_HAND_IN,
-    /**
-     * 考试结束
-     */
-    EXAM_END,
-
-    /**
-     * 考试过期
-     */
-    EXAM_OVERDUE,
-
-    /**
-     * 考试无效/作废
-     */
-    EXAM_INVALID;
-
-    public static ExamRecordStatus getByName(String name) {
-        for (ExamRecordStatus status : values()) {
-            if (status.name().equals(name)) {
-                return status;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 42
examcloud-core-oe-student-dao/src/main/java/cn/com/qmth/examcloud/core/oe/student/dao/enums/ExamType.java

@@ -1,42 +0,0 @@
-package cn.com.qmth.examcloud.core.oe.student.dao.enums;
-
-
-/**
- * @author ting.yin
- * @Description: 考试类型
- * @date 2017年1月5日
- */
-public enum ExamType {
-    /**
-     * 传统考试
-     */
-    TRADITION,
-    /**
-     * 在线考试
-     */
-    ONLINE,
-    /**
-     * 在线练习
-     */
-    PRACTICE,
-
-    /**
-     * 离线考试
-     */
-    OFFLINE,
-
-    /**
-     * 分布式印刷考试
-     */
-    PRINT_EXAM;
-
-    public static ExamType strToEnum(String str) {
-        for (ExamType examType : ExamType.values()) {
-            if (examType.name().equals(str)) {
-                return examType;
-            }
-        }
-        return null;
-    }
-
-}

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

@@ -1,286 +0,0 @@
-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;
-    }
-}

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

@@ -1,8 +1,8 @@
 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.examwork.api.bean.ExamBean;
+import cn.com.qmth.examcloud.support.examing.ExamRecordData;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
 
 /**
@@ -26,21 +26,21 @@ public interface ExamRecordDataService {
      *            是否全客观题
      * @return
      */
-    public ExamRecordDataBean createExamRecordData(ExamingSession examingSession, ExamBean examBean, CourseBean courseBean,
+    public ExamRecordData createExamRecordData(ExamingSession examingSession, ExamBean examBean, CourseBean courseBean,
             String basePaperId);
     
     /**
      * 保存
      * @param timeout   秒
      */
-    public void saveExamRecordDataBean(Long examRecordDataId,ExamRecordDataBean data,int timeout);
+    public void saveExamRecordDataBean(Long examRecordDataId,ExamRecordData data,int timeout);
 
     /**
      * 获取
      * @param examRecordDataId
      * @return
      */
-    public ExamRecordDataBean getExamRecordDataBean(Long examRecordDataId);
+    public ExamRecordData getExamRecordDataBean(Long examRecordDataId);
 
     /**
      * 删除

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

@@ -1,5 +1,23 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
@@ -8,10 +26,13 @@ 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.enums.HandInExamType;
-import cn.com.qmth.examcloud.core.oe.student.service.*;
+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;
+import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordQuestionsService;
+import cn.com.qmth.examcloud.core.oe.student.service.ExamingSessionService;
 import cn.com.qmth.examcloud.core.oe.task.api.ExamCaptureCloudService;
 import cn.com.qmth.examcloud.core.oe.task.api.request.SaveExamCaptureSyncCompareResultReq;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
@@ -23,19 +44,17 @@ import cn.com.qmth.examcloud.question.commons.core.question.QuestionType;
 import cn.com.qmth.examcloud.reports.commons.bean.OnlineExamStudentReport;
 import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
 import cn.com.qmth.examcloud.support.cache.CacheHelper;
-import cn.com.qmth.examcloud.support.cache.bean.*;
+import cn.com.qmth.examcloud.support.cache.bean.ExamOrgSettingsCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExamPropertyCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExamStudentSettingsCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigDetailCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigPaperCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
+import cn.com.qmth.examcloud.support.examing.ExamRecordData;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
 import cn.com.qmth.examcloud.support.examing.ExamingStatus;
 import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.*;
 
 /**
  * @author chenken
@@ -124,7 +143,7 @@ public class ExamControlServiceImpl implements ExamControlService {
 
         // 生成考试记录
         startTime = System.currentTimeMillis();
-        ExamRecordDataBean examRecordData = examRecordDataService.createExamRecordData(examingSession, examBean,
+        ExamRecordData examRecordData = examRecordDataService.createExamRecordData(examingSession, examBean,
                 courseBean, paperId);
 
         // 如果开启人脸比对,将同步人脸比对结果存储到抓后结果表中
@@ -452,7 +471,7 @@ public class ExamControlServiceImpl implements ExamControlService {
      * @param examRecordData
      * @param examBean
      */
-    public void initializeExamRecordSession(ExamingSession examSessionInfo, ExamRecordDataBean examRecordData,
+    public void initializeExamRecordSession(ExamingSession examSessionInfo, ExamRecordData examRecordData,
             final ExamBean examBean) {
         examSessionInfo.setExamRecordDataId(examRecordData.getId());
         examSessionInfo.setStartTime(examRecordData.getStartTime().getTime());

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

@@ -8,14 +8,14 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 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;
-import cn.com.qmth.examcloud.core.oe.student.dao.enums.ExamType;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
+import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
+import cn.com.qmth.examcloud.support.examing.ExamRecordData;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
 
@@ -39,7 +39,7 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
 
     @Transactional
     @Override
-    public ExamRecordDataBean createExamRecordData(ExamingSession examingSession, ExamBean examBean,
+    public ExamRecordData createExamRecordData(ExamingSession examingSession, ExamBean examBean,
             CourseBean courseBean, String basePaperId) {
         ExamRecordDataEntity examRecordData = new ExamRecordDataEntity();
         examRecordData.setExamId(examBean.getId());
@@ -64,7 +64,7 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         examRecordData.setFaceStrangerCount(0);
         examRecordData.setExamRecordStatus(ExamRecordStatus.EXAM_ING);
         examRecordDataRepo.save(examRecordData);
-        ExamRecordDataBean bean = new ExamRecordDataBean();
+        ExamRecordData bean = new ExamRecordData();
         BeanUtils.copyProperties(bean, examRecordData);
         //存入redis
         saveExamRecordDataBean(examRecordData.getId(), bean, -1);
@@ -72,13 +72,13 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
     }
 
     @Override
-    public void saveExamRecordDataBean(Long examRecordDataId, ExamRecordDataBean data, int timeout) {
+    public void saveExamRecordDataBean(Long examRecordDataId, ExamRecordData data, int timeout) {
         redisClient.set(examRecordDataKeyPrefix + examRecordDataId, data, timeout);
     }
 
     @Override
-    public ExamRecordDataBean getExamRecordDataBean(Long examRecordDataId) {
-        return redisClient.get(examRecordDataKeyPrefix + examRecordDataId, ExamRecordDataBean.class);
+    public ExamRecordData getExamRecordDataBean(Long examRecordDataId) {
+        return redisClient.get(examRecordDataKeyPrefix + examRecordDataId, ExamRecordData.class);
     }
 
     @Override