diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java index 97579cc1..71657833 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java @@ -894,13 +894,29 @@ public class GiveGiftsListener implements MessageListener { } private static String getGiftType(GiveAwayGiftBatchEvent event, GiveGiftConfig giftConfig) { - return event.checkWeekStar() ? giftConfig.getSpecial() : - event.checkWeekKingQueen() ? giftConfig.getSpecial() : - giftConfig.getSpecial().contains(RankingActivityType.REVOLUTION_DAY.name()) ? giftConfig.getSpecial() : - giftConfig.getSpecial().contains(RankingActivityType.HEROES_DAY.name()) ? giftConfig.getSpecial() : - giftConfig.getGiftTab(); + // 周星、周王后或排行榜礼物,使用特殊礼物类型 + if (event.checkWeekStar() || event.checkWeekKingQueen() || isRankingGift(giftConfig.getSpecial())) { + return giftConfig.getSpecial(); + } + + // 普通礼物,使用默认礼物Tab + return giftConfig.getGiftTab(); } + private static boolean isRankingGift(String special) { + if (special == null || special.isEmpty()) { + return false; + } + + for (RankingActivityType activityType : RankingActivityType.values()) { + if (special.contains(activityType.name())) { + return true; + } + } + + return false; + } + private Timestamp getCreateTime(GiveAwayGiftBatchEvent event) { return Objects.nonNull(event.getCreateTime()) ? event.getCreateTime() : TimestampUtils.now(); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java index 007e5c7e..8abffeb6 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java @@ -404,15 +404,13 @@ public class RankCountStrategy implements GiftStrategy { String giftType = runningWater.getGiftValue().getGiftType(); - if (giftType.contains(RankingActivityType.REVOLUTION_DAY.name())) { - // 累计送礼用户数据(革命日) - getDataUpdateCmd(runningWater, senderProfile.getUserSex(), cycleKey, actualAmount, RankingActivityType.REVOLUTION_DAY); - } - - if (giftType.contains(RankingActivityType.HEROES_DAY.name())) { - // 累计接收用户数据(英雄日 ) - getDataUpdateCmd(runningWater, senderProfile.getUserSex(), cycleKey, actualAmount, RankingActivityType.HEROES_DAY); - } + // 遍历所有排行榜活动类型 + for (RankingActivityType activityType : RankingActivityType.values()) { + if (giftType.contains(activityType.name())) { + // 累计对应活动类型的数据 + getDataUpdateCmd(runningWater, senderProfile.getUserSex(), cycleKey, actualAmount, activityType); + } + } } catch (Exception e) { log.error("累计新排行榜数据异常, runningWaterId={}", runningWater.getId(), e); diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/ranking/RankingActivityType.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/ranking/RankingActivityType.java index 08e8ac1a..07962c8b 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/ranking/RankingActivityType.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/ranking/RankingActivityType.java @@ -23,10 +23,14 @@ public enum RankingActivityType { HEROES_DAY(2, "英雄日", "统计送礼物消费排行"), /** - * 充值榜 - * + * 巴勒斯坦独立日 */ - RECHARGE(3, "充值榜", "统计用户充值金额排行"), + PALESTIAN_DAY(3, "巴勒斯坦独立日", "统计送礼物消费排行"), + + /** + * 阿曼国庆日 + */ + OMAN_DAY(4, "阿曼国庆日", "统计送礼物消费排行"), ;