活动处理

This commit is contained in:
tianfeng 2025-11-14 19:38:39 +08:00
parent adf5e91215
commit ad095d0b6b
3 changed files with 35 additions and 17 deletions

View File

@ -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();

View File

@ -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);

View File

@ -23,10 +23,14 @@ public enum RankingActivityType {
HEROES_DAY(2, "英雄日", "统计送礼物消费排行"),
/**
* 充值榜
*
* 巴勒斯坦独立日
*/
RECHARGE(3, "充值榜", "统计用户充值金额排行"),
PALESTIAN_DAY(3, "巴勒斯坦独立日", "统计送礼物消费排行"),
/**
* 阿曼国庆日
*/
OMAN_DAY(4, "阿曼国庆日", "统计送礼物消费排行"),
;