Explorar el Código

format code style

deason hace 3 años
padre
commit
5c33fec2cc
Se han modificado 28 ficheros con 483 adiciones y 472 borrados
  1. 8 0
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamControlController.java
  2. 8 8
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamDataCleanController.java
  3. 1 1
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamFaceLivenessVerifyController.java
  4. 85 92
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamQuestionController.java
  5. 20 22
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamRecordPaperStructController.java
  6. 36 38
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamSmsController.java
  7. 17 25
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/FaceBiopsyController.java
  8. 17 7
      examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/provider/ExamRecordDataCloudServiceProvider.java
  9. 1 0
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamBossService.java
  10. 5 3
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamControlService.java
  11. 1 1
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamDataCleanService.java
  12. 1 1
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamFaceLivenessVerifyService.java
  13. 6 8
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamFileAnswerService.java
  14. 10 7
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamRecordDataService.java
  15. 0 1
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamRecordQuestionsService.java
  16. 6 3
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamingSessionService.java
  17. 3 0
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/FaceBiopsyService.java
  18. 20 20
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamBossServiceImpl.java
  19. 4 3
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamControlServiceImpl.java
  20. 134 134
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamDataCleanServiceImpl.java
  21. 4 2
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamFaceLivenessVerifyServiceImpl.java
  22. 3 1
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamFileAnswerServiceImpl.java
  23. 45 48
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamProcessRecordServiceImpl.java
  24. 23 28
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordDataServiceImpl.java
  25. 1 0
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordPaperStructServiceImpl.java
  26. 4 2
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordQuestionsServiceImpl.java
  27. 5 5
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamingSessionServiceImpl.java
  28. 15 12
      examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/FaceBiopsyServiceImpl.java

+ 8 - 0
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamControlController.java

@@ -47,22 +47,29 @@ import java.util.concurrent.TimeUnit;
 @RestController
 @RequestMapping("${app.api.oe.student}/examControl")
 public class ExamControlController extends ControllerSupport {
+
     private static final String SEPARATOR = "/";
 
     private static final String UNDERLINE = "_";
 
     // 小程序答案上传目录
     private static final String OE_ANSWER_FILE_PATH = "oe-answer-file";
+
     @Autowired
     private ExamControlService examControlService;
+
     @Autowired
     private ExamingSessionService examingSessionService;
+
     @Autowired
     private ExamFileAnswerService examFileAnswerService;
+
     @Autowired
     private UpyunService upyunService;
+
     @Autowired
     private RedisClient redisClient;
+
     @Autowired
     private ExamRecordDataService examRecordDataService;
 
@@ -460,4 +467,5 @@ public class ExamControlController extends ControllerSupport {
     public String courseName(@PathVariable Long id) {
         return examRecordDataService.findCourseNameById(id);
     }
+
 }

+ 8 - 8
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamDataCleanController.java

@@ -1,28 +1,28 @@
 package cn.com.qmth.examcloud.core.oe.student.api.controller;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.examcloud.core.oe.student.service.ExamDataCleanService;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 @Api(tags = "考试数据清理")
 @RestController
 @RequestMapping("${app.api.oe.student}/examDataClean")
 public class ExamDataCleanController extends ControllerSupport {
-	
+
     @Autowired
     private ExamDataCleanService examDataCleanService;
 
     @ApiOperation(value = "清理")
     @PutMapping("/clean")
     public void clean(@RequestParam(required = false) @ApiParam(value = "在此日期之前(yyyy-MM-dd HH:mm:ss)") String dateBefore) {
-    	examDataCleanService.cleanData(dateBefore);
+        examDataCleanService.cleanData(dateBefore);
     }
+
 }

+ 1 - 1
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamFaceLivenessVerifyController.java

@@ -131,7 +131,7 @@ public class ExamFaceLivenessVerifyController extends ControllerSupport {
         User user = getAccessUser();
 
         String bizNo = faceVerifyId + "_" + System.currentTimeMillis();
-//        ExamFaceLivenessVerifyEntity faceVerify = examFaceLivenessVerifyService.saveFaceVerifyByExamRecordDataId(examRecordDataId);
+        //        ExamFaceLivenessVerifyEntity faceVerify = examFaceLivenessVerifyService.saveFaceVerifyByExamRecordDataId(examRecordDataId);
         GetFaceVerifyTokenInfo getFaceVerifyTokenInfo = examFaceLivenessVerifyService.
                 getFaceVerifyToken(user.getUserId(), bizNo);
         getFaceVerifyTokenInfo.setFaceVerifyId(faceVerifyId);

+ 85 - 92
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamQuestionController.java

@@ -1,122 +1,115 @@
 package cn.com.qmth.examcloud.core.oe.student.api.controller;
 
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.support.examing.ExamQuestion;
-import cn.com.qmth.examcloud.support.examing.ExamRecordQuestions;
 import cn.com.qmth.examcloud.core.oe.student.base.utils.Check;
 import cn.com.qmth.examcloud.core.oe.student.bean.ExamStudentQuestionInfo;
 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.support.examing.ExamingHeartbeat;
-import cn.com.qmth.examcloud.support.examing.ExamingSession;
-import cn.com.qmth.examcloud.support.examing.ExamingStatus;
+import cn.com.qmth.examcloud.support.examing.*;
 import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
- * @author  	chenken
- * @date    	2018年9月5日 下午4:57:05
- * @company 	QMTH
+ * @author chenken
+ * @date 2018年9月5日 下午4:57:05
+ * @company QMTH
  * @description 考试作答记录controller
  */
 @Api(tags = "考试过程中-试题相关接口")
 @RestController
 @RequestMapping("${app.api.oe.student}/examQuestion")
 public class ExamQuestionController extends ControllerSupport {
-	
-	@Autowired
-	private ExamRecordQuestionsService examRecordQuestionsService;
-	
-	@Autowired
+
+    @Autowired
+    private ExamRecordQuestionsService examRecordQuestionsService;
+
+    @Autowired
     private ExamingSessionService examingSessionService;
-	
+
     @Autowired
     private RedisClient redisClient;
-	
-	/**
-	 * 将mongodb中的答过的题和redis中的题目列表合并返回给前端
-	 * 返回给前端时注意将正确答案和得分置成null
-	 * @return
-	 */
-	@ApiOperation(value = "考试过程中-获取试题列表")
-	@GetMapping("/findExamQuestionList")
-	public List<ExamQuestion> findExamQuestionList(){
-		User user = getAccessUser();
-		ExamingSession examSessionInfo = examingSessionService.getExamingSession(user.getUserId());
-		if (examSessionInfo == null
-				|| examSessionInfo.getExamingStatus().equals(ExamingStatus.INFORMAL)) {
-			throw new StatusException("1001", "考试会话已过期,请重新开考");
-		}
-        
+
+    /**
+     * 将mongodb中的答过的题和redis中的题目列表合并返回给前端
+     * 返回给前端时注意将正确答案和得分置成null
+     *
+     * @return
+     */
+    @ApiOperation(value = "考试过程中-获取试题列表")
+    @GetMapping("/findExamQuestionList")
+    public List<ExamQuestion> findExamQuestionList() {
+        User user = getAccessUser();
+        ExamingSession examSessionInfo = examingSessionService.getExamingSession(user.getUserId());
+        if (examSessionInfo == null
+                || examSessionInfo.getExamingStatus().equals(ExamingStatus.INFORMAL)) {
+            throw new StatusException("1001", "考试会话已过期,请重新开考");
+        }
+
         String examingHeartbeatKey = RedisKeyHelper.getBuilder().examingHeartbeatKey(examSessionInfo.getExamRecordDataId());
-        ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey,ExamingHeartbeat.class);
-        
-		if (null != examingHeartbeat
-				&& examingHeartbeat.getCost() >= examSessionInfo.getExamDuration()) {
-			throw new StatusException("1001", "考试会话已过期,请重新开考");
-		}
-        
-		ExamRecordQuestions qers = examRecordQuestionsService.getExamRecordQuestions(examSessionInfo.getExamRecordDataId());
-		List<ExamQuestion> examQuestionList=qers.getExamQuestions();
-		for(ExamQuestion examQuestion:examQuestionList){
-			examQuestion.setCorrectAnswer(null);
-			examQuestion.setStudentScore(null);
-		}
-		return examQuestionList;
-	}
+        ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey, ExamingHeartbeat.class);
+
+        if (null != examingHeartbeat
+                && examingHeartbeat.getCost() >= examSessionInfo.getExamDuration()) {
+            throw new StatusException("1001", "考试会话已过期,请重新开考");
+        }
+
+        ExamRecordQuestions qers = examRecordQuestionsService.getExamRecordQuestions(examSessionInfo.getExamRecordDataId());
+        List<ExamQuestion> examQuestionList = qers.getExamQuestions();
+        for (ExamQuestion examQuestion : examQuestionList) {
+            examQuestion.setCorrectAnswer(null);
+            examQuestion.setStudentScore(null);
+        }
+        return examQuestionList;
+    }
+
+    /**
+     * 获取试题内容
+     *
+     * @param questionId
+     * @return
+     */
+    @ApiOperation(value = "考试过程中-获取试题内容")
+    @GetMapping("/getQuestionContent")
+    public String getQuestionContent(@RequestParam String questionId) {
+        User user = getAccessUser();
+        Check.isBlank(questionId, "questionId不能为空");
+        return examRecordQuestionsService.getQuestionContent(user.getUserId(), questionId);
+    }
+
+    /**
+     * 考生作答
+     *
+     * @param examQuestionInfos
+     */
+    @ApiOperation(value = "考试过程中-考生作答:更新试题作答信息(包括提交试题答案,更新是否标记)")
+    @PostMapping("/submitQuestionAnswer")
+    public void submitQuestionAnswer(@RequestBody List<ExamStudentQuestionInfo> examQuestionInfos,
+                                     HttpServletRequest request) {
+        if (LOGGER.isDebugEnabled()) {
+            String strJosn = JsonUtil.toJson(examQuestionInfos);
+            LOGGER.debug("ExamQuestionController--submitQuestionAnswer参数信息:" + strJosn);
+        }
+        User user = getAccessUser();
+        if (examQuestionInfos != null && examQuestionInfos.size() > 0) {
+            for (ExamStudentQuestionInfo examStudentQuestionInfo : examQuestionInfos) {
+                if (examStudentQuestionInfo.getOrder() == null) {
+                    throw new StatusException("2001", "illegal params");
+                }
+            }
+            String referer = request.getHeader("REFERER");
+            String agent = request.getHeader("USER-AGENT");
+            examRecordQuestionsService.submitQuestionAnswer(user.getUserId(), examQuestionInfos, referer, agent);
+        }
+    }
 
-	/**
-	 * 获取试题内容
-	 * @param questionId
-	 * @return
-	 */
-	@ApiOperation(value = "考试过程中-获取试题内容")
-	@GetMapping("/getQuestionContent")
-	public String getQuestionContent(@RequestParam String questionId){
-		User user = getAccessUser();
-		Check.isBlank(questionId, "questionId不能为空");
-		return examRecordQuestionsService.getQuestionContent(user.getUserId(),questionId);
-	}
-	
-	/**
-	 * 考生作答
-	 * @param examQuestionInfos
-	 */
-	@ApiOperation(value = "考试过程中-考生作答:更新试题作答信息(包括提交试题答案,更新是否标记)")
-	@PostMapping("/submitQuestionAnswer")
-	public void submitQuestionAnswer(@RequestBody List<ExamStudentQuestionInfo> examQuestionInfos,
-									 HttpServletRequest request){
-		if(LOGGER.isDebugEnabled()) {
-			String strJosn=JsonUtil.toJson(examQuestionInfos);
-			LOGGER.debug("ExamQuestionController--submitQuestionAnswer参数信息:"+strJosn);
-		}
-		User user = getAccessUser();
-		if(examQuestionInfos!=null && examQuestionInfos.size()>0){
-			for(ExamStudentQuestionInfo examStudentQuestionInfo:examQuestionInfos){
-				if(examStudentQuestionInfo.getOrder() == null){
-					throw new StatusException("2001", "illegal params");
-				}
-			}
-			String referer = request.getHeader("REFERER");
-			String agent = request.getHeader("USER-AGENT");
-			examRecordQuestionsService.submitQuestionAnswer(user.getUserId(),examQuestionInfos,referer,agent);
-		}
-	}
 }

+ 20 - 22
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamRecordPaperStructController.java

@@ -1,38 +1,36 @@
 package cn.com.qmth.examcloud.core.oe.student.api.controller;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.examcloud.core.oe.student.base.utils.Check;
-import cn.com.qmth.examcloud.support.examing.ExamRecordPaperStruct;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordPaperStructService;
+import cn.com.qmth.examcloud.support.examing.ExamRecordPaperStruct;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
- * 
- * @author  	chenken
- * @date    	2018年9月5日 下午4:02:15
- * @company 	QMTH
+ * @author chenken
+ * @date 2018年9月5日 下午4:02:15
+ * @company QMTH
  * @description 考试记录-试卷结构controller
  */
 @Api(tags = "考试记录-试卷结构")
 @RestController
 @RequestMapping("${app.api.oe.student}/examRecordPaperStruct")
-public class ExamRecordPaperStructController extends ControllerSupport{
+public class ExamRecordPaperStructController extends ControllerSupport {
+
+    @Autowired
+    private ExamRecordPaperStructService examRecordPaperStructService;
+
+    @ApiOperation(value = "获取考试记录试卷结构")
+    @GetMapping("/getExamRecordPaperStruct")
+    public ExamRecordPaperStruct getExamRecordPaperStruct(@RequestParam Long examRecordDataId) {
+        Check.isNull(examRecordDataId, "examRecordDataId不能为空");
+        return examRecordPaperStructService.getExamRecordPaperStruct(examRecordDataId);
+    }
 
-	@Autowired
-	private ExamRecordPaperStructService examRecordPaperStructService;
-	
-	@ApiOperation(value = "获取考试记录试卷结构")
-	@GetMapping("/getExamRecordPaperStruct")
-	public ExamRecordPaperStruct getExamRecordPaperStruct(@RequestParam Long examRecordDataId){
-		Check.isNull(examRecordDataId, "examRecordDataId不能为空");
-		return examRecordPaperStructService.getExamRecordPaperStruct(examRecordDataId);
-	}
-	
 }

+ 36 - 38
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamSmsController.java

@@ -1,12 +1,5 @@
 package cn.com.qmth.examcloud.core.oe.student.api.controller;
 
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
@@ -22,9 +15,14 @@ import cn.com.qmth.examcloud.exchange.inner.api.response.SendSmsCodeResp;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
- * 
  * @author chenken
  * @date 2018年9月5日 下午3:33:26
  * @company QMTH
@@ -35,40 +33,40 @@ import io.swagger.annotations.ApiOperation;
 @RequestMapping("${app.api.oe.student}/sms")
 public class ExamSmsController extends ControllerSupport {
 
-	@Autowired
-	private StudentCloudService studentCloudService;
+    @Autowired
+    private StudentCloudService studentCloudService;
 
-	@Autowired
-	SmsCloudService smsCloudService;
+    @Autowired
+    SmsCloudService smsCloudService;
 
-	@ApiOperation(value = "发送短信验证码")
-	@PostMapping("/sendSmsCodeToStudent")
-	public SendSmsCodeResp sendSmsCodeToStudent() {
-		User user = getAccessUser();
-		GetStudentReq getStudentReq = new GetStudentReq();
-		getStudentReq.setStudentId(user.getUserId());
-		GetStudentResp getStudentResp = studentCloudService.getStudent(getStudentReq);
+    @ApiOperation(value = "发送短信验证码")
+    @PostMapping("/sendSmsCodeToStudent")
+    public SendSmsCodeResp sendSmsCodeToStudent() {
+        User user = getAccessUser();
+        GetStudentReq getStudentReq = new GetStudentReq();
+        getStudentReq.setStudentId(user.getUserId());
+        GetStudentResp getStudentResp = studentCloudService.getStudent(getStudentReq);
 
-		if (StringUtils.isBlank(getStudentResp.getStudentInfo().getPhoneNumber())) {
-			throw new StatusException("100001", "系统中手机号码为空,请联系管理员");
-		}
-		SendSmsCodeReq sendSmsReq = new SendSmsCodeReq();
-		sendSmsReq.setPhone(getStudentResp.getStudentInfo().getPhoneNumber());
-		sendSmsReq.setCode(CommonUtil.makeRandomNum(6));
+        if (StringUtils.isBlank(getStudentResp.getStudentInfo().getPhoneNumber())) {
+            throw new StatusException("100001", "系统中手机号码为空,请联系管理员");
+        }
+        SendSmsCodeReq sendSmsReq = new SendSmsCodeReq();
+        sendSmsReq.setPhone(getStudentResp.getStudentInfo().getPhoneNumber());
+        sendSmsReq.setCode(CommonUtil.makeRandomNum(6));
 
-		return smsCloudService.sendSmsCode(sendSmsReq);
-	}
+        return smsCloudService.sendSmsCode(sendSmsReq);
+    }
 
-	@ApiOperation(value = "检查验证码是否正确")
-	@PostMapping(value = "/checkSmsCode")
-	public CheckSmsCodeResp checkSmsCode(@RequestParam String phoneNumber,
-			@RequestParam String code) {
-		Check.isBlank(phoneNumber, "phoneNumber不能为空");
-		Check.isBlank(code, "code不能为空");
-		CheckSmsCodeReq checkSmsCodeReq = new CheckSmsCodeReq();
-		checkSmsCodeReq.setPhone(phoneNumber);
-		checkSmsCodeReq.setCode(code);
-		return smsCloudService.checkSmsCode(checkSmsCodeReq);
-	}
+    @ApiOperation(value = "检查验证码是否正确")
+    @PostMapping(value = "/checkSmsCode")
+    public CheckSmsCodeResp checkSmsCode(@RequestParam String phoneNumber,
+                                         @RequestParam String code) {
+        Check.isBlank(phoneNumber, "phoneNumber不能为空");
+        Check.isBlank(code, "code不能为空");
+        CheckSmsCodeReq checkSmsCodeReq = new CheckSmsCodeReq();
+        checkSmsCodeReq.setPhone(phoneNumber);
+        checkSmsCodeReq.setCode(code);
+        return smsCloudService.checkSmsCode(checkSmsCodeReq);
+    }
 
 }

+ 17 - 25
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/FaceBiopsyController.java

@@ -1,32 +1,14 @@
 package cn.com.qmth.examcloud.core.oe.student.api.controller;
 
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.core.oe.student.bean.FaceBiopsyBaseInfo;
-import cn.com.qmth.examcloud.core.oe.student.bean.FaceBiopsyInfo;
-import cn.com.qmth.examcloud.core.oe.student.bean.FaceBiopsyStepInfo;
-import cn.com.qmth.examcloud.core.oe.student.bean.SaveFaceBiopsyResultReq;
-import cn.com.qmth.examcloud.core.oe.student.bean.SaveFaceBiopsyResultResp;
+import cn.com.qmth.examcloud.core.oe.student.bean.*;
 import cn.com.qmth.examcloud.core.oe.student.dao.FaceBiopsyItemRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.FaceBiopsyItemStepRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.FaceBiopsyItemEntity;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.FaceBiopsyItemStepEntity;
 import cn.com.qmth.examcloud.core.oe.student.dao.enums.FaceBiopsyType;
-import cn.com.qmth.examcloud.core.oe.student.service.ExamControlService;
-import cn.com.qmth.examcloud.core.oe.student.service.ExamFaceLivenessVerifyService;
-import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
-import cn.com.qmth.examcloud.core.oe.student.service.ExamingSessionService;
-import cn.com.qmth.examcloud.core.oe.student.service.FaceBiopsyService;
+import cn.com.qmth.examcloud.core.oe.student.service.*;
 import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.support.enums.FaceBiopsyScheme;
@@ -42,6 +24,10 @@ import cn.com.qmth.examcloud.web.redis.RedisClient;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * @Description 人脸活体检测接口
@@ -53,14 +39,19 @@ import io.swagger.annotations.ApiOperation;
 @RestController
 @RequestMapping("${app.api.oe.student}/faceBiopsy")
 public class FaceBiopsyController extends ControllerSupport {
+
     @Autowired
     private ExamingSessionService examingSessionService;
+
     @Autowired
     private FaceBiopsyService faceBiopsyService;
+
     @Autowired
     private FaceBiopsyItemRepo faceBiopsyItemRepo;
+
     @Autowired
     private FaceBiopsyItemStepRepo faceBiopsyItemStepRepo;
+
     @Autowired
     private ExamRecordDataService examRecordDataService;
 
@@ -118,11 +109,11 @@ public class FaceBiopsyController extends ControllerSupport {
         else {
 
             String examingHeartbeatKey = RedisKeyHelper.getBuilder().examingHeartbeatKey(examSessionInfo.getExamRecordDataId());
-            ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey,ExamingHeartbeat.class);
+            ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey, ExamingHeartbeat.class);
 
-			int usedMinute = null == examingHeartbeat
-					? 0
-					: examingHeartbeat.getCost().intValue() / 60;
+            int usedMinute = null == examingHeartbeat
+                    ? 0
+                    : examingHeartbeat.getCost().intValue() / 60;
             faceVerifyMinute = examFaceLivenessVerifyService.getFaceLivenessVerifyMinute(user.getRootOrgId(),
                     orgId, examId, studentId, examRecordData.getId(), usedMinute);
         }
@@ -224,7 +215,7 @@ public class FaceBiopsyController extends ControllerSupport {
 
         //如果活检满足交卷条件,则系统自动交卷,自动交卷逻辑不应该影响活检保存结果,所以不能放一个事务中
         if (resp.getEndExam()) {
-            examControlService.handInExam(req.getExamRecordDataId(), HandInExamType.AUTO,null);
+            examControlService.handInExam(req.getExamRecordDataId(), HandInExamType.AUTO, null);
         }
         return resp;
     }
@@ -256,4 +247,5 @@ public class FaceBiopsyController extends ControllerSupport {
         }
         return true;
     }
+
 }

+ 17 - 7
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/provider/ExamRecordDataCloudServiceProvider.java

@@ -37,22 +37,31 @@ public class ExamRecordDataCloudServiceProvider extends ControllerSupport implem
      *
      */
     private static final long serialVersionUID = 6142107111834463854L;
+
     @Autowired
     private ExamRecordDataService examRecordDataService;
+
     @Autowired
     private ExamRecordDataRepo examRecordDataRepo;
+
     @Autowired
     private ExamFaceLivenessVerifyRepo examFaceLivenessVerifyRepo;
+
     @Autowired
     private FaceBiopsyRepo faceBiopsyRepo;
+
     @Autowired
     private FaceBiopsyItemRepo faceBiopsyItemRepo;
+
     @Autowired
     private FaceBiopsyItemStepRepo faceBiopsyItemStepRepo;
+
     @Autowired
     private ExamRecordPaperStructService examRecordPaperStructService;
+
     @Autowired
     private ExamRecordQuestionsService examRecordQuestionsService;
+
     @Autowired
     private ExamControlService examControlService;
 
@@ -258,7 +267,7 @@ public class ExamRecordDataCloudServiceProvider extends ControllerSupport implem
     @PostMapping("/handInExam")
     @Override
     public HandInExamResp handInExam(@RequestBody HandInExamReq req) {
-        examControlService.handInExam(req.getExamRecordDataId(), req.getHandInExamType(),req.getIp());
+        examControlService.handInExam(req.getExamRecordDataId(), req.getHandInExamType(), req.getIp());
 
         return new HandInExamResp();
     }
@@ -302,13 +311,14 @@ public class ExamRecordDataCloudServiceProvider extends ControllerSupport implem
         return res;
     }
 
-	@ApiOperation(value = "检查试卷是否已使用")
+    @ApiOperation(value = "检查试卷是否已使用")
     @PostMapping("/checkPaperInExam")
-	@Override
-	public CheckPaperInExamResp checkPaperInExam(@RequestBody CheckPaperInExamReq req) {
-		if (org.apache.commons.lang3.StringUtils.isBlank(req.getBasePaperId())) {
+    @Override
+    public CheckPaperInExamResp checkPaperInExam(@RequestBody CheckPaperInExamReq req) {
+        if (org.apache.commons.lang3.StringUtils.isBlank(req.getBasePaperId())) {
             throw new StatusException("500", "basePaperId不允许为空");
         }
-		return examRecordDataService.checkPaperInExam(req);
-	}
+        return examRecordDataService.checkPaperInExam(req);
+    }
+
 }

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

@@ -29,4 +29,5 @@ public interface ExamBossService {
      * @param examStudentId
      */
     public void deleteExamBoss(Long examStudentId);
+
 }

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

@@ -35,16 +35,16 @@ public interface ExamControlService {
      *
      * @param examRecordDataId 考试记录id
      * @param handInExamType   交卷类型
-     * @param ip 请求ip,可以为空
+     * @param ip               请求ip,可以为空
      */
-    void handInExam(Long examRecordDataId, HandInExamType handInExamType,@Null String ip);
+    void handInExam(Long examRecordDataId, HandInExamType handInExamType, @Null String ip);
 
     /**
      * 断点续考:检查正在进行中的考试
      *
      * @param studentId
      */
-    CheckExamInProgressInfo checkExamInProgress(Long studentId,String ip);
+    CheckExamInProgressInfo checkExamInProgress(Long studentId, String ip);
 
     /**
      * 考试心跳
@@ -89,6 +89,7 @@ public interface ExamControlService {
 
     /**
      * 获取二维码
+     *
      * @param req
      * @param user
      * @return
@@ -101,4 +102,5 @@ public interface ExamControlService {
      * @param examRecordDataId
      */
     void switchScreen(Long examRecordDataId);
+
 }

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

@@ -10,6 +10,6 @@ public interface ExamDataCleanService {
 
     public void cleanData(String dateBefore);
 
-	void disposeBatch(String dateBefore, Map<String, Integer> conutMap, List<Long> ids);
+    void disposeBatch(String dateBefore, Map<String, Integer> conutMap, List<Long> ids);
 
 }

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

@@ -75,7 +75,7 @@ public interface ExamFaceLivenessVerifyService {
      *
      * @param examId
      * @param examRecordDataId
-     * @param usedMinute 考试已用的分钟数
+     * @param usedMinute       考试已用的分钟数
      * @return
      */
     Integer getFaceLivenessVerifyMinute(Long rootOrgId, Long orgId, Long examId,

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

@@ -1,11 +1,5 @@
 package cn.com.qmth.examcloud.core.oe.student.service;
 
-import cn.com.qmth.examcloud.api.commons.security.bean.User;
-import cn.com.qmth.examcloud.core.oe.student.bean.FaceBiopsyInfo;
-import cn.com.qmth.examcloud.core.oe.student.bean.SaveFaceBiopsyResultReq;
-import cn.com.qmth.examcloud.core.oe.student.bean.SaveFaceBiopsyResultResp;
-import cn.com.qmth.examcloud.core.oe.student.bean.SaveUploadedFileReq;
-import cn.com.qmth.examcloud.core.oe.student.dao.enums.FaceBiopsyType;
 import cn.com.qmth.examcloud.support.examing.ExamFileAnswer;
 
 /**
@@ -18,21 +12,25 @@ public interface ExamFileAnswerService {
 
     /**
      * 保存文件作答结果
+     *
      * @param examFileAnswer
      * @return 返回主键id
      */
-    void saveFileAnswer(String fileAnswerId,ExamFileAnswer examFileAnswer);
+    void saveFileAnswer(String fileAnswerId, ExamFileAnswer examFileAnswer);
 
     /**
      * 删除文件作答记录
+     *
      * @param fileAnswerId
      */
     void deleteFileAnswer(String fileAnswerId);
 
     /**
-     *  获取文件作答结果
+     * 获取文件作答结果
+     *
      * @param fileAnswerId
      * @return
      */
     ExamFileAnswer getFileAnswer(String fileAnswerId);
+
 }

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

@@ -1,7 +1,5 @@
 package cn.com.qmth.examcloud.core.oe.student.service;
 
-import java.util.List;
-
 import cn.com.qmth.examcloud.core.oe.student.api.request.*;
 import cn.com.qmth.examcloud.core.oe.student.api.response.CalcExamScoreResp;
 import cn.com.qmth.examcloud.core.oe.student.api.response.CalcFaceBiopsyResultResp;
@@ -11,6 +9,8 @@ import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
 import cn.com.qmth.examcloud.support.examing.ExamRecordData;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
 
+import java.util.List;
+
 /**
  * @author chenken
  * @date 2018/8/15 11:16
@@ -20,7 +20,6 @@ import cn.com.qmth.examcloud.support.examing.ExamingSession;
 public interface ExamRecordDataService {
 
     /**
-     *
      * @param examingSession
      * @param examBean
      * @param courseBean
@@ -29,11 +28,10 @@ public interface ExamRecordDataService {
      * @return
      */
     ExamRecordData createExamRecordData(ExamingSession examingSession, ExamSettingsCacheBean examBean,
-                                        CourseCacheBean courseBean,String basePaperId,boolean isFullyObjective,
-                                        Long examStageId,Integer examStageOrder);
+                                        CourseCacheBean courseBean, String basePaperId, boolean isFullyObjective,
+                                        Long examStageId, Integer examStageOrder);
 
     /**
-     *
      * @param examRecordDataId
      * @param data
      */
@@ -41,6 +39,7 @@ public interface ExamRecordDataService {
 
     /**
      * 获取
+     *
      * @param examRecordDataId
      * @return
      */
@@ -48,6 +47,7 @@ public interface ExamRecordDataService {
 
     /**
      * 删除
+     *
      * @param examRecordDataId
      */
     void deleteExamRecordDataCache(Long examRecordDataId);
@@ -60,6 +60,7 @@ public interface ExamRecordDataService {
 
     /**
      * 计算活体检测结果
+     *
      * @param req
      * @return
      */
@@ -69,11 +70,13 @@ public interface ExamRecordDataService {
 
     /**
      * 更新部分考试记录数据
+     *
      * @param req
      */
     void updatePartialExamRecord(UpdatePartialExamRecordReq req);
 
     String findCourseNameById(Long id);
 
-	CheckPaperInExamResp checkPaperInExam(CheckPaperInExamReq req);
+    CheckPaperInExamResp checkPaperInExam(CheckPaperInExamReq req);
+
 }

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

@@ -16,7 +16,6 @@ public interface ExamRecordQuestionsService {
 
     /**
      * 保存
-     *
      */
     void saveExamQuestion(Long examRecordDataId, Integer order, ExamQuestion questions);
 

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

@@ -4,18 +4,19 @@ import cn.com.qmth.examcloud.support.examing.ExamingSession;
 
 /**
  * @author chenken
- *
  */
 public interface ExamingSessionService {
 
     /**
      * 保存
-     * @param timeout   秒
+     *
+     * @param timeout 秒
      */
-    public void saveExamingSession(Long studentId,ExamingSession examingSession);
+    public void saveExamingSession(Long studentId, ExamingSession examingSession);
 
     /**
      * 获取
+     *
      * @param studentId
      * @return
      */
@@ -23,7 +24,9 @@ public interface ExamingSessionService {
 
     /**
      * 删除
+     *
      * @param studentId
      */
     public void deleteExamingSession(Long studentId);
+
 }

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

@@ -23,6 +23,7 @@ public interface FaceBiopsyService {
 
     /**
      * 保存活体检测结果
+     *
      * @param req
      * @return
      */
@@ -30,8 +31,10 @@ public interface FaceBiopsyService {
 
     /**
      * 获取人脸活体检测开始分钟数
+     *
      * @param examRecordDataId 考试记录id
      * @return Integer
      */
     Integer calculateFaceBiopsyStartMinute(Long examRecordDataId);
+
 }

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

@@ -1,12 +1,11 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import cn.com.qmth.examcloud.core.oe.student.service.ExamBossService;
 import cn.com.qmth.examcloud.support.examing.ExamBoss;
 import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 /**
  * @author chenken
@@ -17,24 +16,25 @@ import cn.com.qmth.examcloud.web.redis.RedisClient;
 @Service("examBossService")
 public class ExamBossServiceImpl implements ExamBossService {
 
-	@Autowired
-	private RedisClient redisClient;
+    @Autowired
+    private RedisClient redisClient;
+
+    @Override
+    public void saveExamBoss(Long examStudentId, ExamBoss eb) {
+        String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
+        redisClient.set(key, eb, 2592000);
+    }
 
-	@Override
-	public void saveExamBoss(Long examStudentId, ExamBoss eb) {
-		String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
-		redisClient.set(key, eb, 2592000);
-	}
+    @Override
+    public ExamBoss getExamBoss(Long examStudentId) {
+        String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
+        return redisClient.get(key, ExamBoss.class);
+    }
 
-	@Override
-	public ExamBoss getExamBoss(Long examStudentId) {
-		String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
-		return redisClient.get(key, ExamBoss.class);
-	}
+    @Override
+    public void deleteExamBoss(Long examStudentId) {
+        String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
+        redisClient.delete(key);
+    }
 
-	@Override
-	public void deleteExamBoss(Long examStudentId) {
-		String key = RedisKeyHelper.getBuilder().examBossKey(examStudentId);
-		redisClient.delete(key);
-	}
 }

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

@@ -1451,7 +1451,7 @@ public class ExamControlServiceImpl implements ExamControlService {
         StartExamInfo startExamInfo = new StartExamInfo();
         startExamInfo.setExamRecordDataId(examRecordDataId);
         startExamInfo.setCourseName(courseBean.getName());
-//        startExamInfo.setDuration(examBean.getDuration());
+        //        startExamInfo.setDuration(examBean.getDuration());
         startExamInfo.setFaceVerifyMinute(getFaceVerifyMinute(examingSession.getRootOrgId(), examBean.getId(),
                 examingSession.getOrgId(), examingSession.getStudentId()));
         return startExamInfo;
@@ -1496,7 +1496,7 @@ public class ExamControlServiceImpl implements ExamControlService {
     public void initializeExamRecordSession(ExamingSession examSessionInfo, ExamRecordData examRecordData,
                                             final ExamSettingsCacheBean examBean) {
         examSessionInfo.setExamRecordDataId(examRecordData.getId());
-//        examSessionInfo.setStartTime(examRecordData.getStartTime().getTime());//调整为在作答页面时赋值
+        //        examSessionInfo.setStartTime(examRecordData.getStartTime().getTime());//调整为在作答页面时赋值
         examSessionInfo.setExamType(examBean.getExamType());
         examSessionInfo.setExamId(examBean.getId());
         // EXAM_RECONNECT_TIME:断点续考时间
@@ -1847,7 +1847,7 @@ public class ExamControlServiceImpl implements ExamControlService {
         //交卷时重新计算考试已用时间
         Long examUsedMilliSeconds = calcUsedExamSeconds(studentId) * 1000;
         //考试总时长
-//        long examTotalMilliSeconds = calcExamTotalMilliSeconds(examingSession.getExamRecordDataId());
+        //        long examTotalMilliSeconds = calcExamTotalMilliSeconds(examingSession.getExamRecordDataId());
         //如果开启场次,并且设置了定点交卷,且已到定点收卷时间,则不需要校验冻结时间,直接返回考试时长
         if (examingSession.getTimingEnd() && examingSession.getFixedSubmitTime().getTime() <= new Date().getTime()) {
             return examUsedMilliSeconds;
@@ -2099,4 +2099,5 @@ public class ExamControlServiceImpl implements ExamControlService {
         }
         throw new StatusException("500", "不处于指定开放时间,请稍后进入考试");
     }
+
 }

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

@@ -1,17 +1,5 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.DateUtil;
 import cn.com.qmth.examcloud.commons.util.ThreadLocalUtil;
@@ -20,130 +8,142 @@ import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
 import cn.com.qmth.examcloud.web.support.SpringContextHolder;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 
 @Service("examDataCleanService")
 public class ExamDataCleanServiceImpl implements ExamDataCleanService {
-	private static final Logger log = LoggerFactory.getLogger(ExamDataCleanService.class);
-
-	private static final String logPrefix = "ExamDataClean ";
-
-	@Autowired
-	private RedisClient redisClient;
-
-	@Autowired
-	private JdbcTemplate jdbcTemplate;
-
-	@Override
-	public void cleanData(String dateBefore) {
-		if (StringUtils.isNotBlank(dateBefore)) {
-			try {
-				DateUtil.parse(dateBefore, DateUtil.DatePatterns.CHINA_DEFAULT);
-			} catch (Exception e) {
-				throw new StatusException("日期格式错误,正确格式:" + DateUtil.DatePatterns.CHINA_DEFAULT);
-			}
-		}
-		if (redisClient.setIfAbsent(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX, ThreadLocalUtil.getTraceId(), 60)) {
-			try {
-				doLog("start");
-				diposeClean(dateBefore);
-			} finally {
-				redisClient.delete(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX);
-				doLog("finish");
-			}
-		} else {
-			throw new StatusException("有正在进行的数据清理操作,稍后再试");
-		}
-	}
-
-	private void diposeClean(String dateBefore) {
-		Long startId = -1L;
-		Map<String, Integer> conutMap = new LinkedHashMap<>();
-		conutMap.put("ec_oes_exam_continued_record", 0);
-		conutMap.put("ec_oes_exam_face_biopsy", 0);
-		conutMap.put("ec_oes_exam_face_biopsy_item", 0);
-		conutMap.put("ec_oes_exam_face_biopsy_item_step", 0);
-		conutMap.put("ec_oes_exam_face_liveness_verify", 0);
-		conutMap.put("ec_oes_exam_process_record", 0);
-		conutMap.put("ec_oes_exam_record_data", 0);
-		ExamDataCleanService serv = SpringContextHolder.getBean(ExamDataCleanService.class);
-		for (;;) {
-			List<Long> ids = findRecIds(startId, dateBefore);
-			if (ids == null || ids.size() == 0) {
-				break;
-			}
-			startId = ids.get(ids.size() - 1);
-			serv.disposeBatch(dateBefore, conutMap, ids);
-		}
-		for (String k : conutMap.keySet()) {
-			doLog(k + " delete count:" + conutMap.get(k));
-		}
-	}
-
-	@Transactional
-	@Override
-	public void disposeBatch(String dateBefore, Map<String, Integer> conutMap, List<Long> ids) {
-		for (Long examRecordDataId : ids) {
-			cleanCache(examRecordDataId);
-		}
-		diposeCleanSubTable("ec_oes_exam_continued_record", conutMap, ids);
-		diposeCleanSubTable("ec_oes_exam_face_biopsy", conutMap, ids);
-		diposeCleanSubTable("ec_oes_exam_face_biopsy_item", conutMap, ids);
-		diposeCleanSubTable("ec_oes_exam_face_biopsy_item_step", conutMap, ids);
-		diposeCleanSubTable("ec_oes_exam_face_liveness_verify", conutMap, ids);
-		diposeCleanSubTable("ec_oes_exam_process_record", conutMap, ids);
-		diposeRecordTable(conutMap, ids);
-	}
-
-	private void cleanCache(Long examRecordDataId) {
-		String examingActiveTimeKey = RedisKeyHelper.getBuilder().examingActiveTimeKey(examRecordDataId);
-		String examingHeartbeatKey = RedisKeyHelper.getBuilder().examingHeartbeatKey(examRecordDataId);
-		String examRecordDataKey = RedisKeyHelper.getBuilder().examRecordDataKey(examRecordDataId);
-		String studentPaperKey = RedisKeyHelper.getBuilder().studentPaperKey(examRecordDataId);
-		redisClient.delete(examingActiveTimeKey);
-		redisClient.delete(examingHeartbeatKey);
-		redisClient.delete(examRecordDataKey);
-		redisClient.delete(studentPaperKey);
-	}
-
-	private void diposeCleanSubTable(String tb, Map<String, Integer> conutMap, List<Long> ids) {
-		StringBuilder querySql = new StringBuilder().append(" delete from ").append(tb)
-				.append(" where exam_record_data_id in (");
-		querySql.append(StringUtils.join(ids, ","));
-		querySql.append(")");
-		int count = jdbcTemplate.update(querySql.toString());
-		conutMap.put(tb, conutMap.get(tb) + count);
-		refreshLock();
-	}
-
-	private void diposeRecordTable(Map<String, Integer> conutMap, List<Long> ids) {
-		String tb = "ec_oes_exam_record_data";
-		StringBuilder querySql = new StringBuilder().append(" delete from ec_oes_exam_record_data where id in(");
-		querySql.append(StringUtils.join(ids, ","));
-		querySql.append(")");
-		int count = jdbcTemplate.update(querySql.toString());
-		conutMap.put(tb, conutMap.get(tb) + count);
-		refreshLock();
-	}
-
-	private List<Long> findRecIds(Long startId, String dateBefore) {
-		StringBuilder querySql = new StringBuilder()
-				.append(" select id from  ec_oes_exam_record_data  where sync_status='SYNCED' and id>").append(startId);
-		if (StringUtils.isNotBlank(dateBefore)) {
-			querySql.append(" and creation_time <= STR_TO_DATE('").append(dateBefore)
-					.append("', '%Y-%m-%d %H:%i:%s') ");
-		}
-		querySql.append(" order by id limit 100");
-		List<Long> ids = jdbcTemplate.queryForList(querySql.toString(), Long.class);
-		refreshLock();
-		return ids;
-	}
-
-	private void doLog(String msg) {
-		log.warn(logPrefix + msg);
-	}
-	
-	private void refreshLock() {
-		redisClient.expire(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX, 60);
-	}
+
+    private static final Logger log = LoggerFactory.getLogger(ExamDataCleanService.class);
+
+    private static final String logPrefix = "ExamDataClean ";
+
+    @Autowired
+    private RedisClient redisClient;
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Override
+    public void cleanData(String dateBefore) {
+        if (StringUtils.isNotBlank(dateBefore)) {
+            try {
+                DateUtil.parse(dateBefore, DateUtil.DatePatterns.CHINA_DEFAULT);
+            } catch (Exception e) {
+                throw new StatusException("日期格式错误,正确格式:" + DateUtil.DatePatterns.CHINA_DEFAULT);
+            }
+        }
+        if (redisClient.setIfAbsent(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX, ThreadLocalUtil.getTraceId(), 60)) {
+            try {
+                doLog("start");
+                diposeClean(dateBefore);
+            } finally {
+                redisClient.delete(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX);
+                doLog("finish");
+            }
+        } else {
+            throw new StatusException("有正在进行的数据清理操作,稍后再试");
+        }
+    }
+
+    private void diposeClean(String dateBefore) {
+        Long startId = -1L;
+        Map<String, Integer> conutMap = new LinkedHashMap<>();
+        conutMap.put("ec_oes_exam_continued_record", 0);
+        conutMap.put("ec_oes_exam_face_biopsy", 0);
+        conutMap.put("ec_oes_exam_face_biopsy_item", 0);
+        conutMap.put("ec_oes_exam_face_biopsy_item_step", 0);
+        conutMap.put("ec_oes_exam_face_liveness_verify", 0);
+        conutMap.put("ec_oes_exam_process_record", 0);
+        conutMap.put("ec_oes_exam_record_data", 0);
+        ExamDataCleanService serv = SpringContextHolder.getBean(ExamDataCleanService.class);
+        for (; ; ) {
+            List<Long> ids = findRecIds(startId, dateBefore);
+            if (ids == null || ids.size() == 0) {
+                break;
+            }
+            startId = ids.get(ids.size() - 1);
+            serv.disposeBatch(dateBefore, conutMap, ids);
+        }
+        for (String k : conutMap.keySet()) {
+            doLog(k + " delete count:" + conutMap.get(k));
+        }
+    }
+
+    @Transactional
+    @Override
+    public void disposeBatch(String dateBefore, Map<String, Integer> conutMap, List<Long> ids) {
+        for (Long examRecordDataId : ids) {
+            cleanCache(examRecordDataId);
+        }
+        diposeCleanSubTable("ec_oes_exam_continued_record", conutMap, ids);
+        diposeCleanSubTable("ec_oes_exam_face_biopsy", conutMap, ids);
+        diposeCleanSubTable("ec_oes_exam_face_biopsy_item", conutMap, ids);
+        diposeCleanSubTable("ec_oes_exam_face_biopsy_item_step", conutMap, ids);
+        diposeCleanSubTable("ec_oes_exam_face_liveness_verify", conutMap, ids);
+        diposeCleanSubTable("ec_oes_exam_process_record", conutMap, ids);
+        diposeRecordTable(conutMap, ids);
+    }
+
+    private void cleanCache(Long examRecordDataId) {
+        String examingActiveTimeKey = RedisKeyHelper.getBuilder().examingActiveTimeKey(examRecordDataId);
+        String examingHeartbeatKey = RedisKeyHelper.getBuilder().examingHeartbeatKey(examRecordDataId);
+        String examRecordDataKey = RedisKeyHelper.getBuilder().examRecordDataKey(examRecordDataId);
+        String studentPaperKey = RedisKeyHelper.getBuilder().studentPaperKey(examRecordDataId);
+        redisClient.delete(examingActiveTimeKey);
+        redisClient.delete(examingHeartbeatKey);
+        redisClient.delete(examRecordDataKey);
+        redisClient.delete(studentPaperKey);
+    }
+
+    private void diposeCleanSubTable(String tb, Map<String, Integer> conutMap, List<Long> ids) {
+        StringBuilder querySql = new StringBuilder().append(" delete from ").append(tb)
+                .append(" where exam_record_data_id in (");
+        querySql.append(StringUtils.join(ids, ","));
+        querySql.append(")");
+        int count = jdbcTemplate.update(querySql.toString());
+        conutMap.put(tb, conutMap.get(tb) + count);
+        refreshLock();
+    }
+
+    private void diposeRecordTable(Map<String, Integer> conutMap, List<Long> ids) {
+        String tb = "ec_oes_exam_record_data";
+        StringBuilder querySql = new StringBuilder().append(" delete from ec_oes_exam_record_data where id in(");
+        querySql.append(StringUtils.join(ids, ","));
+        querySql.append(")");
+        int count = jdbcTemplate.update(querySql.toString());
+        conutMap.put(tb, conutMap.get(tb) + count);
+        refreshLock();
+    }
+
+    private List<Long> findRecIds(Long startId, String dateBefore) {
+        StringBuilder querySql = new StringBuilder()
+                .append(" select id from  ec_oes_exam_record_data  where sync_status='SYNCED' and id>").append(startId);
+        if (StringUtils.isNotBlank(dateBefore)) {
+            querySql.append(" and creation_time <= STR_TO_DATE('").append(dateBefore)
+                    .append("', '%Y-%m-%d %H:%i:%s') ");
+        }
+        querySql.append(" order by id limit 100");
+        List<Long> ids = jdbcTemplate.queryForList(querySql.toString(), Long.class);
+        refreshLock();
+        return ids;
+    }
+
+    private void doLog(String msg) {
+        log.warn(logPrefix + msg);
+    }
+
+    private void refreshLock() {
+        redisClient.expire(Constants.EXAM_DATA_CLEAN_LOCK_PREFIX, 60);
+    }
 
 }

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

@@ -68,6 +68,7 @@ public class ExamFaceLivenessVerifyServiceImpl implements ExamFaceLivenessVerify
 
     @Autowired
     private ExamControlService examControlService;
+
     @Autowired
     SystemProperties systemProperties;
 
@@ -239,7 +240,7 @@ public class ExamFaceLivenessVerifyServiceImpl implements ExamFaceLivenessVerify
 
         //如果活体检失败,需要清除会话并自动交卷
         if (IsSuccess.strToEnum(result) == IsSuccess.FAILED) {
-            examControlService.handInExam(examRecordDataId, HandInExamType.AUTO,null);
+            examControlService.handInExam(examRecordDataId, HandInExamType.AUTO, null);
         }
     }
 
@@ -283,7 +284,7 @@ public class ExamFaceLivenessVerifyServiceImpl implements ExamFaceLivenessVerify
          * 1:开启屏幕翻拍检测(若检测屏幕翻拍,返回值将增加屏幕翻拍的结果返回)
          * 注:由于PC端的某些摄像头的驱动,自带增加摄像头视频特效等功能。开启屏幕翻拍检测之后,有可能导致误检增加。
          */
-        multipartEntityBuilder.addTextBody("screen_replay","1");
+        multipartEntityBuilder.addTextBody("screen_replay", "1");
 
         multipartEntityBuilder.addBinaryBody("image_ref1", basePhotoFile);
         return multipartEntityBuilder;
@@ -346,4 +347,5 @@ public class ExamFaceLivenessVerifyServiceImpl implements ExamFaceLivenessVerify
 
         return null;
     }
+
 }

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

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
  */
 @Service("examFileAnswerService")
 public class ExamFileAnswerServiceImpl implements ExamFileAnswerService {
+
     @Autowired
     private RedisClient redisClient;
 
@@ -47,6 +48,7 @@ public class ExamFileAnswerServiceImpl implements ExamFileAnswerService {
      */
     @Override
     public ExamFileAnswer getFileAnswer(String fileAnswerId) {
-        return redisClient.get(fileAnswerId,ExamFileAnswer.class);
+        return redisClient.get(fileAnswerId, ExamFileAnswer.class);
     }
+
 }

+ 45 - 48
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamProcessRecordServiceImpl.java

@@ -1,15 +1,10 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
 import cn.com.qmth.examcloud.commons.util.DateUtil;
-import cn.com.qmth.examcloud.core.oe.student.base.utils.DateUtils;
 import cn.com.qmth.examcloud.core.oe.student.bean.ExamProcessRecordInfo;
 import cn.com.qmth.examcloud.core.oe.student.dao.ExamProcessRecordRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamProcessRecordEntity;
-import cn.com.qmth.examcloud.core.oe.student.service.ExamBossService;
 import cn.com.qmth.examcloud.core.oe.student.service.ExamProcessRecordService;
-import cn.com.qmth.examcloud.support.examing.ExamBoss;
-import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
-import cn.com.qmth.examcloud.web.redis.RedisClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -25,52 +20,54 @@ import java.util.List;
  */
 @Service("examProcessRecordService")
 public class ExamProcessRecordServiceImpl implements ExamProcessRecordService {
-	@Autowired
-	private ExamProcessRecordRepo examProcessRecordRepo;
 
-	/**
-	 * 保存考试记录
-	 *
-	 * @param examRecordDataId
-	 * @param processName
-	 * @param recordTime
-	 * @param sourceIp
-	 */
-	@Override
-	public void saveExamProcessRecord(Long examRecordDataId, String processName, Date recordTime, String sourceIp) {
-		ExamProcessRecordEntity entity = new ExamProcessRecordEntity();
-		entity.setExamRecordDataId(examRecordDataId);
-		entity.setProcessName(processName);
-		entity.setRecordTime(recordTime);
-		entity.setSourceIp(sourceIp);
+    @Autowired
+    private ExamProcessRecordRepo examProcessRecordRepo;
 
-		examProcessRecordRepo.save(entity);
-	}
+    /**
+     * 保存考试记录
+     *
+     * @param examRecordDataId
+     * @param processName
+     * @param recordTime
+     * @param sourceIp
+     */
+    @Override
+    public void saveExamProcessRecord(Long examRecordDataId, String processName, Date recordTime, String sourceIp) {
+        ExamProcessRecordEntity entity = new ExamProcessRecordEntity();
+        entity.setExamRecordDataId(examRecordDataId);
+        entity.setProcessName(processName);
+        entity.setRecordTime(recordTime);
+        entity.setSourceIp(sourceIp);
 
-	/**
-	 * 获取考试过程记录
-	 *
-	 * @param examRecordDataId
-	 * @return
-	 */
-	@Override
-	public List<ExamProcessRecordInfo> getExamProcessRecords(Long examRecordDataId) {
-		List<ExamProcessRecordEntity> recordList =
-				examProcessRecordRepo.findByExamRecordDataIdOrderByRecordTime(examRecordDataId);
-		List<ExamProcessRecordInfo> resultList = new ArrayList<>();
-		if (null != recordList && !recordList.isEmpty()) {
-			for (ExamProcessRecordEntity record : recordList) {
-				ExamProcessRecordInfo info=new ExamProcessRecordInfo();
-				info.setId(record.getId());
-				info.setExamRecordDataId(record.getExamRecordDataId());
-				info.setProcessName(record.getProcessName());
-				info.setRecordTime(DateUtil.format(record.getRecordTime(), DateUtil.DatePatterns.CHINA_DEFAULT));
-				info.setSourceIp(record.getSourceIp());
+        examProcessRecordRepo.save(entity);
+    }
 
-				resultList.add(info);
-			}
-		}
+    /**
+     * 获取考试过程记录
+     *
+     * @param examRecordDataId
+     * @return
+     */
+    @Override
+    public List<ExamProcessRecordInfo> getExamProcessRecords(Long examRecordDataId) {
+        List<ExamProcessRecordEntity> recordList =
+                examProcessRecordRepo.findByExamRecordDataIdOrderByRecordTime(examRecordDataId);
+        List<ExamProcessRecordInfo> resultList = new ArrayList<>();
+        if (null != recordList && !recordList.isEmpty()) {
+            for (ExamProcessRecordEntity record : recordList) {
+                ExamProcessRecordInfo info = new ExamProcessRecordInfo();
+                info.setId(record.getId());
+                info.setExamRecordDataId(record.getExamRecordDataId());
+                info.setProcessName(record.getProcessName());
+                info.setRecordTime(DateUtil.format(record.getRecordTime(), DateUtil.DatePatterns.CHINA_DEFAULT));
+                info.setSourceIp(record.getSourceIp());
+
+                resultList.add(info);
+            }
+        }
+
+        return resultList;
+    }
 
-		return resultList;
-	}
 }

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

@@ -4,13 +4,7 @@ import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
 import cn.com.qmth.examcloud.api.commons.enums.ExamStageStartExamStatus;
 import cn.com.qmth.examcloud.api.commons.enums.ExamType;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.core.oe.student.api.request.CalcExamScoreReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.CalcFaceBiopsyResultReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.CheckPaperInExamReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.GetExamRecordDataIdsReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.UpdateExamRecordDataBatchNumReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.UpdateExamRecordStatusReq;
-import cn.com.qmth.examcloud.core.oe.student.api.request.UpdatePartialExamRecordReq;
+import cn.com.qmth.examcloud.core.oe.student.api.request.*;
 import cn.com.qmth.examcloud.core.oe.student.api.response.CalcExamScoreResp;
 import cn.com.qmth.examcloud.core.oe.student.api.response.CalcFaceBiopsyResultResp;
 import cn.com.qmth.examcloud.core.oe.student.api.response.CheckPaperInExamResp;
@@ -83,8 +77,8 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
     @Transactional
     @Override
     public ExamRecordData createExamRecordData(ExamingSession examingSession, ExamSettingsCacheBean examBean,
-                                               CourseCacheBean courseBean, String basePaperId,boolean isFullyObjective,
-                                               Long examStageId,Integer examStageOrder) {
+                                               CourseCacheBean courseBean, String basePaperId, boolean isFullyObjective,
+                                               Long examStageId, Integer examStageOrder) {
         ExamRecordDataEntity examRecordData = new ExamRecordDataEntity();
         examRecordData.setExamId(examBean.getId());
         examRecordData.setExamType(ExamType.valueOf(examBean.getExamType()));
@@ -216,12 +210,12 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         if (size > 200) {
             throw new StatusException("1004", "size 最大为200");
         }
-        List<Long> ids=new ArrayList<Long>();
+        List<Long> ids = new ArrayList<Long>();
         List<ExamRecordDataEntity> list = examRecordDataRepo.getLimitExamRecordDataList(batchNum, startId, size);
-        if(list!=null&&list.size()!=0) {
-        	for(ExamRecordDataEntity e:list) {
-    			ids.add(e.getId());
-        	}
+        if (list != null && list.size() != 0) {
+            for (ExamRecordDataEntity e : list) {
+                ids.add(e.getId());
+            }
         }
         return ids;
     }
@@ -363,17 +357,17 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
     @Override
     public void updatePartialExamRecord(UpdatePartialExamRecordReq req) {
         if (null == req.getId()) {
-            throw new StatusException("300001","考试记录id不允许为空");
+            throw new StatusException("300001", "考试记录id不允许为空");
         }
 
         if (StringUtils.isNotEmpty(req.getSyncStatus())) {
             try {
                 SyncStatus.valueOf(req.getSyncStatus());
             } catch (IllegalArgumentException e) {
-                throw new StatusException("300002","同步状态值不正确");
+                throw new StatusException("300002", "同步状态值不正确");
             }
 
-            examRecordDataRepo.updateExamRecordSyncStatusById(req.getSyncStatus(),req.getId());
+            examRecordDataRepo.updateExamRecordSyncStatusById(req.getSyncStatus(), req.getId());
         }
     }
 
@@ -430,15 +424,16 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         examRecordDataRepo.updateExamRecordStatusById(status, id);
     }
 
-	@Override
-	public CheckPaperInExamResp checkPaperInExam(CheckPaperInExamReq req) {
-		Long id=examRecordDataRepo.getRecordIdByPaperId(req.getBasePaperId());
-		CheckPaperInExamResp res=new CheckPaperInExamResp();
-		if(id==null) {
-			res.setInExam(false);
-		}else {
-			res.setInExam(true);
-		}
-		return res;
-	}
+    @Override
+    public CheckPaperInExamResp checkPaperInExam(CheckPaperInExamReq req) {
+        Long id = examRecordDataRepo.getRecordIdByPaperId(req.getBasePaperId());
+        CheckPaperInExamResp res = new CheckPaperInExamResp();
+        if (id == null) {
+            res.setInExam(false);
+        } else {
+            res.setInExam(true);
+        }
+        return res;
+    }
+
 }

+ 1 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordPaperStructServiceImpl.java

@@ -49,4 +49,5 @@ public class ExamRecordPaperStructServiceImpl implements ExamRecordPaperStructSe
 
         return resp;
     }
+
 }

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

@@ -29,6 +29,7 @@ import com.google.common.cache.CacheBuilder;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -187,8 +188,8 @@ public class ExamRecordQuestionsServiceImpl implements ExamRecordQuestionsServic
         }
         long examRecordDataId = examSessionInfo.getExamRecordDataId();
 
-        if(StringUtils.isEmpty(referer) || StringUtils.isEmpty(agent) || !agent.contains("electron-exam-shell")){
-            redisClient.set("OE_SESSION_WARN_"+examSessionInfo.getExamRecordDataId(), true,12 * 60 * 60);
+        if (StringUtils.isEmpty(referer) || StringUtils.isEmpty(agent) || !agent.contains("electron-exam-shell")) {
+            redisClient.set("OE_SESSION_WARN_" + examSessionInfo.getExamRecordDataId(), true, 12 * 60 * 60);
         }
 
         for (ExamStudentQuestionInfo examQuestionInfo : examQuestionInfos) {
@@ -304,4 +305,5 @@ public class ExamRecordQuestionsServiceImpl implements ExamRecordQuestionsServic
         eq.setAudioPlayTimes(temp.getAudioPlayTimes());
         eq.setAnswerType(temp.getAnswerType());
     }
+
 }

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

@@ -1,12 +1,11 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import cn.com.qmth.examcloud.core.oe.student.service.ExamingSessionService;
 import cn.com.qmth.examcloud.support.examing.ExamingSession;
 import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 /**
  * @author chenken
@@ -23,13 +22,13 @@ public class ExamingSessionServiceImpl implements ExamingSessionService {
     @Override
     public void saveExamingSession(Long studentId, ExamingSession examingSession) {
         String key = RedisKeyHelper.getBuilder().examingSessionKey(studentId);
-        redisClient.set(key,examingSession,2592000);
+        redisClient.set(key, examingSession, 2592000);
     }
 
     @Override
     public ExamingSession getExamingSession(Long studentId) {
         String key = RedisKeyHelper.getBuilder().examingSessionKey(studentId);
-        return redisClient.get(key,ExamingSession.class);
+        return redisClient.get(key, ExamingSession.class);
     }
 
     @Override
@@ -37,4 +36,5 @@ public class ExamingSessionServiceImpl implements ExamingSessionService {
         String key = RedisKeyHelper.getBuilder().examingSessionKey(studentId);
         redisClient.delete(key);
     }
+
 }

+ 15 - 12
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/FaceBiopsyServiceImpl.java

@@ -1,17 +1,5 @@
 package cn.com.qmth.examcloud.core.oe.student.service.impl;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.RandomUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.google.common.collect.Lists;
-
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.JsonUtil;
 import cn.com.qmth.examcloud.core.oe.student.base.utils.CommonUtil;
@@ -42,6 +30,16 @@ import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
 import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
 import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.RandomUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description 人脸活体检测接口实现类
@@ -54,14 +52,19 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
 
     @Autowired
     private FaceBiopsyRepo faceBiopsyRepo;
+
     @Autowired
     private FaceBiopsyItemRepo faceBiopsyItemRepo;
+
     @Autowired
     private FaceBiopsyItemStepRepo faceBiopsyItemStepRepo;
+
     @Autowired
     private ExamRecordDataService examRecordDataService;
+
     @Autowired
     ExamingSessionService examingSessionService;
+
     @Autowired
     private RedisClient redisClient;