From 3c316cdb1594e52a26f206f8d03024d85b12c48d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 6 Nov 2025 19:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7=E5=88=B8=E5=92=8C=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../propcoupon/PropCouponUseCmdExe.java | 28 +++++++++++-------- .../app/listener/gift/GiveGiftsListener.java | 14 ++++++++-- .../gift/strategy/RankCountStrategy.java | 2 ++ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java index 6faae721..3e4e0463 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java @@ -18,6 +18,7 @@ import com.red.circle.other.inner.asserts.OtherErrorCode; import com.red.circle.other.inner.asserts.user.UserErrorCode; import com.red.circle.other.inner.endpoint.live.RoomManagerClient; import com.red.circle.other.inner.endpoint.material.props.*; +import com.red.circle.other.inner.endpoint.user.user.UserProfileClient; import com.red.circle.other.inner.enums.material.BadgeBackpackExpireTypeEnum; import com.red.circle.other.inner.enums.material.ConsolePropsTypeEnum; import com.red.circle.other.inner.enums.material.SysNobleVipTypeEnum; @@ -52,7 +53,7 @@ public class PropCouponUseCmdExe { private final RoomThemeBackpackClient roomThemeBackpackClient; private final PropCouponUseRecordDAO propCouponUseRecordDAO; private final PropsCommodityStoreClient propsCommodityStoreClient; - private final PropsCommodityStoreService propsCommodityStoreService; + private final UserProfileClient userProfileClient; private final PropsNobleVipClient propsNobleVipClient; private final RoomManagerClient roomManagerClient; @@ -149,16 +150,9 @@ public class PropCouponUseCmdExe { roomManagerClient.updateRoomSettingMemberCapacity(userId, vipAbility.getRoomMaxMember(), vipAbility.getAdminNumber()); - //保存vip实际权益有效时间 -// Boolean isDuke = Objects.equals(vipAbility.getVipType(), SysNobleVipTypeEnum.DUKE.name()); -// Boolean isKing = Objects.equals(vipAbility.getVipType(), SysNobleVipTypeEnum.KING.name()); -// Boolean isBuy = Objects.equals(cmd.getVipOrigin(), SendPropsOrigin.BUY_OR_GIVE.name()); -// Boolean isActivity = Objects -// .equals(cmd.getVipOrigin(), SendPropsOrigin.ACTIVITY_AWARD.name()); -// if ((isDuke || isKing) && (isBuy || isActivity)) { -// propsNobleVipClient.addActualEquity(cmd.getReceiverId(), -// vipAbility.getId(), Long.valueOf(cmd.getExchangeDays())); -// } + + // 使用最大等级的VIP + useMaxNobleVip(userId); break; case CHAT_BUBBLE: @@ -196,6 +190,18 @@ public class PropCouponUseCmdExe { } } + private void useMaxNobleVip(Long receiverId) { + PropsNobleVipAbilityDTO abilityDTO = propsNobleVipClient.getUserMaxAbilityDTO(receiverId).getBody(); + if (Objects.isNull(abilityDTO)) { + return; + } + propsBackpackClient.switchUseProps(receiverId, abilityDTO.getId()); + propsBackpackClient.switchUseProps(receiverId, abilityDTO.getAvatarFrameId()); + propsBackpackClient.switchUseProps(receiverId, abilityDTO.getDataCardId()); + propsBackpackClient.switchUseProps(receiverId, abilityDTO.getCarId()); + userProfileClient.removeCacheAll(receiverId); + } + /** * 赠送普通道具(头像框、座驾、VIP、聊天气泡、资料卡、飘屏) */ 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 710aaa60..cf9ea32c 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 @@ -38,6 +38,7 @@ import com.red.circle.other.app.dto.cmd.game.barrage.GameUserEffectsCmd; import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.live.LiveHeartbeatCache; import com.red.circle.other.domain.model.user.ability.RegionConfig; +import com.red.circle.other.domain.ranking.RankingActivityType; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.cache.service.other.LiveHeartbeatCacheService; import com.red.circle.other.infra.database.mongo.entity.gift.GiftAcceptUser; @@ -881,8 +882,7 @@ public class GiveGiftsListener implements MessageListener { return new GiftValue() .setCurrencyType(giftConfig.getType()) - .setGiftType(event.checkWeekStar() ? GiftSpecialEnum.STAR.name() : event.checkWeekKingQueen() - ? GiftSpecialEnum.KING_QUEEN.name() : giftConfig.getGiftTab()) + .setGiftType(getGiftType(event, giftConfig)) .setUnitPrice(giftConfig.getGiftCandy()) .setQuantity(event.getQuantity()) .setUserSize(event.acceptUserSize()) @@ -893,8 +893,16 @@ public class GiveGiftsListener implements MessageListener { .setBag(event.getBagGift()); } + private static String getGiftType(GiveAwayGiftBatchEvent event, GiveGiftConfig giftConfig) { + return event.checkWeekStar() ? GiftSpecialEnum.STAR.name() : + event.checkWeekKingQueen() ? GiftSpecialEnum.KING_QUEEN.name() : + giftConfig.getSpecial().contains(RankingActivityType.REVOLUTION_DAY.name()) ? giftConfig.getSpecial() : + giftConfig.getSpecial().contains(RankingActivityType.HEROES_DAY.name()) ? giftConfig.getSpecial() : + giftConfig.getGiftTab(); + } - private Timestamp getCreateTime(GiveAwayGiftBatchEvent event) { + + 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 e0873d37..007e5c7e 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 @@ -2,6 +2,7 @@ package com.red.circle.other.app.listener.gift.strategy; import com.alibaba.fastjson.JSON; import com.google.common.collect.Lists; +import com.red.circle.framework.core.dto.ReqSysOrigin; import com.red.circle.mq.business.model.event.gift.OfflineProcessGiftEvent; import com.red.circle.other.app.common.gift.GameLuckyGiftCommon; import com.red.circle.other.app.dto.cmd.activity.RankingDataUpdateCmd; @@ -428,6 +429,7 @@ public class RankCountStrategy implements GiftStrategy { receiverCmd.setDimension(RankingDimension.CONSUME_AMOUNT.getCode()); receiverCmd.setIncrementQuantity(actualAmount); receiverCmd.setBizNo(runningWater.getId().toString()); + receiverCmd.setReqSysOrigin(ReqSysOrigin.of("LIKEI")); rankingActivityService.accumulateRankingData(receiverCmd); }