|
|
@@ -196,21 +196,28 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
BufferedReader br = null;
|
|
|
String regex = "----";
|
|
|
List<SysEmail> sysEmails = new ArrayList<>();
|
|
|
+ List<String> error = new ArrayList<>();
|
|
|
try {
|
|
|
in = file.getInputStream();
|
|
|
br = new BufferedReader(new InputStreamReader(file.getInputStream()));
|
|
|
String content = null;
|
|
|
while ((content = br.readLine()) != null) {
|
|
|
String[] split = content.split(regex);
|
|
|
- String email = split[0];
|
|
|
- String password = split[1];
|
|
|
- SysEmail sysEmail = new SysEmail();
|
|
|
- sysEmail.setEmail(email);
|
|
|
- sysEmail.setPassword(password);
|
|
|
- sysEmails.add(sysEmail);
|
|
|
+ if (split.length > 1) {
|
|
|
+ String email = split[0];
|
|
|
+ String password = split[1];
|
|
|
+ if (!StrUtil.hasEmpty(email, password)) {
|
|
|
+ SysEmail sysEmail = new SysEmail();
|
|
|
+ sysEmail.setEmail(email);
|
|
|
+ sysEmail.setPassword(password);
|
|
|
+ sysEmails.add(sysEmail);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ error.add(split[0]);
|
|
|
+ }
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(sysEmails)) {
|
|
|
- Lists.partition(sysEmails, 1000).forEach(data->{
|
|
|
+ Lists.partition(sysEmails, 1000).forEach(data -> {
|
|
|
sysEmailMapper.batchInsert(data);
|
|
|
});
|
|
|
}
|
|
|
@@ -222,6 +229,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
in.close();
|
|
|
}
|
|
|
}
|
|
|
+ System.out.println(Jsons.toJson(error));
|
|
|
}
|
|
|
|
|
|
/**
|