From fb54999074e793feb241d0cb4656eecb6a39c828 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 29 May 2026 14:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=83=AD=E9=97=A8=E6=B8=B8=E6=88=8F=20?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=B8=8B=E6=9E=B6=E7=9A=84=E6=B8=B8=E6=88=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/game/ranking/GameRankingQryExe.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java index 63ba112a..9ac67fe5 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/game/ranking/GameRankingQryExe.java @@ -11,11 +11,14 @@ import com.red.circle.other.domain.game.GameRankingPeriodType; import com.red.circle.other.domain.game.GameRankingRecord; import com.red.circle.other.domain.gateway.game.GameRankingGateway; import com.red.circle.other.infra.database.cache.key.GameRankingKeys; +import com.red.circle.other.infra.database.rds.entity.sys.GameListConfig; +import com.red.circle.other.infra.database.rds.service.sys.GameListConfigService; import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -32,6 +35,7 @@ public class GameRankingQryExe { private final GameRankingGateway gameRankingGateway; private final GameRankingConvertor gameRankingConvertor; private final RedisService redisService; + private final GameListConfigService gameListConfigService; /** * 缓存过期时间:30秒 @@ -63,8 +67,17 @@ public class GameRankingQryExe { }) .collect(Collectors.toList()); + Set showcaseGameIds = gameListConfigService.query() + .in(GameListConfig::getGameId, coList.stream().map(GameRankingCO::getGameId).collect(Collectors.toSet())) + .eq(GameListConfig::getShowcase, Boolean.TRUE) + .list() + .stream() + .map(GameListConfig::getGameId) + .collect(Collectors.toSet()); + // latest 排前,非 latest 保持原 totalPrizeAmount 排序 List sorted = coList.stream() + .filter(co -> showcaseGameIds.contains(co.getGameId())) .sorted((a, b) -> { boolean aLatest = a.isLatest(); boolean bLatest = b.isLatest();