Commit 3d96ecdb authored by Ryan Loong's avatar Ryan Loong

update 删除班级前校验班级是否有学生

parent 50a5c5f5
......@@ -108,7 +108,7 @@ public class ClassService {
Map<Integer, List<StudentInfo>> classStudentMap = studentInfoService.selectStudentByClassIdListGroupByClassId(idList);
if (!CollectionUtils.isEmpty(classStudentMap) && classStudentMap.values().stream().anyMatch(list -> !CollectionUtils.isEmpty(list))) {
return classStudentMap.entrySet().stream().filter(entry -> !CollectionUtils.isEmpty(entry.getValue()))
.map(entry -> StrUtil.format("班级[({}){}]存在学生{}名无法删除", entry.getKey(), classNameMap.get(entry.getKey()), entry.getValue().size()))
.map(entry -> StrUtil.format("班级[{}]存在{}名学生无法删除", classNameMap.get(entry.getKey()), entry.getValue().size()))
.collect(Collectors.joining(", "));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment