From 26e3e6452df6fdf2d145775871af0a27fd01cdd2 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 30 八月 2019 18:24:45 +0800 Subject: [PATCH] 金币限制 --- fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java | 31 +++++++++++++------------------ 1 files changed, 13 insertions(+), 18 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java index 13718a6..90d90da 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java @@ -1,7 +1,6 @@ package com.yeshi.fanli.service.impl.integral; import java.util.Date; -import java.util.List; import javax.annotation.Resource; @@ -14,9 +13,9 @@ import com.yeshi.fanli.entity.bus.user.UserInfoExtra; import com.yeshi.fanli.entity.bus.user.UserRank; import com.yeshi.fanli.entity.integral.IntegralTask; -import com.yeshi.fanli.entity.integral.IntegralTaskRank; import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum; import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum; +import com.yeshi.fanli.entity.integral.IntegralTaskRank; import com.yeshi.fanli.entity.integral.IntegralTaskRecord; import com.yeshi.fanli.exception.integral.IntegralGetException; import com.yeshi.fanli.exception.integral.IntegralTaskRecordException; @@ -45,10 +44,10 @@ @Resource private RedisManager redisManager; - + @Resource private UserInfoExtraService userInfoExtraService; - + @Resource private IntegralTaskRankService integralTaskRankService; @@ -80,19 +79,19 @@ if (count > 0) throw new IntegralGetException(2, "浜嬩欢瑙﹀彂杈惧埌涓婇檺"); } - + UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid); if (userInfoExtra == null) throw new IntegralGetException(2, "棰濆淇℃伅涓嶅瓨鍦�"); - + UserRank userRank = userInfoExtra.getUserRank(); if (userRank == null) - throw new IntegralGetException(2,"绛夌骇淇℃伅涓嶅瓨鍦�"); + throw new IntegralGetException(2, "绛夌骇淇℃伅涓嶅瓨鍦�"); int goldCoin = task.getGoldCoin(); if (task.getDoubleNum() != null && task.getDoubleNum() > 0) goldCoin = task.getDoubleNum() * goldCoin; - + Long taskId = task.getId(); IntegralTaskRank traskRank = integralTaskRankService.getByTsakIdAndRankId(taskId, userRank.getId()); if (traskRank != null) { @@ -288,6 +287,7 @@ } @IntegralGetVersionLimit(uid = "#uid") + @IntegralGetFrequencyLimit(key = "shareSingleGoods", time = 45) @Async() @Override public void addShareSingleGoods(Long uid) { @@ -299,6 +299,7 @@ } @IntegralGetVersionLimit(uid = "#uid") + @IntegralGetFrequencyLimit(key = "shareMultipleGoods", time = 45) @Async() @Override public void addShareMultipleGoods(Long uid) { @@ -418,10 +419,6 @@ @Override public void addRebateOrder(Long uid) { try { - UserInfo boss = getBossByUid(uid); - if (boss != null) - addInviteOrderLevelOne(boss.getId()); - addEventStatistic(uid, TaskUniqueKeyEnum.rebateOrder.name()); } catch (Exception e) { LogHelper.errorDetailInfo(e); @@ -435,12 +432,9 @@ */ @IntegralGetVersionLimit(uid = "#uid") @Async() - private void addInviteOrderLevelOne(Long uid) { + @Override + public void addInviteOrderLevelOne(Long uid) { try { - UserInfo boss = getBossByUid(uid); - if (boss != null) - addInviteOrderLevelTwo(boss.getId()); - addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name()); } catch (Exception e) { LogHelper.errorDetailInfo(e); @@ -454,7 +448,8 @@ */ @IntegralGetVersionLimit(uid = "#uid") @Async() - private void addInviteOrderLevelTwo(Long uid) { + @Override + public void addInviteOrderLevelTwo(Long uid) { try { addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name()); } catch (Exception e) { -- Gitblit v1.8.0