From 020d940ae4e16f55f69cef3dd4c8dc0b9764af07 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期三, 26 六月 2019 10:59:48 +0800 Subject: [PATCH] 邀请对应奖励红包加入版本区分 --- fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java index 221814e..d86add6 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java @@ -29,16 +29,18 @@ import com.yeshi.fanli.service.inter.goods.CommonGoodsService; import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService; import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService; -import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService; +import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService; +import com.yeshi.fanli.service.inter.user.UserInfoExtraService; import com.yeshi.fanli.service.inter.user.UserMoneyExtraService; import com.yeshi.fanli.util.MoneyBigDecimalUtil; import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.factory.CommonGoodsFactory; import com.yeshi.fanli.util.taobao.TaoKeApiUtil; +import com.yeshi.fanli.util.taobao.TaoLiJinUtil; import com.yeshi.fanli.vo.msg.ClientTextStyleVO; import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO; @@ -73,11 +75,13 @@ private UserTaoLiJinOriginService userTaoLiJinOriginService; @Resource - private GoodsTaoLiJinRateService goodsTaoLiJinRateService; + private ConfigTaoLiJinService configTaoLiJinService; @Resource private UserOtherMsgNotificationService userOtherMsgNotificationService; + @Resource + private UserInfoExtraService userInfoExtraService; @Override @@ -108,7 +112,8 @@ } catch (ParseException e2) { e2.printStackTrace(); } - BigDecimal perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods); + // 鏂颁汉绾㈠寘 鑷喘涓�鍏� + BigDecimal perface = new BigDecimal(1); return createUserTaoLiJin(1, uid, goods.getAuctionId(), perface, 1, name, sendStartTime, sendEndTime, null, useEndTime); @@ -138,7 +143,23 @@ e2.printStackTrace(); } - BigDecimal perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods); + boolean isNewUser = userInfoExtraService.isNewUser(uid); + if (isNewUser) { + // 鍒ゅ畾涓鸿�佺敤鎴凤細 鏂颁汉鍙浣跨敤浜嗘柊浜虹孩鍖咃紝涔熷氨鏄偅1鍧楅挶锛岄偅涔堬紝浠栫湅鍒扮殑鍒嗕韩鐖嗘涓殑鍟嗗搧-灏卞彧鑳藉垎浜�� + long countRecord = userTaoLiJinRecordMapper.countRecordByUid(uid); + if (countRecord > 0) { + isNewUser = false; + } + } + + BigDecimal perface = null; + if (isNewUser) { + perface = new BigDecimal(1); + } else { + // 璁$畻鎺ㄥ箍绾㈠寘 + String warningRate = configTaoLiJinService.getValueByKey("warning_value"); + perface = TaoLiJinUtil.getSpreadMoney(warningRate, goods); + } return createUserTaoLiJin(2, uid, goods.getAuctionId(), perface, totalNum, name, sendStartTime, sendEndTime, null, useEndTime); @@ -332,8 +353,6 @@ } else { userTaoLiJinRecordVO.setUserType(1); } - - listGoods.remove(i); break; } } -- Gitblit v1.8.0