|
@@ -71,6 +71,20 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
if (SystemConstant.isOneNull(teachClazzName, teachCourseId)) {
|
|
if (SystemConstant.isOneNull(teachClazzName, teachCourseId)) {
|
|
throw ExceptionResultEnum.ERROR.exception("参数异常");
|
|
throw ExceptionResultEnum.ERROR.exception("参数异常");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
+ TeachClazz check = this.getOne(new QueryWrapper<TeachClazz>()
|
|
|
|
+ .lambda()
|
|
|
|
+ .eq(TeachClazz::getSchoolId, schoolId)
|
|
|
|
+ .eq(TeachClazz::getTeachClazzName, teachClazzName));
|
|
|
|
+
|
|
|
|
+ if (Objects.nonNull(check) && !check.getId().equals(id)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("教学课程【" + basicCourseService.getById(teachCourseService.getById(check.getTeachCourseId()).getBasicCourseId()).getName()
|
|
|
|
+ + "】中已存在班级名称为【" + check.getTeachClazzName() + "】的班级");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (SystemConstant.longNotNull(id)) {
|
|
if (SystemConstant.longNotNull(id)) {
|
|
// 重命名课程
|
|
// 重命名课程
|
|
result = this.update(new UpdateWrapper<TeachClazz>().lambda().eq(TeachClazz::getId, id).set(TeachClazz::getTeachClazzName, teachClazzName));
|
|
result = this.update(new UpdateWrapper<TeachClazz>().lambda().eq(TeachClazz::getId, id).set(TeachClazz::getTeachClazzName, teachClazzName));
|
|
@@ -83,17 +97,6 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
throw ExceptionResultEnum.ERROR.exception("用户身份信息异常");
|
|
throw ExceptionResultEnum.ERROR.exception("用户身份信息异常");
|
|
}
|
|
}
|
|
|
|
|
|
- Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
- TeachClazz check = this.getOne(new QueryWrapper<TeachClazz>()
|
|
|
|
- .lambda()
|
|
|
|
- .eq(TeachClazz::getSchoolId, schoolId)
|
|
|
|
- .eq(TeachClazz::getTeachClazzName, teachClazzName));
|
|
|
|
-
|
|
|
|
- if (Objects.nonNull(check)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("教学课程【" + basicCourseService.getById(teachCourseService.getById(check.getTeachCourseId()).getBasicCourseId()).getName()
|
|
|
|
- + "】中已存在班级名称为【" + check.getTeachClazzName() + "】的班级");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
TeachClazz teachClazz = new TeachClazz();
|
|
TeachClazz teachClazz = new TeachClazz();
|
|
teachClazz.setSchoolId(schoolId);
|
|
teachClazz.setSchoolId(schoolId);
|
|
teachClazz.setTeachClazzName(teachClazzName);
|
|
teachClazz.setTeachClazzName(teachClazzName);
|