From d22d18f40d088277195e5c3ab587d07450f1a94d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 22 四月 2020 18:22:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 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 4fa2f0b..5a3221c 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
@@ -14,7 +14,11 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.yeshi.utils.DateUtil;
 
+import com.aliyun.openservices.ons.api.Message;
+import com.aliyun.openservices.ons.api.Producer;
 import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
+import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
+import com.yeshi.fanli.dto.mq.user.body.UserLevelChangedMQMsg;
 import com.yeshi.fanli.entity.bus.user.HongBaoV2;
 import com.yeshi.fanli.entity.bus.user.ThreeSale;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -49,6 +53,8 @@
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
+import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
+import com.yeshi.fanli.util.rocketmq.MQTopicName;
 
 @Service
 public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
@@ -104,6 +110,9 @@
 	
 	@Resource(name = "taskExecutor")
 	private TaskExecutor executor;
+	
+	@Resource(name = "producer")
+	private Producer producer;
 	
 
 	@Override
@@ -379,7 +388,7 @@
 			UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
 			notify.setUid(uid);
 			notify.setFromLevel(UserLevelEnum.daRen);
-			notify.setToLevel(UserLevelEnum.normalVIP);
+//			notify.setToLevel(UserLevelEnum.normalVIP);
 			notify.setValid(true);
 			notify.setCreateTime(new Date());
 			userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
@@ -391,6 +400,12 @@
 			userInviteSeparateService.updateInvalidByBossId(uid);
 			// 鎻愰啋涓婄骇
 			remindBoss(uid, "鏅�氫細鍛�", item, upgradeTime, true);
+			
+//			if (!Constant.IS_TEST) {
+//				UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.daRen,UserLevelEnum.normalVIP, new Date());
+//				Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
+//				producer.send(message);
+//			}
 		} catch (Exception e) {
 		   e.printStackTrace();
 		}
@@ -430,7 +445,7 @@
 			// 鍗囩骇寮规鎻愮ず
 			UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
 			notify.setUid(uid);
-			notify.setFromLevel(UserLevelEnum.normalVIP);
+//			notify.setFromLevel(UserLevelEnum.normalVIP);
 			notify.setToLevel(UserLevelEnum.highVIP);
 			notify.setValid(true);
 			notify.setCreateTime(new Date());
@@ -445,6 +460,7 @@
 			}
 						
 			// 鍗囩骇娑堟伅
+//			UserLevelEnum fromLevel = UserLevelEnum.normalVIP;
 			int daysBetween = 0;
 			boolean divorced = false;
 			String beforeName = "蹇渷杈句汉";
@@ -464,11 +480,19 @@
 				goldcoinReward(uid);
 				// 闇�瑕佸彂閫佽劚绂讳俊鎭�
 				divorced = true;
+//				fromLevel = UserLevelEnum.daRen;
 			}
 			userAccountMsgNotificationService.vipPreUpgrade(uid, beforeName, "楂樼骇浼氬憳", daysBetween, limit1, limit2, type);
 
 			// 鎻愰啋涓婄骇
 			remindBoss(uid, "楂樼骇浼氬憳", item, upgradeTime, divorced);
+			
+			
+//			if (!Constant.IS_TEST) {
+//				UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, fromLevel,UserLevelEnum.highVIP, new Date());
+//				Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
+//				producer.send(message);
+//			}
 		} catch (Exception e) {
 			e.printStackTrace();
 			LogHelper.error(e);

--
Gitblit v1.8.0