From 70c739849ec47cf77baa850ec721f498a944bf34 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 12 Mar 2026 18:45:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E7=A0=81=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=8C=20firstRecharge=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/other/app/command/activity/BindInviteCodeExe.java | 3 +++ .../gateway/user/UserRunProfileTransportGatewayImpl.java | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/BindInviteCodeExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/BindInviteCodeExe.java index 24947ae2..8c860cd6 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/BindInviteCodeExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/BindInviteCodeExe.java @@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import java.sql.Timestamp; import java.time.ZonedDateTime; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.concurrent.TimeUnit; @@ -160,6 +161,8 @@ public class BindInviteCodeExe { log.info("绑定邀请码成功, userId={}, inviterUserId={}, inviteCode={}, inviteType={}, deviceId={}", userId, inviterProfile.getId(), inviteCode, inviteType, deviceId); + userProfileGateway.removeCacheAll(Collections.singleton(userId)); + // 增加用户每日邀请用户数量 int inviteCount = incrementDailyInviteCount(inviterProfile.getId()); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index b984d99b..399909ac 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -132,9 +132,8 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo private static void checkAndUpdateFirstCharge(UserRunProfile userRunProfile) { if (userRunProfile.getFirstRecharge() != null && userRunProfile.getFirstRecharge()) { - LocalDateTime createTime = userRunProfile.getFirstRechargeEndTime().toLocalDateTime(); - Duration duration = Duration.between(LocalDateTime.now(), createTime); - if (duration.toDays() >= 7) { + LocalDateTime endTime = userRunProfile.getFirstRechargeEndTime().toLocalDateTime(); + if (LocalDateTime.now().isAfter(endTime)) { userRunProfile.setFirstRecharge(false); userRunProfile.setFirstRechargeEndTime(null); }