|
@@ -305,16 +305,17 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
examRoomStatisticsInfo.setExamRoomNum(examRooms.size());
|
|
|
examRoomStatisticsInfo.setFirstExamTime(examRooms.stream().min(Comparator.comparing(ExamRoom::getExamStartTime)).get().getExamStartTime());
|
|
|
examRoomStatisticsInfo.setLastExamTime(examRooms.stream().max(Comparator.comparing(ExamRoom::getExamStartTime)).get().getExamStartTime());
|
|
|
- int teacherNum=0;
|
|
|
+ Set<Integer> teacherIds=new HashSet<>();
|
|
|
for (ExamRoom examRoom : examRooms) {
|
|
|
if(Objects.nonNull(examRoom.getMainTeacherUserId())){
|
|
|
- teacherNum+=1;
|
|
|
+ teacherIds.add(examRoom.getMainTeacherUserId());
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(examRoom.getAssistantTeacherUserIdList())){
|
|
|
- teacherNum = teacherNum + StringUtils.countMatches(examRoom.getAssistantTeacherUserIdList(), ",") + 1;
|
|
|
+ Set<Integer> assistantTeacherIds = Arrays.stream(examRoom.getAssistantTeacherUserIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toSet());
|
|
|
+ teacherIds.addAll(assistantTeacherIds);
|
|
|
}
|
|
|
}
|
|
|
- examRoomStatisticsInfo.setExamRoomTeacherNum(teacherNum);
|
|
|
+ examRoomStatisticsInfo.setExamRoomTeacherNum(teacherIds.size());
|
|
|
}
|
|
|
|
|
|
return examRoomStatisticsInfo;
|