|
@@ -64,6 +64,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
+ @Autowired
|
|
|
+ private ExamOrganizationRelationDao examOrganizationRelationDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
@@ -77,7 +79,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
- public void addStudentForRoom(Long examRoomId, String registIdsStr) {
|
|
|
+ public void addStudentForRoom(Long examRoomId, String registIdsStr, Integer organId) {
|
|
|
if(Objects.isNull(examRoomId)){
|
|
|
throw new BizException("请指定教室");
|
|
|
}
|
|
@@ -88,6 +90,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
if(Objects.isNull(examRoom)){
|
|
|
throw new BizException("教室不存在");
|
|
|
}
|
|
|
+
|
|
|
+ ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examRoom.getExaminationBasicId(), organId);
|
|
|
+ if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
|
|
|
+ throw new BizException("无权操作");
|
|
|
+ }
|
|
|
+
|
|
|
ExamLocation examLocation = null;
|
|
|
if(ExamModeEnum.OFFLINE.equals(examRoom.getExamMode())){
|
|
|
examLocation = examLocationDao.get(examRoom.getExamLocationId());
|
|
@@ -171,7 +179,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void changeStudentExamRoom(Long registId, Long examRoomId) {
|
|
|
+ public void changeStudentExamRoom(Long registId, Long examRoomId, Integer organId) {
|
|
|
if(Objects.isNull(registId)){
|
|
|
throw new BizException("请指定报名信息");
|
|
|
}
|
|
@@ -186,6 +194,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
if(Objects.isNull(examRoom)){
|
|
|
throw new BizException("考场信息不存在");
|
|
|
}
|
|
|
+
|
|
|
+ ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examRoom.getExaminationBasicId(), organId);
|
|
|
+ if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
|
|
|
+ throw new BizException("无权操作");
|
|
|
+ }
|
|
|
+
|
|
|
ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationDao.getStudentExamRoom(registId);
|
|
|
if(Objects.isNull(studentExamRoom)){
|
|
|
studentExamRoom=new ExamRoomStudentRelation();
|
|
@@ -246,7 +260,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
- public void deleteStudentFromRoom(Long examRoomId, String registIdsStr) {
|
|
|
+ public void deleteStudentFromRoom(Long examRoomId, String registIdsStr, Integer organId) {
|
|
|
if(Objects.isNull(examRoomId)){
|
|
|
throw new BizException("请指定教室");
|
|
|
}
|
|
@@ -254,6 +268,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
if(Objects.isNull(examRoom)){
|
|
|
throw new BizException("教室不存在");
|
|
|
}
|
|
|
+
|
|
|
+ ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examRoom.getExaminationBasicId(), organId);
|
|
|
+ if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
|
|
|
+ throw new BizException("无权操作");
|
|
|
+ }
|
|
|
+
|
|
|
if(StringUtils.isBlank(registIdsStr)){
|
|
|
return;
|
|
|
}
|