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"))