wangliang hace 1 año
padre
commit
787ed1b04c

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

@@ -157,9 +157,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         if (Objects.isNull(examId)) {
             Map<String, Set<Long>> examList = themisCacheService.getOrgExamListCache(orgId.toString());
             if (!CollectionUtils.isEmpty(examList)) {
-//                examList = examList.entrySet().stream()
-//                        .sorted(Map.Entry.comparingByKey())
-//                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new));
+                examList = examList.entrySet().stream()
+                        .sorted(Map.Entry.comparingByKey())
+                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new));
                 for (Map.Entry<String, Set<Long>> entry : examList.entrySet()) {
                     List<TEExamActivityWaitDto> teExamActivityWaitList = teExamActivityService.getWaitingExam(studentId, entry.getValue(), null);
                     list = this.waitingExamCommon(list, teExamActivityWaitList);
@@ -168,7 +168,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         } else {
             Set<Long> examActivityIdSet = themisCacheService.getOrgExamListCache(orgId.toString(), examId.toString());
             if (!CollectionUtils.isEmpty(examActivityIdSet)) {
-//                examActivityIdSet = examActivityIdSet.stream().sorted().collect(Collectors.toCollection(LinkedHashSet::new));
+                examActivityIdSet = examActivityIdSet.stream().sorted().collect(Collectors.toCollection(LinkedHashSet::new));
                 List<TEExamActivityWaitDto> teExamActivityWaitList = teExamActivityService.getWaitingExam(studentId, examActivityIdSet, null);
                 list = this.waitingExamCommon(list, teExamActivityWaitList);
             }