|
@@ -625,12 +625,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(bo.getTel().length()!=11){
|
|
|
throw new CustomException("手机号格式错误");
|
|
|
}
|
|
|
- if(bo.getIdcard()==null){
|
|
|
- throw new CustomException("身份证不能为空");
|
|
|
- }
|
|
|
- if(bo.getIdcard().length()!=18){
|
|
|
- throw new CustomException("身份证格式错误");
|
|
|
- }
|
|
|
+// if(bo.getIdcard()==null){
|
|
|
+// throw new CustomException("身份证不能为空");
|
|
|
+// }
|
|
|
+// if(bo.getIdcard().length()!=18){
|
|
|
+// throw new CustomException("身份证格式错误");
|
|
|
+// }
|
|
|
// if(bo.getRealname()==null){
|
|
|
// throw new CustomException("真实姓名不能为空");
|
|
|
// }
|
|
@@ -654,7 +654,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
|
|
|
inertData.setUserAccount(String.valueOf(idWorker.nextId()));
|
|
|
inertData.setSex(1);
|
|
|
- inertData.setIdCard(bo.getIdcard());
|
|
|
+ if (ObjectUtils.isNotNull(bo.getIdcard())){
|
|
|
+ inertData.setIdCard(bo.getIdcard());
|
|
|
+ }
|
|
|
inertData.setRealname(bo.getRealname());
|
|
|
inertData.setStatus(1);
|
|
|
inertData.setRegisterPlat(bo.getRegisterPlat());
|
|
@@ -665,7 +667,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
inertData.setCreateTime(DateUtils.getNowTime());
|
|
|
inertData.setUpdateTime(DateUtils.getNowTime());
|
|
|
// String pwd = ToolsUtils.getSmsCode(); // 随机密码
|
|
|
- String pwd = bo.getIdcard().substring(bo.getIdcard().length() - 6);
|
|
|
+ String pwd = "";
|
|
|
+ if (ObjectUtils.isNotNull(bo.getIdcard())){
|
|
|
+ pwd = bo.getIdcard().substring(bo.getIdcard().length() - 6);
|
|
|
+ }else {
|
|
|
+ pwd = bo.getTel().substring(bo.getTel().length() - 6);
|
|
|
+ }
|
|
|
inertData.setPassword(SecurityUtils.encryptPassword(pwd));
|
|
|
if(!save(inertData)){
|
|
|
throw new CustomException("注册失败");
|
|
@@ -887,9 +894,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(Validator.isEmpty(bo.getTelphone())){
|
|
|
throw new CustomException("用户手机号码缺失");
|
|
|
}
|
|
|
- if(Validator.isEmpty(bo.getIdCard())){
|
|
|
- throw new CustomException("用户身份证号码缺失");
|
|
|
- }
|
|
|
+// if(Validator.isEmpty(bo.getIdCard())){
|
|
|
+// throw new CustomException("用户身份证号码缺失");
|
|
|
+// }
|
|
|
User user1 = getOne(new LambdaQueryWrapper<User>()
|
|
|
.eq(User::getTelphone,EncryptHandler.encrypt(bo.getTelphone())).last("limit 1"));
|
|
|
//手机号码存在
|
|
@@ -900,7 +907,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
if(Validator.isEmpty(user1.getIdCard())){
|
|
|
//更新身份证和姓名
|
|
|
- user1.setIdCard(bo.getIdCard());
|
|
|
+ if (ObjectUtil.isNotNull(bo.getIdCard())){
|
|
|
+ user1.setIdCard(bo.getIdCard());
|
|
|
+ }
|
|
|
user1.setRealname(bo.getRealname());
|
|
|
updateById(user1);
|
|
|
}
|