|
|
@@ -95,13 +95,26 @@ public class ClassServiceImpl implements ClassService{
|
|
|
for (SysTeacherClazz detail : teachers) {
|
|
|
detail.setClazz_id(clazz.getClazz_id());
|
|
|
Integer count = 0;
|
|
|
- count = sysClazzMapper.teacherClazz(detail.getSubject_name(),clazz.getClazz_id());
|
|
|
+ count = sysClazzMapper.teacherClazz(detail.getSubject_name(),detail.getTeacher_name(), clazz.getClazz_id());
|
|
|
+ if(count > 0){
|
|
|
+ throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
|
|
|
+ }
|
|
|
if (StringUtils.isEmpty(detail.getTeacher_clazz_id()) || "0".equals(detail.getTeacher_clazz_id().toString())) {
|
|
|
+ count = sysClazzMapper.teacherSubject(detail.getSubject_name(), clazz.getClazz_id());
|
|
|
if(count > 0){
|
|
|
throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
|
|
|
}
|
|
|
insertDetails.add(detail);
|
|
|
} else {
|
|
|
+ count = sysClazzMapper.teacherSubject(detail.getSubject_name(), clazz.getClazz_id());
|
|
|
+ List<SysTeacherClazz> teacherName = sysClazzMapper.selectTeacherSubject(detail.getTeacher_clazz_id());
|
|
|
+ for(SysTeacherClazz teacherNames:teacherName){
|
|
|
+ if(count > 0 && teacherNames.getTeacher_name() == detail.getTeacher_name()){
|
|
|
+ if(teacherNames.getTeacher_name() == detail.getTeacher_name()){
|
|
|
+ throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
updateDetails.add(detail);
|
|
|
}
|
|
|
}
|