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 |   34 +++++++---------------------------
 1 files changed, 7 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 312d3d3..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
@@ -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, "涓嶈兘涓哄師閭�璇风爜");
 		

--
Gitblit v1.8.0