|
|
@@ -895,12 +895,14 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
return CommonResult.fail("学生信息数据导入只支持Xls或Xlsx格式文件");
|
|
|
}
|
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
List<String> cardIds = result.stream().map(WelcomeStudent::getCardId).collect(Collectors.toList());
|
|
|
List<WelcomeStudent> existStudents = welcomeStudentService.queryStudentByCardId(cardIds);
|
|
|
if (existStudents != null && existStudents.size() > 0) {
|
|
|
for (WelcomeStudent ws : result) {
|
|
|
Optional<WelcomeStudent> ows = existStudents.stream().filter(e -> e.getCardId().equals(ws.getCardId())).findFirst();
|
|
|
if (ows != null && ows.isPresent()) {
|
|
|
+ sb.append(ows.get().getName() + ows.get().getCardId()+"数据在数据库中已存在;");
|
|
|
ws.setId(ows.get().getId());
|
|
|
ws.setAdmissNum(ws.getAdmissNum());//录取号
|
|
|
ws.setName(ws.getName());//姓名
|
|
|
@@ -942,7 +944,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
boolean resultBool = welcomeStudentService.saveOrUpdateBatch(result);
|
|
|
|
|
|
System.out.println("导入学生1");
|
|
|
- return resultBool ? CommonResult.ok("导入成功") : CommonResult.fail("导入失败");
|
|
|
+ return resultBool ? CommonResult.ok("导入成功:"+ sb.toString()) : CommonResult.fail("导入失败");
|
|
|
}
|
|
|
|
|
|
/**
|