From 8c93d2e3b22ac543f8f94c2cf0eb982258fb708b Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 07 十二月 2019 15:33:00 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java | 37 ++++++++++--------------------------- 1 files changed, 10 insertions(+), 27 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java index 56deccf..3b115bf 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java @@ -324,6 +324,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException { if (uid == null || inviteCode == null) throw new UserInfoExtraException(1, "婵�娲讳俊鎭笉鑳戒负绌�"); @@ -338,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) @@ -356,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, "婵�娲荤爜鐢熸垚澶辫触"); @@ -383,6 +377,7 @@ } @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, "婵�娲讳俊鎭笉瀹屾暣"); @@ -475,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, "婵�娲荤爜鐢熸垚澶辫触"); @@ -501,6 +488,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException { if (uid == null || weiXinUser == null) { throw new UserInfoExtraException(1, "婵�娲讳俊鎭笉瀹屾暣"); @@ -596,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, "婵�娲荤爜鐢熸垚澶辫触"); @@ -820,6 +800,9 @@ if (!StringUtil.isNullOrEmpty(extra.getInviteCodeVip())) throw new UserInfoExtraException(4, "鍙兘淇敼涓�娆�"); + // 杞崲鎴愬ぇ鍐� + inviteCodeVip = inviteCodeVip.toUpperCase(); + if (inviteCodeVip.equalsIgnoreCase(extra.getInviteCode())) throw new UserInfoExtraException(5, "涓嶈兘涓哄師閭�璇风爜"); -- Gitblit v1.8.0