yujian
2020-04-13 e7435f02fcbe040e32dfd21c308957eb2de2837d
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -21,6 +21,8 @@
import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
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.UserVIPPreInfo;
import com.yeshi.fanli.entity.integral.IntegralDetail;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -39,6 +41,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.UserLevelUpgradedNotifyService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
import com.yeshi.fanli.util.Constant;
@@ -93,6 +96,9 @@
   
   @Resource
   private UserInviteMsgNotificationService userInviteMsgNotificationService;
   @Resource
   private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
   @Override
   public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
@@ -296,6 +302,16 @@
            int daysBetween = DateUtil.daysBetween(registerTime, new Date());
            userAccountMsgNotificationService.vipPreUpgrade(uid, "快省达人", "普通会员", daysBetween, targetNum1, targetNum2, type);
            
            // 升级弹框提示
            UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
            notify.setUid(uid);
            notify.setFromLevel(UserLevelEnum.daRen);
            notify.setToLevel(UserLevelEnum.normalVIP);
            notify.setValid(true);
            notify.setCreateTime(new Date());
            userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
            // 赠送金币
            String goldcoin = userVipConfigService.getValueByKey("vip_pre_3_gift_goldcoin");
            if (!StringUtil.isNullOrEmpty(goldcoin)) {
@@ -398,6 +414,15 @@
            info.setUpdateTime(upgradeTime);
            addUserVIPPreInfo(info);
            
            // 升级弹框提示
            UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
            notify.setUid(uid);
            notify.setFromLevel(UserLevelEnum.normalVIP);
            notify.setToLevel(UserLevelEnum.highVIP);
            notify.setValid(true);
            notify.setCreateTime(new Date());
            userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
            // 升级消息
            UserVIPPreInfo pre1 = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
            int daysBetween = DateUtil.daysBetween(pre1.getCreateTime(), upgradeTime);