From b47fb09eaffa4a13c0d63e823cb9319bcb775249 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 02 四月 2020 15:22:11 +0800 Subject: [PATCH] 发圈修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java | 42 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 38 insertions(+), 4 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 fbecf26..37b5f01 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,6 +14,7 @@ import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper; import com.yeshi.fanli.dto.msg.MsgAccountVipDTO; +import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO; import com.yeshi.fanli.entity.bus.user.HongBaoV2; import com.yeshi.fanli.entity.bus.user.ThreeSale; import com.yeshi.fanli.entity.bus.user.UserInfo; @@ -27,7 +28,9 @@ import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.count.HongBaoV2CountService; +import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; +import com.yeshi.fanli.service.inter.user.UserInfoService; import com.yeshi.fanli.service.inter.user.UserInviteSeparateService; import com.yeshi.fanli.service.inter.user.UserSystemCouponService; import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService; @@ -77,6 +80,12 @@ @Resource private UserInviteSeparateService userInviteSeparateService; + @Resource + private UserInfoService userInfoService; + + @Resource + private UserOtherMsgNotificationService userOtherMsgNotificationService; + @Override public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException { @@ -108,6 +117,12 @@ Collections.sort(infoList, cm); return infoList.get(0); } + + @Override + public UserVIPPreInfo getVipByProcess(Long uid, int process){ + return userVIPPreInfoMapper.selectByUidAndProcess(uid, process); + } + @Override public UserVIPPreInfo getProcessInfo(Long uid, Date time) { @@ -261,17 +276,26 @@ // 璧犻�侀噾甯� String goldcoin = userVipConfigService.getValueByKey("vip_pre_3_gift_goldcoin"); if (!StringUtil.isNullOrEmpty(goldcoin)) { + + int goldcoinNum = Integer.parseInt(goldcoin); // 娣诲姞閲戝竵鏄庣粏 IntegralDetail detail = new IntegralDetail(); detail.setTitle("鍗囩骇VIP绂忓埄"); detail.setUid(uid); - detail.setMoney(Constant.VIP_COLDCOIN_NUM); + detail.setMoney(Integer.parseInt(goldcoin)); detail.setCreateTime(new Date()); detail.setUniqueKey("VIP-3-" + uid); integralDetailService.insertSelective(detail); // 娣诲姞閲戝竵 userInfoExtraService.addGoldCoinByUid(uid, Integer.parseInt(goldcoin)); + + // 娑堟伅 + MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO(); + dto.setName("绯荤粺璧犻�� "); + dto.setReason("鎭枩浣狅紒鎴愬姛鍗囩骇涓烘櫘閫氫細鍛�"); + dto.setDesc("鑾峰緱閲戝竵" + goldcoinNum+"鏋�"); + userOtherMsgNotificationService.vipUpgradeReward(uid, "璇︽儏鏌ョ湅锛屽搴斾細鍛樻潈鐩�", dto); } // 鏄惁瀛樺湪涓嬬骇鑴辩鏈熼檺 -鏇存柊涓嶈劚绂� @@ -294,7 +318,13 @@ if (threeSale == null) return; + // 楠岃瘉涓婄骇鏄惁姝e父 Long bossId = threeSale.getBoss().getId(); + UserInfo userInfo = userInfoService.getUserById(bossId); + if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) { + return; + } + // 楠岃瘉涓婄骇鏄惁宸叉槸浼氬憳 UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(bossId, UserVIPPreInfo.PROCESS_1); if (oldInfo != null) { @@ -303,9 +333,6 @@ // 娣诲姞鑴辩鍏崇郴鍊掕鏃� userInviteSeparateService.addPreSeparateRecord(uid, bossId); - - // TODO 娑堟伅 - } @@ -383,6 +410,13 @@ userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), UserSystemCoupon.SOURCE_SYSTEM_PUSH, percent, false); } + + // 娑堟伅 + MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO(); + dto.setName("绯荤粺璧犻�� "); + dto.setReason("鎭枩浣狅紒鎴愬姛鍗囩骇涓洪珮绾т細鍛�"); + dto.setDesc("鑾峰緱杩斿埄濂栧姳鍒�" + num +"寮�"); + userOtherMsgNotificationService.vipUpgradeReward(uid, "璇︽儏鏌ョ湅锛屽搴斾細鍛樻潈鐩�", dto); } } catch (Exception e) { e.printStackTrace(); -- Gitblit v1.8.0