Bladeren bron

修复BUG

wangliang 3 jaren geleden
bovenliggende
commit
f617702466
1 gewijzigde bestanden met toevoegingen van 11 en 4 verwijderingen
  1. 11 4
      themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java

+ 11 - 4
themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java

@@ -7,6 +7,7 @@ import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.bean.exam.*;
 import com.qmth.themis.business.cache.ExamBreakCacheUtil;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
+import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
@@ -18,10 +19,7 @@ import com.qmth.themis.business.enums.ExamRecordStatusEnum;
 import com.qmth.themis.business.enums.ExceptionEnum;
 import com.qmth.themis.business.enums.MqTagEnum;
 import com.qmth.themis.business.enums.SystemOperationEnum;
-import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TEExamService;
-import com.qmth.themis.business.service.TOeExamBreakHistoryService;
-import com.qmth.themis.business.service.TOeExamRecordService;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.MqUtil;
 import com.qmth.themis.business.util.RedisUtil;
@@ -65,6 +63,9 @@ public class TEExamController {
     @Resource
     MqUtil mqUtil;
 
+    @Resource
+    TEExamStudentService teExamStudentService;
+
     @ApiOperation(value = "验证考试口令接口")
     @RequestMapping(value = "/short_code", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试信息", response = TEExam.class)})
@@ -148,6 +149,12 @@ public class TEExamController {
             WebSocketOeServer webSocketOeServer = webSocketMap.get(clientWebsocketId);
             WebSocketOeServer.close(webSocketOeServer);
         }
+
+        Long examStudentId = ExamRecordCacheUtil.getExamStudentId(Long.parseLong(recordId));
+        ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
+        Optional.ofNullable(examStudentCacheBean).orElseThrow(() -> new BusinessException("考生数据为空"));
+
+        SystemConstant.mobileMonitorStatusStop(examStudentCacheBean.getStudentId(), Long.parseLong(recordId), true);
         return ResultUtil.ok(true);
     }