Joburgess 5 years ago
parent
commit
110faa36a4

+ 13 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -152,6 +152,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			throw new BizException("请指定考试时间");
 		}
 
+		if(ExamModeEnum.ONLINE.equals(examRoom.getExamMode())){
+			examRoom.setExamLocationId(null);
+		}
+
 		ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examinationBasic.getId(), examRoom.getOrganId());
 		if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
 			throw new BizException("无权操作");
@@ -235,6 +239,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			throw new BizException("请指定教室");
 		}
 
+		if(ExamModeEnum.ONLINE.equals(examRoom.getExamMode())){
+			examRoom.setExamLocationId(null);
+		}
+
 		List<Integer> teacherIds=new ArrayList<>();
 		teacherIds.add(examRoom.getMainTeacherUserId());
 		if(StringUtils.isNotBlank(examRoom.getAssistantTeacherUserIdList())){
@@ -252,6 +260,11 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			}
 			examRoom.setAssistantTeacherUserNameList(StringUtils.join(assistantTeacherNames, ","));
 		}
+
+		List<Integer> subjectIds = Arrays.stream(examRoom.getSubjectIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+		examRoom.setSubjectNameList(StringUtils.join(subjectIdNameMap.values(),","));
+
 		examRoomDao.update(examRoom);
 		return examRoom;
 	}