| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException {
|
| | | if (uid == null || inviteCode == null)
|
| | | throw new UserInfoExtraException(1, "激活信息不能为空");
|
| | |
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode()))
|
| | | throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
|
| | |
|
| | | inviteCode = inviteCode.toUpperCase();
|
| | | // 邀请码对应用户信息
|
| | | UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
|
| | | if (inviter == null)
|
| | |
| | | }
|
| | |
|
| | | // 生成邀请码
|
| | | String mycode = null;
|
| | | for (int i = 1; i <= 5; i ++) {
|
| | | mycode = UserUtil.getInviteCode(i, uid);
|
| | | long countCode = userInfoExtraMapper.countByInviteCode(mycode);
|
| | | |
| | | if (countCode <= 0)
|
| | | break;
|
| | | }
|
| | | |
| | | String mycode = createInviteCode(uid);
|
| | | if (StringUtil.isNullOrEmpty(mycode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
|
| | | if (uid == null || code == null)
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | |
| | | }
|
| | |
|
| | | // 生成邀请码
|
| | | String inviteCode = null;
|
| | | for (int i = 1; i <= 5; i ++) {
|
| | | inviteCode = UserUtil.getInviteCode(i, uid);
|
| | | long countCode = userInfoExtraMapper.countByInviteCode(inviteCode);
|
| | | |
| | | if (countCode <= 0)
|
| | | break;
|
| | | }
|
| | | |
| | | String inviteCode = createInviteCode(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException {
|
| | | if (uid == null || weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | |
| | | }
|
| | |
|
| | | // 生成邀请码
|
| | | String inviteCode = null;
|
| | | for (int i = 1; i <= 5; i ++) {
|
| | | inviteCode = UserUtil.getInviteCode(i, uid);
|
| | | long countCode = userInfoExtraMapper.countByInviteCode(inviteCode);
|
| | | |
| | | if (countCode <= 0)
|
| | | break;
|
| | | }
|
| | | |
| | | String inviteCode = createInviteCode(uid);;
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(extra.getInviteCodeVip()))
|
| | | throw new UserInfoExtraException(4, "只能修改一次");
|
| | |
|
| | | // 转换成大写
|
| | | inviteCodeVip = inviteCodeVip.toUpperCase();
|
| | | |
| | | if (inviteCodeVip.equalsIgnoreCase(extra.getInviteCode()))
|
| | | throw new UserInfoExtraException(5, "不能为原邀请码");
|
| | |
|