|
|
@@ -891,8 +891,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
errorList.add(itemImport);
|
|
|
continue;
|
|
|
}
|
|
|
- if(Validator.isEmpty(itemImport.getIdCard())){
|
|
|
- itemImport.setCause("身份证不能为空");
|
|
|
+ String REGEX = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{3}([0-9Xx])$";
|
|
|
+ if(Validator.isEmpty(itemImport.getIdCard()) || !itemImport.getIdCard().matches(REGEX)){
|
|
|
+ itemImport.setCause("身份证不能为空或者格式不对");
|
|
|
errorList.add(itemImport);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -943,13 +944,17 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
-// else{
|
|
|
-// User user2 = getOne(new LambdaQueryWrapper<User>()
|
|
|
-// .eq(User::getIdCard,EncryptHandler.encrypt(itemImport.getIdCard())).last("limit 1"));
|
|
|
-// if(Validator.isNotEmpty(user2)){
|
|
|
-// throw new CustomException(itemImport.getRealname()+"身份证号码已存在,创建失败");
|
|
|
-// }
|
|
|
-// }
|
|
|
+ else{
|
|
|
+ User user1 = getOne(new LambdaQueryWrapper<User>()
|
|
|
+ .eq(User::getTelphone,EncryptHandler.encrypt(itemImport.getTelphone())).last("limit 1"));
|
|
|
+ if(Validator.isNotNull(user1)) {
|
|
|
+ if(Validator.isNotEmpty(user1.getIdCard())&&Validator.isNotEmpty(itemImport.getIdCard())&&!itemImport.getIdCard().equals(user1.getIdCard())){
|
|
|
+ itemImport.setCause("手机号码已被占用请检查");
|
|
|
+ errorList.add(itemImport);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
User inertData = new User();
|
|
|
inertData.setTelphone(itemImport.getTelphone());
|
|
|
//隐藏手机号作为初始昵称
|