From 07b0a29d6c6262197d0c88a06704be16c17eb12d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 18 Dec 2025 18:13:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/app/listener/GameKingRewardListener.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/GameKingRewardListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/GameKingRewardListener.java index 691aff17..352d2f07 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/GameKingRewardListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/GameKingRewardListener.java @@ -15,12 +15,19 @@ import com.red.circle.other.app.command.activity.RankingRewardGrantCmdExe; import com.red.circle.other.app.dto.clientobject.sys.ActivityConfigVO; import com.red.circle.other.app.service.activity.WeekKingQueenService; import com.red.circle.other.app.util.DistributedLockUtil; +import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; +import com.red.circle.other.inner.enums.config.EnumConfigKey; +import com.red.circle.other.inner.model.dto.sys.EnumConfigDTO; import com.red.circle.tool.core.collection.CollectionUtils; +import com.red.circle.tool.core.text.StringUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import java.util.Arrays; +import java.util.Collections; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -35,6 +42,7 @@ public class GameKingRewardListener implements MessageListener { private final DistributedLockUtil distributedLockUtil; private final WeekKingQueenService weekKingQueenService; private final RankingRewardGrantCmdExe rankingRewardGrantCmdExe; + private final EnumConfigCacheService enumConfigCacheService; @Override public Action consume(ConsumerMessage message) { @@ -74,6 +82,12 @@ public class GameKingRewardListener implements MessageListener { activityType, origin, cycleKey, templateId, event.getRankingUsers() != null ? event.getRankingUsers().size() : 0); + String whiteConfig = Optional.ofNullable(enumConfigCacheService.getByCode("TEST_UID", origin)).map(EnumConfigDTO::getVal).orElse(null); + List whiteIds = StringUtils.isNotBlank(whiteConfig) ? Arrays.asList(whiteConfig.split(",")) : Collections.emptyList(); + event.setRankingUsers( + event.getRankingUsers().stream().filter(e -> whiteIds.contains(String.valueOf(e.getUserId()))).toList() + ); + if (CollectionUtils.isEmpty(event.getRankingUsers())) { log.warn("排名用户列表为空,跳过处理"); return null;