|
@@ -660,8 +660,8 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (bo.getStatus() != -1) {
|
|
|
+ if(Validator.isNotEmpty(bo.getStatus())){
|
|
|
+ if (bo.getStatus() != -1) {
|
|
|
/* LambdaQueryWrapper<ClassGrade> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(ClassGrade::getClassName, update.getClassName());
|
|
|
lqw.eq(ClassGrade::getStatus, 1);
|
|
@@ -676,31 +676,32 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
throw new RuntimeException("班级名称不能重复");
|
|
|
}
|
|
|
}*/
|
|
|
- }
|
|
|
- if (bo.getStatus() == -1) { //删除判断班级是否人数空
|
|
|
- ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
- classGradeUserQueryBo.setGradeId(bo.getGradeId());
|
|
|
- List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
|
|
|
- if (list.size() > 0) {
|
|
|
- throw new RuntimeException("班级还有学员,无法删除");
|
|
|
}
|
|
|
- ClassGrade grade = getById(bo.getGradeId());
|
|
|
- if (StringUtils.isNotBlank(grade.getOfficialName())) {
|
|
|
- throw new RuntimeException("二建/二造班级无法删除,请联系技术人员!");
|
|
|
- }
|
|
|
- }
|
|
|
- if (bo.getStatus() == 0) { //更新为无效
|
|
|
- ClassGradeVo oldGrade = this.queryById(bo.getGradeId());
|
|
|
- if (oldGrade.getStatus() == 1) {
|
|
|
+ if (bo.getStatus() == -1) { //删除判断班级是否人数空
|
|
|
ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
classGradeUserQueryBo.setGradeId(bo.getGradeId());
|
|
|
List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
|
|
|
if (list.size() > 0) {
|
|
|
- throw new RuntimeException("班级还有学员,无法设置为无效");
|
|
|
+ throw new RuntimeException("班级还有学员,无法删除");
|
|
|
+ }
|
|
|
+ ClassGrade grade = getById(bo.getGradeId());
|
|
|
+ if (StringUtils.isNotBlank(grade.getOfficialName())) {
|
|
|
+ throw new RuntimeException("二建/二造班级无法删除,请联系技术人员!");
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && sysTenant.getShareClass() == 1) {
|
|
|
- throw new RuntimeException("二建/二造班级无法设置为无效,请联系技术人员!");
|
|
|
+ if (bo.getStatus() == 0) { //更新为无效
|
|
|
+ ClassGradeVo oldGrade = this.queryById(bo.getGradeId());
|
|
|
+ if (oldGrade.getStatus() == 1) {
|
|
|
+ ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
+ classGradeUserQueryBo.setGradeId(bo.getGradeId());
|
|
|
+ List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
|
|
|
+ if (list.size() > 0) {
|
|
|
+ throw new RuntimeException("班级还有学员,无法设置为无效");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && sysTenant.getShareClass() == 1) {
|
|
|
+ throw new RuntimeException("二建/二造班级无法设置为无效,请联系技术人员!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//更改班主任
|