yujian
2019-12-07 8c93d2e3b22ac543f8f94c2cf0eb982258fb708b
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -339,6 +339,7 @@
      if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode()))
         throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
      inviteCode = inviteCode.toUpperCase();
      // 邀请码对应用户信息
      UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
      if (inviter == null)
@@ -357,15 +358,7 @@
      }
      // 生成邀请码
      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, "激活码生成失败");
@@ -477,15 +470,7 @@
      }
      // 生成邀请码
      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, "激活码生成失败");
      
@@ -599,15 +584,7 @@
      }
      // 生成邀请码
      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, "激活码生成失败");
      
@@ -823,6 +800,9 @@
      if (!StringUtil.isNullOrEmpty(extra.getInviteCodeVip()))
         throw new UserInfoExtraException(4, "只能修改一次");
      
      // 转换成大写
      inviteCodeVip = inviteCodeVip.toUpperCase();
      if (inviteCodeVip.equalsIgnoreCase(extra.getInviteCode()))
         throw new UserInfoExtraException(5, "不能为原邀请码");