|
|
|
@ -62,6 +62,7 @@ import static cn.jlw.token.TokenService.updateByIds;
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getUniAdmin;
|
|
|
|
|
import static com.ibeetl.admin.core.enums.MenuEnums.JT_02;
|
|
|
|
|
import static com.ibeetl.admin.core.enums.MenuEnums.JT_S_03;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ListUtils.getDuplicateElements;
|
|
|
|
|
import static com.ibeetl.jlw.web.IpAddressController.ipAddressMap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -966,6 +967,11 @@ public class StudentService extends CoreBaseService<Student>{
|
|
|
|
|
}
|
|
|
|
|
// 查询所有的班级编号
|
|
|
|
|
List<String> studentSnList = list.stream().map(Student::getStudentSn).collect(Collectors.toList());
|
|
|
|
|
// 获取重复的元素
|
|
|
|
|
List<String> duplicateElements = getDuplicateElements(studentSnList);
|
|
|
|
|
// 构建异常信息,传给前端
|
|
|
|
|
String duplicateElementsAsString = CollectionUtil.emptyIfNull(duplicateElements).stream().collect(Collectors.joining(","));
|
|
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(duplicateElements), "本次上传,存在重复的的学生编号:\"{}\",请修改后再进行提交!", duplicateElementsAsString);
|
|
|
|
|
// 查询库里已经存在的编号
|
|
|
|
|
List<String> existsList = studentDao.createLambdaQuery()
|
|
|
|
|
.andIsNotNull(Student::getStudentSn)
|
|
|
|
|