活动处理
This commit is contained in:
parent
adf5e91215
commit
ad095d0b6b
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -23,10 +23,14 @@ public enum RankingActivityType {
|
||||
HEROES_DAY(2, "英雄日", "统计送礼物消费排行"),
|
||||
|
||||
/**
|
||||
* 充值榜
|
||||
*
|
||||
* 巴勒斯坦独立日
|
||||
*/
|
||||
RECHARGE(3, "充值榜", "统计用户充值金额排行"),
|
||||
PALESTIAN_DAY(3, "巴勒斯坦独立日", "统计送礼物消费排行"),
|
||||
|
||||
/**
|
||||
* 阿曼国庆日
|
||||
*/
|
||||
OMAN_DAY(4, "阿曼国庆日", "统计送礼物消费排行"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user