Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
ae1bfebb55

+ 3 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -281,13 +281,14 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(CollectionUtils.isEmpty(examRooms)){
 			throw new BizException("请先建立考场");
 		}
-		Map<String, List<ExamRoom>> subjectExamRoomMap = examRooms.stream().collect(Collectors.groupingBy(ExamRoom::getSubjectIdList));
+//		Map<String, List<ExamRoom>> subjectExamRoomMap = examRooms.stream().collect(Collectors.groupingBy(ExamRoom::getSubjectIdList));
 
 		List<ExamRoomStudentRelation> newRoomStudents = new ArrayList<>();
 
 		for (Map.Entry<Integer, List<ExamRegistration>> subjectRegistEntry : subjectRegistMap.entrySet()) {
 			List<ExamRegistration> subjectRegists = subjectRegistEntry.getValue();
-			List<ExamRoom> subjectRooms = subjectExamRoomMap.get(subjectRegistEntry.getKey().toString());
+//			List<ExamRoom> subjectRooms = subjectExamRoomMap.get(subjectRegistEntry.getKey().toString());
+			List<ExamRoom> subjectRooms = examRooms.stream().filter(e-> Arrays.stream(e.getSubjectIdList().split(",")).collect(Collectors.toSet()).contains(subjectRegistEntry.getKey().toString()))
 			if(CollectionUtils.isEmpty(subjectRooms)){
 				continue;
 			}