Ver Fonte

加入mongodb

wangliang há 5 anos atrás
pai
commit
71a49e4cc4
30 ficheiros alterados com 1875 adições e 52 exclusões
  1. 6 0
      pom.xml
  2. 4 0
      themis-backend/pom.xml
  3. 2 0
      themis-backend/src/main/java/com/qmth/themis/backend/ThemisBackendApplication.java
  4. 202 37
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java
  5. 280 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamActivityEntity.java
  6. 129 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamCourseEntity.java
  7. 438 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamEntity.java
  8. 150 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamPaperEntity.java
  9. 202 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamStudentEntity.java
  10. 149 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEStudentEntity.java
  11. 18 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamActivityRepo.java
  12. 18 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamCourseRepo.java
  13. 19 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamPaperRepo.java
  14. 18 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamRepo.java
  15. 19 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamStudentRepo.java
  16. 18 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEStudentRepo.java
  17. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamActivityService.java
  18. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamCourseService.java
  19. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamPaperService.java
  20. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamService.java
  21. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamStudentService.java
  22. 11 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEStudentService.java
  23. 21 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamActivityServiceImpl.java
  24. 21 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamCourseServiceImpl.java
  25. 21 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamPaperServiceImpl.java
  26. 21 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamServiceImpl.java
  27. 23 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamStudentServiceImpl.java
  28. 21 0
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEStudentServiceImpl.java
  29. 9 4
      themis-backend/src/main/resources/application.properties
  30. 0 11
      themis-business/src/main/java/com/qmth/themis/business/util/MongoUtil.java

+ 6 - 0
pom.xml

@@ -217,6 +217,12 @@
                 <artifactId>spring-boot-starter-quartz</artifactId>
                 <version>${spring-boot.version}</version>
             </dependency>
+            <!--elasticsearch-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
+                <version>${spring-boot.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 4 - 0
themis-backend/pom.xml

@@ -26,6 +26,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-mongodb</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 2 - 0
themis-backend/src/main/java/com/qmth/themis/backend/ThemisBackendApplication.java

@@ -14,6 +14,7 @@ import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Primary;
+import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -32,6 +33,7 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
 @EnableTransactionManagement //spring开启事务支持
 @EnableAsync //开启异步任务
 @EnableCaching//开启缓存注解
+@EnableMongoRepositories("com.qmth.themis.backend.mongodb.repository")
 public class ThemisBackendApplication {
 
     public static void main(String[] args) {

+ 202 - 37
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -3,19 +3,17 @@ package com.qmth.themis.backend.api;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.Gson;
 import com.qmth.themis.backend.config.DictionaryConfig;
+import com.qmth.themis.backend.mongodb.entity.*;
 import com.qmth.themis.backend.util.ServletUtil;
 import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dao.TEExamActivityMapper;
 import com.qmth.themis.business.dto.AuthDto;
-import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.entity.TEExamActivity;
+import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.MqEnum;
 import com.qmth.themis.business.enums.RoleEnum;
 import com.qmth.themis.business.enums.SystemOperationEnum;
-import com.qmth.themis.business.service.EhcacheService;
-import com.qmth.themis.business.service.TBUserService;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.EhcacheUtil;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.RedisUtil;
@@ -36,6 +34,8 @@ import org.apache.commons.lang3.RandomStringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -46,10 +46,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
 import java.security.spec.InvalidKeySpecException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * @Description: 用户 前端控制器
@@ -138,47 +135,215 @@ public class TBUserController {
     }
 
     @Resource
-    TEExamActivityMapper teExamActivityService;
+    TEExamActivityService teExamActivityService;
+
+    @Resource
+    TEExamService teExamService;
+
+    @Resource
+    TEStudentService teStudentService;
+
+    @Resource
+    TEExamStudentService teExamStudentService;
+
+    @Resource
+    TEExamCourseService teExamCourseService;
+
+    @Resource
+    TEExamPaperService teExamPaperService;
 
     @Value("${db.name}")
     String dbName;
 
+    @Resource
+    MongoTemplate mongoTemplate;
+
     @ApiOperation(value = "用户查询接口")
     @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @Transactional
     public Result list() {
         String tableName = "t_e_exam_activity_test1";
         Integer count = teExamActivityService.existTable(tableName, dbName);
         log.info("count:{}", count);
         if (count == 0) {
             teExamActivityService.createNewTable(tableName);
-            TEExamActivity teExamActivity = new TEExamActivity();
-            teExamActivity.setId(Constants.idGen.next());
-            teExamActivity.setExamId(123L);
-            teExamActivity.setCode("123");
-            teExamActivity.setName("123");
-            teExamActivity.setPrepareSeconds(30);
-            teExamActivity.setMinStartTime(new Date());
-            teExamActivity.setMaxStartTime(new Date());
-            teExamActivity.setMaxDurationSeconds(30);
-            teExamActivity.setMinDurationSeconds(30);
-            teExamActivity.setMaxFinishTime(new Date());
-            teExamActivity.setExamCount(1);
-            teExamActivity.setBreakExpireSeconds(1);
-            teExamActivity.setBreakResumeCount(1);
-            teExamActivity.setEntryFaceVerify(1);
-            teExamActivity.setEntryLivenessVerify(1);
-            teExamActivity.setConstantFaceVerify(1);
-            teExamActivity.setConstantLivenessVerifyCount(1);
-            teExamActivity.setClientVideoPush(1);
-            teExamActivity.setClientVideoRecord(1);
-            teExamActivity.setWxappPhotoUpload(1);
-            teExamActivity.setWxappVideoPush(1);
-            teExamActivity.setWxappVideoRecord(1);
-            teExamActivity.setCameraPhotoUpload(1);
-            teExamActivityService.insertInfo(tableName, teExamActivity);
         }
+        //学生档案
+        TEStudent teStudent = new TEStudent();
+        teStudent.setId(Constants.idGen.next());
+        teStudent.setOrgId(1L);
+        teStudent.setIdentity(RandomStringUtils.randomAlphanumeric(30));
+        teStudent.setPassword("123456");
+        teStudent.setIdcardNumber(RandomStringUtils.randomAlphanumeric(18));
+        teStudent.setMobileNumber(RandomStringUtils.randomNumeric(11));
+        teStudent.setName("aaa");
+        teStudent.setGender(1);
+        teStudent.setBasePhotoPath("http://11111");
+        teStudent.setCreateTime(new Date());
+        teStudentService.save(teStudent);
+
+        //考试批次
+        TEExam teExam = new TEExam();
+        teExam.setId(Constants.idGen.next());
+        teExam.setOrgId(1L);
+        teExam.setCode(RandomStringUtils.randomAlphanumeric(20));
+        teExam.setName("123");
+        teExam.setTag("test1");
+        teExam.setStartTime(new Date());
+        teExam.setEndTime(new Date());
+        teExam.setStatus(0);
+        teExam.setShortCode("123456");
+        teExam.setPrepareSeconds(30);
+        teExam.setMinDurationSeconds(30);
+        teExam.setPreNotice("99999");
+        teExam.setPreNoticeStaySeconds(30);
+        teExam.setPostNotice("88888");
+        teExam.setExamCount(5);
+        teExam.setBreakResumeCount(3);
+        teExam.setBreakExpireSeconds(30);
+        teExam.setLivenessActionCount(5);
+        teExam.setLivenessActionRetryCount(5);
+        teExam.setEntryFaceVerify(1);
+        teExam.setEntryLivenessVerify(1);
+        teExam.setConstantFaceVerify(1);
+        teExam.setConstantLivenessRetryCount(1);
+        teExam.setConstantLivenessVerifyCount(1);
+        teExam.setClientVideoPush(1);
+        teExam.setClientVideoRecord(1);
+        teExam.setWxappPhotoUpload(1);
+        teExam.setWxappVideoPush(1);
+        teExam.setWxappVideoRecord(1);
+        teExam.setCameraPhotoUpload(1);
+        teExam.setWxappPhotoUpload(1);
+        teExam.setReexamAuditing(1);
+        teExam.setSelectStrategy(1);
+        teExam.setIpLimit("123");
+        teExam.setShowObjectiveScore(1);
+        teExam.setCreateTime(new Date());
+        teExamService.save(teExam);
+
+        //考试场次
+        TEExamActivity teExamActivity = new TEExamActivity();
+        teExamActivity.setId(Constants.idGen.next());
+        teExamActivity.setExamId(teExam.getId());
+        teExamActivity.setCode(RandomStringUtils.randomAlphanumeric(20));
+        teExamActivity.setName("456");
+        teExamActivity.setPrepareSeconds(30);
+        teExamActivity.setMinStartTime(new Date());
+        teExamActivity.setMaxStartTime(new Date());
+        teExamActivity.setMaxDurationSeconds(30);
+        teExamActivity.setMinDurationSeconds(30);
+        teExamActivity.setMaxFinishTime(new Date());
+        teExamActivity.setExamCount(1);
+        teExamActivity.setBreakExpireSeconds(1);
+        teExamActivity.setBreakResumeCount(1);
+        teExamActivity.setEntryFaceVerify(1);
+        teExamActivity.setEntryLivenessVerify(1);
+        teExamActivity.setConstantFaceVerify(1);
+        teExamActivity.setConstantLivenessVerifyCount(1);
+        teExamActivity.setClientVideoPush(1);
+        teExamActivity.setClientVideoRecord(1);
+        teExamActivity.setWxappPhotoUpload(1);
+        teExamActivity.setWxappVideoPush(1);
+        teExamActivity.setWxappVideoRecord(1);
+        teExamActivity.setCameraPhotoUpload(1);
+        teExamActivityService.insertInfo(tableName, teExamActivity);
+
+        //考试试卷
+        TEExamPaper teExamPaper = new TEExamPaper();
+        teExamPaper.setId(Constants.idGen.next());
+        teExamPaper.setName("test1");
+        teExamPaper.setTotalScore(100D);
+        teExamPaper.setPaperPath("123");
+        teExamPaper.setStandardAnswerPath("234");
+        teExamPaper.setDecryptSecret("345");
+        teExamPaper.setEncryptMode(1);
+        teExamPaper.setHasVideo(1);
+        teExamPaper.setNeedVoiceAnswer(1);
+        teExamPaper.setCreateTime(new Date());
+        teExamPaperService.save(teExamPaper);
+
+        //考试科目
+        TEExamCourse teExamCourse = new TEExamCourse();
+        teExamCourse.setId(Constants.idGen.next());
+        teExamCourse.setExamId(teExam.getId());
+        teExamCourse.setExamActivityId(teExamActivity.getId());
+        teExamCourse.setCourseCode("T0001");
+        teExamCourse.setCourseName("测试科目1");
+        teExamCourse.setObjectiveShuffle(1);
+        teExamCourse.setOptionShuffle(1);
+        List paperIdsList = new ArrayList();
+        paperIdsList.add(teExamPaper.getId());
+        paperIdsList.add(0L);
+        Map paperMap = new HashMap();
+        paperMap.put("paperIds", paperIdsList);
+        teExamCourse.setPaperIds(JacksonUtil.parseJson(paperMap));
+        teExamCourseService.save(teExamCourse);
+
+        //考生
+        TEExamStudent teExamStudent = new TEExamStudent();
+        teExamStudent.setId(Constants.idGen.next());
+        teExamStudent.setExamId(teExam.getId());
+        teExamStudent.setExamActivityId(teExamActivity.getId());
+        teExamStudent.setStudentId(teStudent.getId());
+        teExamStudent.setCourseCode(teExamCourse.getCourseCode());
+        teExamStudent.setRoomCode("1");
+        teExamStudent.setIdentity(RandomStringUtils.randomAlphanumeric(20));
+        teExamStudent.setName("132");
+        Map stuMap = new HashMap();
+        stuMap.put("examTest1", "aaa");
+        stuMap.put("examTest2", "bbb");
+        teExamStudent.setParameter(JacksonUtil.parseJson(stuMap));
+        teExamStudent.setLeftExamCount(1);
+        teExamStudentService.save(teExamStudent);
+
+        Gson gson = new Gson();
+        MTEStudentEntity mteStudentEntity = gson.fromJson(gson.toJson(teStudent), MTEStudentEntity.class);
+        MTEExamEntity mteExamEntity = gson.fromJson(gson.toJson(teExam), MTEExamEntity.class);
+        MTEExamActivityEntity mteExamActivityEntity = gson.fromJson(gson.toJson(teExamActivity), MTEExamActivityEntity.class);
+        MTEExamPaperEntity mteExamPaperEntity = gson.fromJson(gson.toJson(teExamPaper), MTEExamPaperEntity.class);
+        MTEExamCourseEntity mteExamCourseEntity = gson.fromJson(gson.toJson(teExamCourse), MTEExamCourseEntity.class);
+        MTEExamStudentEntity mteExamStudentEntity = gson.fromJson(gson.toJson(teExamStudent), MTEExamStudentEntity.class);
+
+        List list = Arrays.asList(mteExamPaperEntity);
+        mteExamCourseEntity.setMteExamPaperEntityList(list);
+
+        list = Arrays.asList(mteExamActivityEntity);
+        mteExamEntity.setMteExamActivityEntityList(list);
+
+        list = Arrays.asList(mteExamCourseEntity);
+        mteExamStudentEntity.setMteExamEntity(mteExamEntity);
+        mteExamStudentEntity.setMteExamActivityEntity(mteExamActivityEntity);
+        mteExamStudentEntity.setMteStudentEntity(mteStudentEntity);
+        mteExamStudentEntity.setMteExamCourseEntityList(list);
+
+        mongoTemplate.save(mteStudentEntity);
+        mongoTemplate.save(mteExamEntity);
+        mongoTemplate.save(mteExamActivityEntity);
+        mongoTemplate.save(mteExamPaperEntity);
+        mongoTemplate.save(mteExamCourseEntity);
+        mongoTemplate.save(mteExamStudentEntity);
+
         IPage<Map> map = teExamActivityService.selectListPage(new Page<>(0, 10), tableName);
-        log.info("map:{}", JacksonUtil.parseJson(map));
+        log.info("mysql map:{}", JacksonUtil.parseJson(map));
+
+        List<MTEStudentEntity> mteStudentEntityList = mongoTemplate.findAll(MTEStudentEntity.class);
+        log.info("mongodb mteStudentEntityList:{}", JacksonUtil.parseJson(mteStudentEntityList));
+
+        List<MTEExamEntity> mteExamEntityList = mongoTemplate.findAll(MTEExamEntity.class);
+        log.info("mongodb mteExamEntityList:{}", JacksonUtil.parseJson(mteExamEntityList));
+
+        List<MTEExamActivityEntity> mteExamActivityEntityList = mongoTemplate.findAll(MTEExamActivityEntity.class);
+        log.info("mongodb mteExamActivityEntityList:{}", JacksonUtil.parseJson(mteExamActivityEntityList));
+
+        List<MTEExamPaperEntity> mteExamPaperEntityList = mongoTemplate.findAll(MTEExamPaperEntity.class);
+        log.info("mongodb mteExamPaperEntityList:{}", JacksonUtil.parseJson(mteExamPaperEntityList));
+
+        List<MTEExamCourseEntity> mteExamCourseEntityList = mongoTemplate.findAll(MTEExamCourseEntity.class);
+        log.info("mongodb mteExamCourseEntityList:{}", JacksonUtil.parseJson(mteExamCourseEntityList));
+
+        List<MTEExamStudentEntity> mteExamStudentEntityList = mongoTemplate.findAll(MTEExamStudentEntity.class);
+        log.info("mongodb mteExamStudentEntityList:{}", JacksonUtil.parseJson(mteExamStudentEntityList));
 //        teExamActivityService.dropTable(tableName);
         return ResultUtil.ok(SystemConstant.SUCCESS);
     }

+ 280 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamActivityEntity.java

@@ -0,0 +1,280 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/** 
+* @Description: mongodb 考试场次 entity 
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/
+@ApiModel(value = "TEExamActivity", description = "考试场次")
+@Document(collection = "TEExamActivity")
+public class MTEExamActivityEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "批次id")
+    private Long examId;
+
+    @ApiModelProperty(value = "场次代码")
+    private String code;
+
+    @ApiModelProperty(value = "场次名称")
+    private String name;
+
+    @ApiModelProperty(value = "提前多长时间开始候考(秒)")
+    private Integer prepareSeconds;
+
+    @ApiModelProperty(value = "最早开考时间")
+    private Date minStartTime;
+
+    @ApiModelProperty(value = "最晚开考时间,相当于迟到时间")
+    private Date maxStartTime;
+
+    @ApiModelProperty(value = "最大考试时长")
+    private Integer maxDurationSeconds;
+
+    @ApiModelProperty(value = "最短考试时间,相当于考试冻结时间(秒)")
+    private Integer minDurationSeconds;
+
+    @ApiModelProperty(value = "集中收卷时间")
+    private Date maxFinishTime;
+
+    @ApiModelProperty(value = "允许考试次数")
+    private Integer examCount;
+
+    @ApiModelProperty(value = "断点失效时间(秒)")
+    private Integer breakExpireSeconds;
+
+    @ApiModelProperty(value = "断点续考次数")
+    private Integer breakResumeCount;
+
+    @ApiModelProperty(value = "是否开启/强制开考人脸识别")
+    private Integer entryFaceVerify;
+
+    @ApiModelProperty(value = "是否开启/强制开考活体检测")
+    private Integer entryLivenessVerify;
+
+    @ApiModelProperty(value = "考试过程中人脸检测是否开启")
+    private Integer constantFaceVerify;
+
+    @ApiModelProperty(value = "考试过程中随机活体验证次数")
+    private Integer constantLivenessVerifyCount;
+
+    @ApiModelProperty(value = "是否开启/强制客户端视频监控")
+    private Integer clientVideoPush;
+
+    @ApiModelProperty(value = "是否开启客户端视频转录")
+    private Integer clientVideoRecord;
+
+    @ApiModelProperty(value = "是否开启/强制微信小程序监控")
+    private Integer wxappVideoPush;
+
+    @ApiModelProperty(value = "是否开启微信小程序视频转录")
+    private Integer wxappVideoRecord;
+
+    @ApiModelProperty(value = "是否允许使用摄像头拍照答题")
+    private Integer cameraPhotoUpload;
+
+    @ApiModelProperty(value = "是否允许使用微信拍照答题")
+    private Integer wxappPhotoUpload;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getPrepareSeconds() {
+        return prepareSeconds;
+    }
+
+    public void setPrepareSeconds(Integer prepareSeconds) {
+        this.prepareSeconds = prepareSeconds;
+    }
+
+    public Date getMinStartTime() {
+        return minStartTime;
+    }
+
+    public void setMinStartTime(Date minStartTime) {
+        this.minStartTime = minStartTime;
+    }
+
+    public Date getMaxStartTime() {
+        return maxStartTime;
+    }
+
+    public void setMaxStartTime(Date maxStartTime) {
+        this.maxStartTime = maxStartTime;
+    }
+
+    public Integer getMaxDurationSeconds() {
+        return maxDurationSeconds;
+    }
+
+    public void setMaxDurationSeconds(Integer maxDurationSeconds) {
+        this.maxDurationSeconds = maxDurationSeconds;
+    }
+
+    public Integer getMinDurationSeconds() {
+        return minDurationSeconds;
+    }
+
+    public void setMinDurationSeconds(Integer minDurationSeconds) {
+        this.minDurationSeconds = minDurationSeconds;
+    }
+
+    public Date getMaxFinishTime() {
+        return maxFinishTime;
+    }
+
+    public void setMaxFinishTime(Date maxFinishTime) {
+        this.maxFinishTime = maxFinishTime;
+    }
+
+    public Integer getExamCount() {
+        return examCount;
+    }
+
+    public void setExamCount(Integer examCount) {
+        this.examCount = examCount;
+    }
+
+    public Integer getBreakExpireSeconds() {
+        return breakExpireSeconds;
+    }
+
+    public void setBreakExpireSeconds(Integer breakExpireSeconds) {
+        this.breakExpireSeconds = breakExpireSeconds;
+    }
+
+    public Integer getBreakResumeCount() {
+        return breakResumeCount;
+    }
+
+    public void setBreakResumeCount(Integer breakResumeCount) {
+        this.breakResumeCount = breakResumeCount;
+    }
+
+    public Integer getEntryFaceVerify() {
+        return entryFaceVerify;
+    }
+
+    public void setEntryFaceVerify(Integer entryFaceVerify) {
+        this.entryFaceVerify = entryFaceVerify;
+    }
+
+    public Integer getEntryLivenessVerify() {
+        return entryLivenessVerify;
+    }
+
+    public void setEntryLivenessVerify(Integer entryLivenessVerify) {
+        this.entryLivenessVerify = entryLivenessVerify;
+    }
+
+    public Integer getConstantFaceVerify() {
+        return constantFaceVerify;
+    }
+
+    public void setConstantFaceVerify(Integer constantFaceVerify) {
+        this.constantFaceVerify = constantFaceVerify;
+    }
+
+    public Integer getConstantLivenessVerifyCount() {
+        return constantLivenessVerifyCount;
+    }
+
+    public void setConstantLivenessVerifyCount(Integer constantLivenessVerifyCount) {
+        this.constantLivenessVerifyCount = constantLivenessVerifyCount;
+    }
+
+    public Integer getClientVideoPush() {
+        return clientVideoPush;
+    }
+
+    public void setClientVideoPush(Integer clientVideoPush) {
+        this.clientVideoPush = clientVideoPush;
+    }
+
+    public Integer getClientVideoRecord() {
+        return clientVideoRecord;
+    }
+
+    public void setClientVideoRecord(Integer clientVideoRecord) {
+        this.clientVideoRecord = clientVideoRecord;
+    }
+
+    public Integer getWxappVideoPush() {
+        return wxappVideoPush;
+    }
+
+    public void setWxappVideoPush(Integer wxappVideoPush) {
+        this.wxappVideoPush = wxappVideoPush;
+    }
+
+    public Integer getWxappVideoRecord() {
+        return wxappVideoRecord;
+    }
+
+    public void setWxappVideoRecord(Integer wxappVideoRecord) {
+        this.wxappVideoRecord = wxappVideoRecord;
+    }
+
+    public Integer getCameraPhotoUpload() {
+        return cameraPhotoUpload;
+    }
+
+    public void setCameraPhotoUpload(Integer cameraPhotoUpload) {
+        this.cameraPhotoUpload = cameraPhotoUpload;
+    }
+
+    public Integer getWxappPhotoUpload() {
+        return wxappPhotoUpload;
+    }
+
+    public void setWxappPhotoUpload(Integer wxappPhotoUpload) {
+        this.wxappPhotoUpload = wxappPhotoUpload;
+    }
+}

+ 129 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamCourseEntity.java

@@ -0,0 +1,129 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.DBRef;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: mongodb 考试科目 entity
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@ApiModel(value = "TEExamCourse", description = "考试科目")
+@Document(collection = "TEExamCourse")
+public class MTEExamCourseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "考试ID")
+    private Long examId;
+
+    @ApiModelProperty(value = "场次ID")
+    private Long examActivityId;
+
+    @ApiModelProperty(value = "科目编码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(value = "是否开启客观题乱序")
+    private Integer objectiveShuffle;
+
+    @ApiModelProperty(value = "是否选项乱序,针对一个科目进行设置")
+    private Integer optionShuffle;
+
+    @ApiModelProperty(value = "所有绑定的考试试卷")
+    private String paperIds;
+
+    @DBRef
+    private List<MTEExamPaperEntity> mteExamPaperEntityList;
+
+    public List<MTEExamPaperEntity> getMteExamPaperEntityList() {
+        return mteExamPaperEntityList;
+    }
+
+    public void setMteExamPaperEntityList(List<MTEExamPaperEntity> mteExamPaperEntityList) {
+        this.mteExamPaperEntityList = mteExamPaperEntityList;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 Long getExamActivityId() {
+        return examActivityId;
+    }
+
+    public void setExamActivityId(Long examActivityId) {
+        this.examActivityId = examActivityId;
+    }
+
+    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 Integer getObjectiveShuffle() {
+        return objectiveShuffle;
+    }
+
+    public void setObjectiveShuffle(Integer objectiveShuffle) {
+        this.objectiveShuffle = objectiveShuffle;
+    }
+
+    public Integer getOptionShuffle() {
+        return optionShuffle;
+    }
+
+    public void setOptionShuffle(Integer optionShuffle) {
+        this.optionShuffle = optionShuffle;
+    }
+
+    public String getPaperIds() {
+        return paperIds;
+    }
+
+    public void setPaperIds(String paperIds) {
+        this.paperIds = paperIds;
+    }
+}

+ 438 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamEntity.java

@@ -0,0 +1,438 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.DBRef;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description: mongodb 考试批次 entity
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@ApiModel(value = "TEExam", description = "考试批次")
+@Document(collection = "TEExam")
+public class MTEExamEntity implements Serializable {
+    private static final long serialVersionUID = -1688201571728312142L;
+
+    @Id
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+
+    @ApiModelProperty(value = "批次编码,机构唯一")
+    private String code;
+
+    @ApiModelProperty(value = "批次名称")
+    private String name;
+
+    @ApiModelProperty(value = "批次标注,可用于多个考试批次归类")
+    private String tag;
+
+    @ApiModelProperty(value = "批次开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "批次结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "考试口令")
+    private String shortCode;
+
+    @ApiModelProperty(value = "提前多长时间开始候考(秒)")
+    private Integer prepareSeconds;
+
+    @ApiModelProperty(value = "最短考试时长,相当于考试冻结时间(秒)")
+    private Integer minDurationSeconds;
+
+    @ApiModelProperty(value = "考前须知")
+    private String preNotice;
+
+    @ApiModelProperty(value = "考试须知阅读时长(秒)")
+    @TableId(value = "pre_notice_stay_seconds")
+    private Integer preNoticeStaySeconds;
+
+    @ApiModelProperty(value = "考后说明,针对一个场次进行设置")
+    private String postNotice;
+
+    @ApiModelProperty(value = "允许考试次数")
+    private Integer examCount;
+
+    @ApiModelProperty(value = "断点失效时间(秒)")
+    private Integer breakExpireSeconds;
+
+    @ApiModelProperty(value = "断点续考次数")
+    private Integer breakResumeCount;
+
+    @ApiModelProperty(value = "活体动作个数")
+    private Integer livenessActionCount;
+
+    @ApiModelProperty(value = "活体单个动作重试次数")
+    private Integer livenessActionRetryCount;
+
+    @ApiModelProperty(value = "是否开启/强制开考人脸识别")
+    private Integer entryFaceVerify;
+
+    @ApiModelProperty(value = "是否开启/强制开考活体检测")
+    private Integer entryLivenessVerify;
+
+    @ApiModelProperty(value = "考试过程中人脸检测是否开启")
+    private Integer constantFaceVerify;
+
+    @ApiModelProperty(value = "考试过程中随机活体验证次数")
+    private Integer constantLivenessVerifyCount;
+
+    @ApiModelProperty(value = "考试过程中随机活体重试次数")
+    private Integer constantLivenessRetryCount;
+
+    @ApiModelProperty(value = "是否开启/强制客户端视频监控")
+    private Integer clientVideoPush;
+
+    @ApiModelProperty(value = "是否开启客户端视频转录")
+    private Integer clientVideoRecord;
+
+    @ApiModelProperty(value = "是否开启/强制微信小程序监控")
+    private Integer wxappVideoPush;
+
+    @ApiModelProperty(value = "是否开启微信小程序视频转录")
+    private Integer wxappVideoRecord;
+
+    @ApiModelProperty(value = "是否允许使用摄像头拍照答题")
+    private Integer cameraPhotoUpload;
+
+    @ApiModelProperty(value = "是否允许使用微信拍照答题")
+    private Integer wxappPhotoUpload;
+
+    @ApiModelProperty(value = "重考是否审批")
+    private Integer reexamAuditing;
+
+    @ApiModelProperty(value = "多次考试记录的选择逻辑:全部阅卷后取最高分;客观分最高;最后一次提交")
+    private Integer selectStrategy;
+
+    @ApiModelProperty(value = "IP段限制")
+    private String ipLimit;
+
+    @ApiModelProperty(value = "交卷后是否显示客观得分")
+    private Integer showObjectiveScore;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @DBRef
+    private List<MTEExamActivityEntity> mteExamActivityEntityList;
+
+    public List<MTEExamActivityEntity> getMteExamActivityEntityList() {
+        return mteExamActivityEntityList;
+    }
+
+    public void setMteExamActivityEntityList(List<MTEExamActivityEntity> mteExamActivityEntityList) {
+        this.mteExamActivityEntityList = mteExamActivityEntityList;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+
+    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 Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getShortCode() {
+        return shortCode;
+    }
+
+    public void setShortCode(String shortCode) {
+        this.shortCode = shortCode;
+    }
+
+    public Integer getPrepareSeconds() {
+        return prepareSeconds;
+    }
+
+    public void setPrepareSeconds(Integer prepareSeconds) {
+        this.prepareSeconds = prepareSeconds;
+    }
+
+    public Integer getMinDurationSeconds() {
+        return minDurationSeconds;
+    }
+
+    public void setMinDurationSeconds(Integer minDurationSeconds) {
+        this.minDurationSeconds = minDurationSeconds;
+    }
+
+    public String getPreNotice() {
+        return preNotice;
+    }
+
+    public void setPreNotice(String preNotice) {
+        this.preNotice = preNotice;
+    }
+
+    public Integer getPreNoticeStaySeconds() {
+        return preNoticeStaySeconds;
+    }
+
+    public void setPreNoticeStaySeconds(Integer preNoticeStaySeconds) {
+        this.preNoticeStaySeconds = preNoticeStaySeconds;
+    }
+
+    public String getPostNotice() {
+        return postNotice;
+    }
+
+    public void setPostNotice(String postNotice) {
+        this.postNotice = postNotice;
+    }
+
+    public Integer getExamCount() {
+        return examCount;
+    }
+
+    public void setExamCount(Integer examCount) {
+        this.examCount = examCount;
+    }
+
+    public Integer getBreakExpireSeconds() {
+        return breakExpireSeconds;
+    }
+
+    public void setBreakExpireSeconds(Integer breakExpireSeconds) {
+        this.breakExpireSeconds = breakExpireSeconds;
+    }
+
+    public Integer getBreakResumeCount() {
+        return breakResumeCount;
+    }
+
+    public void setBreakResumeCount(Integer breakResumeCount) {
+        this.breakResumeCount = breakResumeCount;
+    }
+
+    public Integer getLivenessActionCount() {
+        return livenessActionCount;
+    }
+
+    public void setLivenessActionCount(Integer livenessActionCount) {
+        this.livenessActionCount = livenessActionCount;
+    }
+
+    public Integer getLivenessActionRetryCount() {
+        return livenessActionRetryCount;
+    }
+
+    public void setLivenessActionRetryCount(Integer livenessActionRetryCount) {
+        this.livenessActionRetryCount = livenessActionRetryCount;
+    }
+
+    public Integer getEntryFaceVerify() {
+        return entryFaceVerify;
+    }
+
+    public void setEntryFaceVerify(Integer entryFaceVerify) {
+        this.entryFaceVerify = entryFaceVerify;
+    }
+
+    public Integer getEntryLivenessVerify() {
+        return entryLivenessVerify;
+    }
+
+    public void setEntryLivenessVerify(Integer entryLivenessVerify) {
+        this.entryLivenessVerify = entryLivenessVerify;
+    }
+
+    public Integer getConstantFaceVerify() {
+        return constantFaceVerify;
+    }
+
+    public void setConstantFaceVerify(Integer constantFaceVerify) {
+        this.constantFaceVerify = constantFaceVerify;
+    }
+
+    public Integer getConstantLivenessVerifyCount() {
+        return constantLivenessVerifyCount;
+    }
+
+    public void setConstantLivenessVerifyCount(Integer constantLivenessVerifyCount) {
+        this.constantLivenessVerifyCount = constantLivenessVerifyCount;
+    }
+
+    public Integer getConstantLivenessRetryCount() {
+        return constantLivenessRetryCount;
+    }
+
+    public void setConstantLivenessRetryCount(Integer constantLivenessRetryCount) {
+        this.constantLivenessRetryCount = constantLivenessRetryCount;
+    }
+
+    public Integer getClientVideoPush() {
+        return clientVideoPush;
+    }
+
+    public void setClientVideoPush(Integer clientVideoPush) {
+        this.clientVideoPush = clientVideoPush;
+    }
+
+    public Integer getClientVideoRecord() {
+        return clientVideoRecord;
+    }
+
+    public void setClientVideoRecord(Integer clientVideoRecord) {
+        this.clientVideoRecord = clientVideoRecord;
+    }
+
+    public Integer getWxappVideoPush() {
+        return wxappVideoPush;
+    }
+
+    public void setWxappVideoPush(Integer wxappVideoPush) {
+        this.wxappVideoPush = wxappVideoPush;
+    }
+
+    public Integer getWxappVideoRecord() {
+        return wxappVideoRecord;
+    }
+
+    public void setWxappVideoRecord(Integer wxappVideoRecord) {
+        this.wxappVideoRecord = wxappVideoRecord;
+    }
+
+    public Integer getCameraPhotoUpload() {
+        return cameraPhotoUpload;
+    }
+
+    public void setCameraPhotoUpload(Integer cameraPhotoUpload) {
+        this.cameraPhotoUpload = cameraPhotoUpload;
+    }
+
+    public Integer getWxappPhotoUpload() {
+        return wxappPhotoUpload;
+    }
+
+    public void setWxappPhotoUpload(Integer wxappPhotoUpload) {
+        this.wxappPhotoUpload = wxappPhotoUpload;
+    }
+
+    public Integer getReexamAuditing() {
+        return reexamAuditing;
+    }
+
+    public void setReexamAuditing(Integer reexamAuditing) {
+        this.reexamAuditing = reexamAuditing;
+    }
+
+    public Integer getSelectStrategy() {
+        return selectStrategy;
+    }
+
+    public void setSelectStrategy(Integer selectStrategy) {
+        this.selectStrategy = selectStrategy;
+    }
+
+    public String getIpLimit() {
+        return ipLimit;
+    }
+
+    public void setIpLimit(String ipLimit) {
+        this.ipLimit = ipLimit;
+    }
+
+    public Integer getShowObjectiveScore() {
+        return showObjectiveScore;
+    }
+
+    public void setShowObjectiveScore(Integer showObjectiveScore) {
+        this.showObjectiveScore = showObjectiveScore;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 150 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamPaperEntity.java

@@ -0,0 +1,150 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: mongodb 考试试卷 entity
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@ApiModel(value = "TEExamPaper", description = "考试试卷")
+@Document(collection = "TEExamPaper")
+public class MTEExamPaperEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "试卷名称")
+    private String name;
+
+    @ApiModelProperty(value = "试卷总分")
+    private Double totalScore;
+
+    @ApiModelProperty(value = "题干路径")
+    private String paperPath;
+
+    @ApiModelProperty(value = "标答路径")
+    private String standardAnswerPath;
+
+    @ApiModelProperty(value = "解密密钥")
+    private String decryptSecret;
+
+    @ApiModelProperty(value = "自动、手动、不加密")
+    private Integer encryptMode;
+
+    @ApiModelProperty(value = "题干包含音视频")
+    private Integer hasVideo;
+
+    @ApiModelProperty(value = "是否需要语音作答")
+    private Integer needVoiceAnswer;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Double getTotalScore() {
+        return totalScore;
+    }
+
+    public void setTotalScore(Double totalScore) {
+        this.totalScore = totalScore;
+    }
+
+    public String getPaperPath() {
+        return paperPath;
+    }
+
+    public void setPaperPath(String paperPath) {
+        this.paperPath = paperPath;
+    }
+
+    public String getStandardAnswerPath() {
+        return standardAnswerPath;
+    }
+
+    public void setStandardAnswerPath(String standardAnswerPath) {
+        this.standardAnswerPath = standardAnswerPath;
+    }
+
+    public String getDecryptSecret() {
+        return decryptSecret;
+    }
+
+    public void setDecryptSecret(String decryptSecret) {
+        this.decryptSecret = decryptSecret;
+    }
+
+    public Integer getEncryptMode() {
+        return encryptMode;
+    }
+
+    public void setEncryptMode(Integer encryptMode) {
+        this.encryptMode = encryptMode;
+    }
+
+    public Integer getHasVideo() {
+        return hasVideo;
+    }
+
+    public void setHasVideo(Integer hasVideo) {
+        this.hasVideo = hasVideo;
+    }
+
+    public Integer getNeedVoiceAnswer() {
+        return needVoiceAnswer;
+    }
+
+    public void setNeedVoiceAnswer(Integer needVoiceAnswer) {
+        this.needVoiceAnswer = needVoiceAnswer;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 202 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamStudentEntity.java

@@ -0,0 +1,202 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.DBRef;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: mongodb 考生 entity
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Document(collection = "TEExamStudent")
+public class MTEExamStudentEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键")
+    @Id
+    private Long id;
+
+    @ApiModelProperty(value = "批次id")
+    private Long examId;
+
+    @ApiModelProperty(value = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(value = "学生id")
+    private Long studentId;
+
+    @ApiModelProperty(value = "科目代码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "虚拟考场代码,考试唯一")
+    private String roomCode;
+
+    @ApiModelProperty(value = "证件号,机构内唯一")
+    private String identity;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "扩展字段")
+    private String parameter;
+
+    @ApiModelProperty(value = "剩余考试次数")
+    private Integer leftExamCount;
+
+    @ApiModelProperty(value = "当前考试记录ID")
+    private Long currentRecordId;
+
+    @ApiModelProperty(value = "最终生效的记录ID")
+    private Long selectRecordId;
+
+    @DBRef
+    private MTEStudentEntity mteStudentEntity;
+
+    @DBRef
+    private MTEExamEntity mteExamEntity;
+
+    @DBRef
+    private MTEExamActivityEntity mteExamActivityEntity;
+
+    @DBRef
+    private List<MTEExamCourseEntity> mteExamCourseEntityList;
+
+    public MTEExamEntity getMteExamEntity() {
+        return mteExamEntity;
+    }
+
+    public void setMteExamEntity(MTEExamEntity mteExamEntity) {
+        this.mteExamEntity = mteExamEntity;
+    }
+
+    public MTEExamActivityEntity getMteExamActivityEntity() {
+        return mteExamActivityEntity;
+    }
+
+    public void setMteExamActivityEntity(MTEExamActivityEntity mteExamActivityEntity) {
+        this.mteExamActivityEntity = mteExamActivityEntity;
+    }
+
+    public List<MTEExamCourseEntity> getMteExamCourseEntityList() {
+        return mteExamCourseEntityList;
+    }
+
+    public void setMteExamCourseEntityList(List<MTEExamCourseEntity> mteExamCourseEntityList) {
+        this.mteExamCourseEntityList = mteExamCourseEntityList;
+    }
+
+    public MTEStudentEntity getMteStudentEntity() {
+        return mteStudentEntity;
+    }
+
+    public void setMteStudentEntity(MTEStudentEntity mteStudentEntity) {
+        this.mteStudentEntity = mteStudentEntity;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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 Long getExamActivityId() {
+        return examActivityId;
+    }
+
+    public void setExamActivityId(Long examActivityId) {
+        this.examActivityId = examActivityId;
+    }
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getRoomCode() {
+        return roomCode;
+    }
+
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
+
+    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 String getParameter() {
+        return parameter;
+    }
+
+    public void setParameter(String parameter) {
+        this.parameter = parameter;
+    }
+
+    public Integer getLeftExamCount() {
+        return leftExamCount;
+    }
+
+    public void setLeftExamCount(Integer leftExamCount) {
+        this.leftExamCount = leftExamCount;
+    }
+
+    public Long getCurrentRecordId() {
+        return currentRecordId;
+    }
+
+    public void setCurrentRecordId(Long currentRecordId) {
+        this.currentRecordId = currentRecordId;
+    }
+
+    public Long getSelectRecordId() {
+        return selectRecordId;
+    }
+
+    public void setSelectRecordId(Long selectRecordId) {
+        this.selectRecordId = selectRecordId;
+    }
+}

+ 149 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEStudentEntity.java

@@ -0,0 +1,149 @@
+package com.qmth.themis.backend.mongodb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: mongodb 学生档案 entity
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Document(collection = "TEStudent")
+public class MTEStudentEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+
+    @ApiModelProperty(value = "证件号")
+    private String identity;
+
+    @ApiModelProperty(value = "登陆密码,密文保存")
+    private String password;
+
+    @ApiModelProperty(value = "身份证号")
+    private String idcardNumber;
+
+    @ApiModelProperty(value = "手机号")
+    private String mobileNumber;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "性别")
+    private Integer gender;
+
+    @ApiModelProperty(value = "底照保存地址")
+    private String basePhotoPath;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getIdcardNumber() {
+        return idcardNumber;
+    }
+
+    public void setIdcardNumber(String idcardNumber) {
+        this.idcardNumber = idcardNumber;
+    }
+
+    public String getMobileNumber() {
+        return mobileNumber;
+    }
+
+    public void setMobileNumber(String mobileNumber) {
+        this.mobileNumber = mobileNumber;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
+    }
+
+    public String getBasePhotoPath() {
+        return basePhotoPath;
+    }
+
+    public void setBasePhotoPath(String basePhotoPath) {
+        this.basePhotoPath = basePhotoPath;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 18 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamActivityRepo.java

@@ -0,0 +1,18 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEExamActivityEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 考试场次 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEExamActivityRepo extends MongoRepository<MTEExamActivityEntity, String>, QueryByExampleExecutor<MTEExamActivityEntity> {
+
+}

+ 18 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamCourseRepo.java

@@ -0,0 +1,18 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEExamCourseEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 考试科目 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEExamCourseRepo extends MongoRepository<MTEExamCourseEntity, String>, QueryByExampleExecutor<MTEExamCourseEntity> {
+
+}

+ 19 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamPaperRepo.java

@@ -0,0 +1,19 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+import com.qmth.themis.backend.mongodb.entity.MTEExamPaperEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 考试试卷 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEExamPaperRepo extends MongoRepository<MTEExamPaperEntity, String>, QueryByExampleExecutor<MTEExamPaperEntity> {
+
+}

+ 18 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamRepo.java

@@ -0,0 +1,18 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 考试批次 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEExamRepo extends MongoRepository<MTEExamEntity, String>, QueryByExampleExecutor<MTEExamEntity> {
+
+}

+ 19 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamStudentRepo.java

@@ -0,0 +1,19 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+import com.qmth.themis.backend.mongodb.entity.MTEExamStudentEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 考生 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEExamStudentRepo extends MongoRepository<MTEExamStudentEntity, String>, QueryByExampleExecutor<MTEExamStudentEntity> {
+
+}

+ 18 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEStudentRepo.java

@@ -0,0 +1,18 @@
+package com.qmth.themis.backend.mongodb.repository;
+
+import com.qmth.themis.backend.mongodb.entity.MTEStudentEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description: mongodb 学生档案 repo
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Repository
+public interface MTEStudentRepo extends MongoRepository<MTEStudentEntity, String>, QueryByExampleExecutor<MTEStudentEntity> {
+
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamActivityService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/**
+ * @Description: mongodb 考试场次 服务类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+public interface MTEExamActivityService {
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamCourseService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/** 
+* @Description: mongodb 考试科目 服务类
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/ 
+public interface MTEExamCourseService {
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamPaperService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/** 
+* @Description: mongodb 考试试卷 服务类
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/ 
+public interface MTEExamPaperService {
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/** 
+* @Description: mongodb 考试批次 服务类
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/ 
+public interface MTEExamService {
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamStudentService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/** 
+* @Description: mongodb 考生 服务类
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/ 
+public interface MTEExamStudentService {
+}

+ 11 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEStudentService.java

@@ -0,0 +1,11 @@
+package com.qmth.themis.backend.mongodb.service;
+
+/** 
+* @Description: mongodb 学生档案 服务类
+* @Param:  
+* @return:  
+* @Author: wangliang
+* @Date: 2020/7/6 
+*/ 
+public interface MTEStudentService {
+}

+ 21 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamActivityServiceImpl.java

@@ -0,0 +1,21 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEExamActivityRepo;
+import com.qmth.themis.backend.mongodb.service.MTEExamActivityService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 考试场次 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEExamActivityServiceImpl implements MTEExamActivityService {
+
+    @Resource
+    MTEExamActivityRepo mteExamActivityRepo;
+}

+ 21 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamCourseServiceImpl.java

@@ -0,0 +1,21 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEExamCourseRepo;
+import com.qmth.themis.backend.mongodb.service.MTEExamCourseService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 考试科目 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEExamCourseServiceImpl implements MTEExamCourseService {
+
+    @Resource
+    MTEExamCourseRepo mteExamCourseRepo;
+}

+ 21 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamPaperServiceImpl.java

@@ -0,0 +1,21 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEExamPaperRepo;
+import com.qmth.themis.backend.mongodb.service.MTEExamPaperService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 考试试卷 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEExamPaperServiceImpl implements MTEExamPaperService {
+
+    @Resource
+    MTEExamPaperRepo mteExamPaperRepo;
+}

+ 21 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamServiceImpl.java

@@ -0,0 +1,21 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
+import com.qmth.themis.backend.mongodb.service.MTEExamService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 考试批次 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEExamServiceImpl implements MTEExamService {
+
+    @Resource
+    MTEExamRepo mteExamRepo;
+}

+ 23 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamStudentServiceImpl.java

@@ -0,0 +1,23 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
+import com.qmth.themis.backend.mongodb.repository.MTEExamStudentRepo;
+import com.qmth.themis.backend.mongodb.service.MTEExamService;
+import com.qmth.themis.backend.mongodb.service.MTEExamStudentService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 考生 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEExamStudentServiceImpl implements MTEExamStudentService {
+
+    @Resource
+    MTEExamStudentRepo mteExamStudentRepo;
+}

+ 21 - 0
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEStudentServiceImpl.java

@@ -0,0 +1,21 @@
+package com.qmth.themis.backend.mongodb.service.impl;
+
+import com.qmth.themis.backend.mongodb.repository.MTEStudentRepo;
+import com.qmth.themis.backend.mongodb.service.MTEStudentService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: mongodb 学生档案 服务实现类
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/7/6
+ */
+@Service
+public class MTEStudentServiceImpl implements MTEStudentService {
+
+    @Resource
+    MTEStudentRepo mteStudentRepo;
+}

+ 9 - 4
themis-backend/src/main/resources/application.properties

@@ -23,6 +23,9 @@ redis.database=15
 redis.port=6379
 redis.password=
 #mongodb\u6570\u636E\u6E90\u914D\u7F6E
+mongodb.database=themis-backend
+mongodb.host=${db.host}
+mongodb.port=27017
 spring.datasource.url=jdbc:mysql://${db.host}:${db.port}/${db.name}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8
 spring.datasource.username=${db.username}
 spring.datasource.password=${db.password}
@@ -92,13 +95,15 @@ spring.redis.jedis.pool.min-idle=1
 spring.redis.jedis.timeout=180000
 
 #mongodb
-mongodb.database=themis-backend
-spring.data.mongodb.host=${db.host}
-spring.data.mongodb.port=27017
-spring.data.mongodb.uri=mongodb://${spring.data.mongodb.host}:${spring.data.mongodb.port}/${mongodb.database}
+spring.data.mongodb.uri=mongodb://${mongodb.host}:${mongodb.port}/${mongodb.database}
 spring.data.mongodb.grid-fs-database=${mongodb.database}
 spring.data.mongodb.database=${mongodb.database}
 
+#elasticsearch
+spring.elasticsearch.rest.uris=http://localhost:9200
+#spring.elasticsearch.rest.username=elastic
+#spring.elasticsearch.rest.password=123456
+
 #\u65E5\u671F\u683C\u5F0F\u5316
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.time-zone=GMT+8

+ 0 - 11
themis-business/src/main/java/com/qmth/themis/business/util/MongoUtil.java

@@ -1,11 +0,0 @@
-package com.qmth.themis.business.util;
-
-/**
- * @Description: mongo util
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/6/24
- */
-public class MongoUtil {
-}