|
|
@ -130,12 +130,13 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
if (user.getInviteUserId() != null) { |
|
|
|
if (user.getInviteUserId() != null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已绑定过邀请人"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已绑定过邀请人"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (getUser(inviteUseId) == null) { |
|
|
|
BsUser inviteUser = getUser(inviteUseId); |
|
|
|
|
|
|
|
if (inviteUser == null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的邀请人Id"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的邀请人Id"); |
|
|
|
} |
|
|
|
} |
|
|
|
BsUserParentRel userParentRel = new BsUserParentRel(); |
|
|
|
BsUserParentRel userParentRel = new BsUserParentRel(); |
|
|
|
userParentRel.setParentUserId(userParentRel.getParentUserId()); |
|
|
|
userParentRel.setParentUserId(inviteUser.getId()); |
|
|
|
userParentRel.setParentUserGrade(userParentRel.getParentUserGrade()); |
|
|
|
userParentRel.setParentUserGrade(inviteUser.getGrade()); |
|
|
|
userParentRel.setUserId(userId); |
|
|
|
userParentRel.setUserId(userId); |
|
|
|
userParentRelService.editData(userParentRel); |
|
|
|
userParentRelService.editData(userParentRel); |
|
|
|
|
|
|
|
|
|
|
@ -340,7 +341,7 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
// 校验邀请码
|
|
|
|
// 校验邀请码
|
|
|
|
BsUserInviteCode userInviteCode = userInviteCodeService.getDetail(inviteUseId); |
|
|
|
BsUserInviteCode userInviteCode = userInviteCodeService.getDetail(inviteUseId); |
|
|
|
if (userInviteCode == null) { |
|
|
|
if (userInviteCode == null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的邀请码"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的邀请人Id"); |
|
|
|
} |
|
|
|
} |
|
|
|
user.setInviteUserId(userInviteCode.getUserId()); |
|
|
|
user.setInviteUserId(userInviteCode.getUserId()); |
|
|
|
} |
|
|
|
} |
|
|
@ -356,6 +357,18 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
editData(user); |
|
|
|
editData(user); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user.getInviteUserId() != null) { |
|
|
|
|
|
|
|
BsUser inviteUser = getUser(inviteUseId); |
|
|
|
|
|
|
|
if (inviteUser == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的邀请人Id"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BsUserParentRel userParentRel = new BsUserParentRel(); |
|
|
|
|
|
|
|
userParentRel.setParentUserId(inviteUser.getId()); |
|
|
|
|
|
|
|
userParentRel.setParentUserGrade(inviteUser.getGrade()); |
|
|
|
|
|
|
|
userParentRel.setUserId(user.getId()); |
|
|
|
|
|
|
|
userParentRelService.editData(userParentRel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 创建账户
|
|
|
|
// 创建账户
|
|
|
|
userAccountService.create(user.getId()); |
|
|
|
userAccountService.create(user.getId()); |
|
|
|
return user; |
|
|
|
return user; |
|
|
|