|
@@ -187,13 +187,17 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
teExamActivityWaitList.forEach(i -> {
|
|
|
ExamCacheBean examCache = getExamCacheBeanNative(i.getExamId());
|
|
|
TEExamWaitDto teExamWaitDto = new TEExamWaitDto(i.getExamId(), i.getExamActivityId(), examCache.getName(), examCache.getCode());
|
|
|
- setMap.put(i.getExamId(), teExamWaitDto);
|
|
|
- Set<TEExamActivityWaitDto> teExamActivityWaitDtos = Objects.nonNull(map.get(i.getExamId())) ? map.get(i.getExamId()) : new LinkedHashSet<>();
|
|
|
- teExamActivityWaitDtos.add(i);
|
|
|
- map.put(i.getExamId(), teExamActivityWaitDtos);
|
|
|
- ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(i.getExamStudentId());
|
|
|
- Integer leftExamCount = examCache.getExamCount().intValue() - examStudentCacheBean.getAlreadyExamCount().intValue() < 0 ? 0 : examCache.getExamCount().intValue() - examStudentCacheBean.getAlreadyExamCount().intValue();
|
|
|
- i.setLeftExamCount(leftExamCount);
|
|
|
+ if (Objects.nonNull(examCache.getEnable()) && Objects.nonNull(i.getEnable())
|
|
|
+ && examCache.getEnable().intValue() == 1 && i.getEnable().intValue() == 1
|
|
|
+ && i.getFinishTime().longValue() < System.currentTimeMillis()) {
|
|
|
+ setMap.put(i.getExamId(), teExamWaitDto);
|
|
|
+ Set<TEExamActivityWaitDto> teExamActivityWaitDtos = Objects.nonNull(map.get(i.getExamId())) ? map.get(i.getExamId()) : new LinkedHashSet<>();
|
|
|
+ teExamActivityWaitDtos.add(i);
|
|
|
+ map.put(i.getExamId(), teExamActivityWaitDtos);
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(i.getExamStudentId());
|
|
|
+ Integer leftExamCount = examCache.getExamCount().intValue() - examStudentCacheBean.getAlreadyExamCount().intValue() < 0 ? 0 : examCache.getExamCount().intValue() - examStudentCacheBean.getAlreadyExamCount().intValue();
|
|
|
+ i.setLeftExamCount(leftExamCount);
|
|
|
+ }
|
|
|
});
|
|
|
setMap.forEach((k, v) -> {
|
|
|
v.setActivities(new ArrayList<>(map.get(k)));
|