From 9356ff0cfb2d496c567fbfefd52f187cb22ca9bb Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 5 Mar 2026 18:29:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E7=94=A8=E6=88=B7=E9=80=81=E7=A4=BC?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=20=E5=B9=B8=E8=BF=90=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E9=AD=94=E6=B3=95=E7=A4=BC=E7=89=A9=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/app/common/gift/GameLuckyGiftCommon.java | 10 +++++++++- .../app/listener/gift/strategy/GiftCountStrategy.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) 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 bbc5db5b..7eeb8f9a 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 @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; import com.red.circle.component.mq.MessageEvent; import com.red.circle.component.mq.service.FixedTopic; +import com.red.circle.component.redis.service.RedisService; import com.red.circle.external.inner.endpoint.message.ImGroupClient; import com.red.circle.external.inner.model.cmd.message.BroadcastGroupMsgBodyCmd; import com.red.circle.external.inner.model.cmd.message.CustomGroupMsgBodyCmd; @@ -35,6 +36,7 @@ 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.task.RoomDailyTaskProgressService; +import com.red.circle.other.app.util.DateTimeAsiaRiyadhUtils; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.ranking.RankingActivityType; import com.red.circle.other.domain.ranking.RankingCycleType; @@ -83,6 +85,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.security.MessageDigest; import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import lombok.Data; import lombok.RequiredArgsConstructor; @@ -121,6 +124,7 @@ public class GameLuckyGiftCommon { private final ActivityRechargeTicketService activityRechargeTicketService; private final RoomDailyTaskProgressService roomDailyTaskProgressService; private final RoomMemberService roomMemberService; + private final RedisService redisService; /** * 发送幸运礼物抽奖mq. @@ -282,11 +286,15 @@ public class GameLuckyGiftCommon { return; } + String redisKey = "room:daily:task:progress:" + taskType.name() + ":" + param.getUserId() + ":" + ZonedDateTimeAsiaRiyadhUtils.now().toLocalDate(); + Long total = redisService.increment(redisKey, rewardAmount); + redisService.expire(redisKey, DateTimeAsiaRiyadhUtils.getSecondsUntilMidnight(), TimeUnit.SECONDS); + roomDailyTaskProgressService.updateTaskProgress( new RoomDailyTaskProgressUpdateCmd() .setUserId(param.getUserId()) .setTaskCode(taskType.name()) - .setProgressValue(rewardAmount.intValue()) + .setProgressValue(total.intValue()) ); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java index a18d8ac0..c5dbbc61 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java @@ -231,7 +231,7 @@ public class GiftCountStrategy implements GiftStrategy { long actualAmount = getActualAmount(runningWater.getGiftValue(), runningWater.getGiftValue().getActualAmount()); // 给用户送礼 - if (!roomMember.getUserId().equals(userId)) { + if (!roomProfile.getUserId().equals(userId)) { handleSendGiftTask(userId, acceptUserIds, RoomDailyTaskCode.PERSONAL_SEND_GIFT); }