From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 20 五月 2020 17:25:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2

---
 fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/SyncBeforeInfoMessageListener.java |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/SyncBeforeInfoMessageListener.java b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/SyncBeforeInfoMessageListener.java
index d989066..399a1ba 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/SyncBeforeInfoMessageListener.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/SyncBeforeInfoMessageListener.java
@@ -31,6 +31,7 @@
 import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
+import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.VersionUtil;
 import com.yeshi.fanli.util.rocketmq.MQTopicName;
 
@@ -79,11 +80,9 @@
 			if (tag.equalsIgnoreCase(UserTopicTagEnum.userActve.name())) {
 				UserActiveMQMsg msg = new Gson().fromJson(new String(message.getBody()), UserActiveMQMsg.class);
 				Long uid = msg.getUid();
-
 				// 鑰佺敤鎴峰悓姝ョ粦瀹氫俊鎭�
+
 				userInfoModifyRecordService.syncBeforeInfo(uid);
-
-
 				// 浣庣増鏈叏閮ㄥ崌绾ф櫘閫氫細鍛�
 
 				List<ThreeSale> threeSaleList = threeSaleSerivce.getMyBossDeepList(uid, 2);
@@ -116,15 +115,25 @@
 					if (vipInfo == null) {// 娌℃湁鐢熸垚楂樼骇鍙婁互涓婁細鍛�
 						UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
 						if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode())) {
-							// 鑰佺敤鎴风敓鎴愭櫘閫氫細鍛�
-							UserVIPPreInfo vip = new UserVIPPreInfo();
-							vip.setCreateTime(new Date());
-							vip.setProcess(UserVIPPreInfo.PROCESS_1);
-							vip.setUid(uid);
-							try {
-								userVIPPreInfoService.addUserVIPPreInfo(vip);
-							} catch (UserVIPPreInfoException e) {
-								e.printStackTrace();
+
+							List<Long> uids = new ArrayList<>();
+							uids.add(uid);
+							List<UserInfoRegister> list = userInfoRegisterService.listByMultipleUids(uids);
+							if (list != null && list.size() > 0)// 鏈夋敞鍐屼俊鎭�
+							{
+								if (list.get(0).getCreateTime().getTime() < Constant.NEW_ORDER_FANLI_RULE_TIME) {// 澧炲姞娉ㄥ唽鏃堕棿闄愬埗
+									// 鑰佺敤鎴风敓鎴愭櫘閫氫細鍛�
+									UserVIPPreInfo vip = new UserVIPPreInfo();
+									vip.setCreateTime(new Date());
+									vip.setProcess(UserVIPPreInfo.PROCESS_1);
+									vip.setUid(uid);
+									vip.setSourceType(UserVIPPreInfo.SOURCE_TYPE_ORDER);
+									try {
+										userVIPPreInfoService.addUserVIPPreInfo(vip);
+									} catch (UserVIPPreInfoException e) {
+										e.printStackTrace();
+									}
+								}
 							}
 						}
 					}
@@ -153,6 +162,7 @@
 									vip.setCreateTime(new Date());
 									vip.setProcess(UserVIPPreInfo.PROCESS_1);
 									vip.setUid(uid);
+									vip.setSourceType(UserVIPPreInfo.SOURCE_TYPE_ORDER);
 									try {
 										userVIPPreInfoService.addUserVIPPreInfo(vip);
 									} catch (UserVIPPreInfoException e) {
@@ -160,6 +170,14 @@
 									}
 								}
 							}
+						} else {// 涔嬪墠鑰佺増鏈鐞嗕负鏅�氫細鍛樼殑鐢ㄦ埛鍗囩骇鏂扮増鏈�
+							if (vipInfo.getProcess() == UserVIPPreInfo.PROCESS_1
+									&& vipInfo.getCreateTime().getTime() < TimeUtil
+											.convertToTimeTemp("2020-04-30 14:10:00", "yyyy-MM-dd HH:mm:ss")) {
+								// 璁$畻绛夌骇
+								userVIPPreInfoService.upgradeVipByMyOrder(uid);
+								userVIPPreInfoService.upgradeVipByTeamNum(uid);
+							}
 						}
 					}
 				}

--
Gitblit v1.8.0