From feee59af9b9d8173e28d7cde588b1ef9fcdb7efd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 30 四月 2020 19:06:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
index 4f60929..167059e 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -34,6 +34,7 @@
 import com.yeshi.fanli.service.inter.user.invite.UserInviteMsgNotificationService;
 import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
 import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
+import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
 import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService;
 import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
 import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
@@ -43,6 +44,7 @@
 import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
 import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
 import com.yeshi.fanli.util.rocketmq.MQTopicName;
+import com.yeshi.fanli.util.user.UserLevelUtil;
 
 @Service
 public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
@@ -89,10 +91,17 @@
 	@Resource(name = "producer")
 	private Producer producer;
 
+	@Resource
+	private TeamUserLevelStatisticService teamUserLevelStatisticService;
+
 	@Override
 	public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
 		if (info == null || info.getUid() == null || info.getProcess() == null)
 			throw new UserVIPPreInfoException(1, "淇℃伅涓嶅畬鏁�");
+		for (Long fuid : Constant.NO_UPGRADE_UIDS) {// 绂佹涓嶈兘鍗囩骇鐨勭敤鎴峰崌绾�
+			if (info.getUid().longValue() == fuid)
+				return;
+		}
 
 		UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(info.getUid(), info.getProcess());
 		if (oldInfo != null)
@@ -100,6 +109,8 @@
 		if (info.getCreateTime() == null)
 			info.setCreateTime(new Date());
 		userVIPPreInfoMapper.insertSelective(info);
+		// 璁剧疆缁熻鏁版嵁
+		teamUserLevelStatisticService.setUserLevel(info.getUid(), UserLevelUtil.getByLevel(info.getProcess()));
 	}
 
 	@Override
@@ -171,7 +182,7 @@
 		// 楠岃瘉鏄惁婊¤冻鍗囩骇楂樼骇浼氬憳
 		if (doneZiGou >= limitZiGou7) {
 			try {
-				twoProcess(uid, limitZiGou7, null);
+				twoProcess(uid, limitZiGou7, null, false);
 			} catch (UserVIPPreInfoException e) {
 
 			}
@@ -223,7 +234,7 @@
 		if (!StringUtil.isNullOrEmpty(first7)) {
 			limitFirst7 = Long.parseLong(first7);
 		}
-		
+
 		long limitSecond7 = 0;
 		String second7 = userVipConfigService.getValueByKey("vip_pre_7_second_level_team_count");
 		if (Constant.IS_TEST)
@@ -235,7 +246,7 @@
 		// 楠岃瘉鏄惁婊¤冻鍗囩骇楂樼骇浼氬憳
 		if (doneFirst >= limitFirst7 && doneSecond >= limitSecond7) {
 			try {
-				twoProcess(uid, limitFirst7, limitSecond7);
+				twoProcess(uid, limitFirst7, limitSecond7, true);
 			} catch (UserVIPPreInfoException e) {
 
 			}
@@ -252,12 +263,12 @@
 	 * @param secondTeam
 	 */
 	@Transactional(rollbackFor = Exception.class)
-	private void twoProcess(Long uid, long limit1, Long limit2) throws UserVIPPreInfoException {
+	private void twoProcess(Long uid, long limit1, Long limit2, boolean teamPass) throws UserVIPPreInfoException {
 		String item = null;
-		if (limit2 == null) {
-			item = "杩斿埄+鍒嗕韩璁㈠崟";
-		} else {
+		if (teamPass) {
 			item = "鐩存帴+闂存帴绮変笣";
+		} else {
+			item = "杩斿埄+鍒嗕韩璁㈠崟";
 		}
 
 		Date upgradeTime = new Date();
@@ -285,7 +296,7 @@
 				registerTime = userInfoRegister.getCreateTime();
 			}
 			int daysBetween = TimeUtil.getDayDifferenceCount(registerTime, upgradeTime);
-			userAccountMsgNotificationService.vipPreUpgrade(uid, "蹇渷杈句汉", "楂樼骇浼氬憳", daysBetween, limit1, limit2);
+			userAccountMsgNotificationService.vipPreUpgrade(uid, "蹇渷杈句汉", "楂樼骇浼氬憳", daysBetween, limit1, limit2, teamPass);
 
 			// 鐩存帴绮変笣鍗囩骇鎻愰啋
 			ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);

--
Gitblit v1.8.0