wangliang 3 lat temu
rodzic
commit
3838e3d842

+ 16 - 14
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -135,7 +135,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name,
-            String mode, Integer enable, Long orgId, String type) {
+                                           String mode, Integer enable, Long orgId, String type) {
         return teExamMapper.examQuery(iPage, userId, id, code, name, mode, enable, orgId, type);
     }
 
@@ -152,7 +152,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         List<TEExamWaitDto> list = teExamMapper.getWaitingExam(studentId, examId, orgId);
         if (Objects.nonNull(list) && list.size() > 0) {
             Set<String> examActivityIdsTemp = new LinkedHashSet<>();
+            Map<Long, TEExamWaitDto> setList = new LinkedHashMap<>();
             for (TEExamWaitDto t : list) {
+                setList.put(t.getId(), t);
                 if (t.getExamActivityId().indexOf(",") != -1) {
                     examActivityIdsTemp.addAll(Arrays.asList(t.getExamActivityId().split(",")));
                 } else {
@@ -183,8 +185,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                                 examCache.getExamCount().intValue() - (examStudentCacheBean.getAlreadyExamCount()
                                         .intValue())));
             });
-            list.forEach(s -> {
-                s.setActivities(new ArrayList<>(map.get(s.getId())));
+            setList.forEach((k, v) -> {
+                v.setActivities(new ArrayList<>(map.get(k)));
             });
         }
         return list;
@@ -469,14 +471,14 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                 if (Objects.isNull(clientCameraStatus) || Objects
                         .equals(MonitorStatusSourceEnum.STOP, clientCameraStatus)) {
                     switch (strs[i]) {
-                    case "CLIENT_CAMERA":
-                        throw new BusinessException(ExceptionResultEnum.CLIENT_CAMERA_OFFLINE);
-                    case "CLIENT_SCREEN":
-                        throw new BusinessException(ExceptionResultEnum.CLIENT_SCREEN_OFFLINE);
-                    case "MOBILE_FIRST":
-                        throw new BusinessException(ExceptionResultEnum.MOBILE_FIRST_OFFLINE);
-                    default:
-                        throw new BusinessException(ExceptionResultEnum.MOBILE_SECOND_OFFLINE);
+                        case "CLIENT_CAMERA":
+                            throw new BusinessException(ExceptionResultEnum.CLIENT_CAMERA_OFFLINE);
+                        case "CLIENT_SCREEN":
+                            throw new BusinessException(ExceptionResultEnum.CLIENT_SCREEN_OFFLINE);
+                        case "MOBILE_FIRST":
+                            throw new BusinessException(ExceptionResultEnum.MOBILE_FIRST_OFFLINE);
+                        default:
+                            throw new BusinessException(ExceptionResultEnum.MOBILE_SECOND_OFFLINE);
                     }
                 }
             }
@@ -613,7 +615,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      */
     @Override
     public AnswerSubmitBean answerSubmit(Long studentId, Long recordId, Integer mainNumber, Integer subNumber,
-            Integer subIndex, String answer, Long version, Integer durationSeconds) {
+                                         Integer subIndex, String answer, Long version, Integer durationSeconds) {
 
         // 校验当前登录用户和参数一致性
         if (ExamRecordCacheUtil.getId(recordId) == null) {
@@ -795,7 +797,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      */
     @Override
     public AudioLeftPlayCountSubmitBean audioLeftPlayCountSubmit(Long studentId, Long recordId, String key,
-            Integer count) {
+                                                                 Integer count) {
 
         // 校验当前登录用户和参数一致性
         if (ExamRecordCacheUtil.getId(recordId) == null) {
@@ -1397,7 +1399,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      */
     @Override
     public void sendOeLogMessage(SystemOperationEnum systemOperationEnum, Long examStudentId, Long recordId,
-            MqDto mqDto) {
+                                 MqDto mqDto) {
         //mq发送消息start
         Map<String, Object> properties = new HashMap<>();
         properties.put(SystemConstant.REMARK, systemOperationEnum.getCode());