From 7966cd8166a779f8aa92b40f98f3e6ed96e67e9e Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 6 Mar 2026 16:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=88=90=E5=91=98=E8=BA=AB=E4=BB=BD=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A030=E5=A4=A9=E9=98=B2=E5=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/room/RoomMemberChangeIdentityCmdExe.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/RoomMemberChangeIdentityCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/RoomMemberChangeIdentityCmdExe.java index 1e90e29d..d8dfaf15 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/RoomMemberChangeIdentityCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/room/RoomMemberChangeIdentityCmdExe.java @@ -238,6 +238,14 @@ public class RoomMemberChangeIdentityCmdExe { if (Objects.isNull(roomMember)) { return; } + + // 防止反复 游客<->成员 刷任务:30天内同一房主+成员组合只计一次 + String memberHistoryKey = "room:daily:task:member_history:" + roomOwnerId + ":" + enterUserId; + boolean isFirstJoin = redisService.setIfAbsent(memberHistoryKey, "1", 30, TimeUnit.DAYS); + if (!isFirstJoin) { + return; + } + LocalDate createDate = roomMember.getCreateTime().toLocalDateTime() .atZone(java.time.ZoneOffset.UTC) .withZoneSameInstant(ZoneId.of("Asia/Riyadh"))