From 05a202ed50bf1044d4617c8bf194a970a66dd9de Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 5 Mar 2026 19:02:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B8=E8=BF=90=E7=A4=BC=E7=89=A9=E9=AD=94?= =?UTF-8?q?=E6=B3=95=E7=A4=BC=E7=89=A9=E5=8E=BB=E9=99=A4=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E6=88=BF=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/app/common/gift/GameLuckyGiftCommon.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/gift/GameLuckyGiftCommon.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/gift/GameLuckyGiftCommon.java index 7eeb8f9a..256afcc0 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/gift/GameLuckyGiftCommon.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/gift/GameLuckyGiftCommon.java @@ -35,6 +35,7 @@ import com.red.circle.other.app.dto.cmd.gift.GiveAwayGiftBatchCmd; import com.red.circle.other.app.dto.cmd.task.RoomDailyTaskProgressUpdateCmd; import com.red.circle.other.app.service.activity.ActivityRechargeTicketService; import com.red.circle.other.app.service.activity.RankingActivityService; +import com.red.circle.other.app.service.room.RoomProfileService; import com.red.circle.other.app.service.task.RoomDailyTaskProgressService; import com.red.circle.other.app.util.DateTimeAsiaRiyadhUtils; import com.red.circle.other.domain.gateway.user.UserProfileGateway; @@ -49,6 +50,8 @@ import com.red.circle.other.infra.database.cache.entity.game.luckgift.LuckyGiftI import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.cache.service.other.GameLuckyGiftCacheService; import com.red.circle.other.infra.database.cache.service.other.GiftCacheService; +import com.red.circle.other.infra.database.mongo.entity.live.RoomProfileManager; +import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; import com.red.circle.other.infra.database.rds.entity.game.GameLuckyGiftCount; import com.red.circle.other.infra.database.rds.entity.game.GameLuckyGiftRuleConfig; import com.red.circle.other.infra.database.rds.entity.game.LuckyGiftProbability; @@ -125,6 +128,7 @@ public class GameLuckyGiftCommon { private final RoomDailyTaskProgressService roomDailyTaskProgressService; private final RoomMemberService roomMemberService; private final RedisService redisService; + private final RoomProfileManagerService roomProfileManagerService; /** * 发送幸运礼物抽奖mq. @@ -285,6 +289,11 @@ public class GameLuckyGiftCommon { if (roomMember == null) { return; } + // 在自己的房间直接返回 + RoomProfileManager profileManager = roomProfileManagerService.getById(param.getRoomId()); + if (profileManager == null || Objects.equals(profileManager.getId(), roomMember.getRoomId())) { + return; + } String redisKey = "room:daily:task:progress:" + taskType.name() + ":" + param.getUserId() + ":" + ZonedDateTimeAsiaRiyadhUtils.now().toLocalDate(); Long total = redisService.increment(redisKey, rewardAmount);