wangliang 4 anni fa
parent
commit
1661866659

+ 3 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -1156,6 +1156,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
         ExamingDataCacheUtil.deleteUnFinishedRecordId(studentId);
         redisUtil.setStudent(teStudentCacheDto.getId(), teStudentCacheDto);
+
+        MqDto mobileMqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_STOP.name(), recordId, MqTagEnum.EXAM_STOP, String.valueOf(recordId), Collections.singletonMap(SystemConstant.RECORD_ID, recordId), String.valueOf(recordId));
+        mqDtoService.assembleSendOneWayMsg(mobileMqDto);
         //异步持久化
         checkToPersisted(recordId);
         //mq发送消息start

+ 1 - 3
themis-exam/src/main/java/com/qmth/themis/exam/api/TEExamController.java

@@ -300,9 +300,7 @@ public class TEExamController {
             if (param.getDurationSeconds() == null) {
                 throw new BusinessException("总用时秒数不能为空");
             }
-            Result re = ResultUtil.ok(teExamService.finish(teStudent.getId(), param.getRecordId(), param.getType(), param.getDurationSeconds()));
-            ExamConstant.sendExamStopMsg(param.getRecordId(), false, true);
-            return re;
+            return ResultUtil.ok(teExamService.finish(teStudent.getId(), param.getRecordId(), param.getType(), param.getDurationSeconds()));
         } finally {
             redisUtil.releaseLock(lockKey);
         }