From 4a2eb8a3a00febe2a55e1d5538e7e13e9f7fae86 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 17 四月 2020 13:57:56 +0800
Subject: [PATCH] 消息

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

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
index fd6b9db..0ce6879 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
@@ -17,6 +17,8 @@
 import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
 import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
 import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
+import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
+import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
 import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
 import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
 import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
@@ -33,11 +35,13 @@
 import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
 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.UserLevelUpgradedNotifyService;
 import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
 import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
 import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
+import com.yeshi.fanli.util.TimeUtil;
 
 @Service
 public class UserVIPInfoServiceImpl implements UserVIPInfoService {
@@ -88,6 +92,9 @@
 	
 	@Resource
 	private UserInviteValidNumService userInviteValidNumService;
+	
+	@Resource
+	private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -221,6 +228,15 @@
 		info.setUpdateTime(upgradeTime);
 		userVIPInfoMapper.updateByPrimaryKeySelective(info);
 
+		// 鍗囩骇寮规鎻愮ず
+		UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
+		notify.setUid(uid);
+		notify.setFromLevel(UserLevelEnum.highVIP);
+		notify.setToLevel(UserLevelEnum.superVIP);
+		notify.setValid(true);
+		notify.setCreateTime(new Date());
+		userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
+		
 		try {
 			// 璧犻�佸厤鍗曞埜
 			String giveCoupon = userVipConfigService.getValueByKey("vip_pre_10_gift_givefree_coupon");
@@ -236,8 +252,7 @@
 		try {
 			// 鍗囩骇娑堟伅
 			UserVIPPreInfo pre1 = userVIPPreInfoService.getVipByProcess(uid, UserVIPPreInfo.PROCESS_2);
-			int days = DateUtil.daysBetween(pre1.getCreateTime(), new Date());
-			userAccountMsgNotificationService.vipUpgradeSuccess(uid, days);
+			userAccountMsgNotificationService.vipUpgradeSuccess(uid, TimeUtil.getDayDifferenceCount(pre1.getCreateTime(), new Date()));
 			
 			// 鍗囩骇鎻愰啋涓婄骇
 			userVIPPreInfoService.remindBoss(uid, "瓒呯骇浼氬憳", getPassItem(uid), upgradeTime, false);

--
Gitblit v1.8.0