From d9024a0d23bd441980319c1c36c30fb6072e9885 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 29 Sep 2025 17:38:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E6=96=B0=E5=A2=9E=E6=97=A5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RoomContributionRankCountServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/live/impl/RoomContributionRankCountServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/live/impl/RoomContributionRankCountServiceImpl.java index bdece2a6..acb6792d 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/live/impl/RoomContributionRankCountServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/live/impl/RoomContributionRankCountServiceImpl.java @@ -47,6 +47,10 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan // 类型,过期时间,分组日期 List> dates = List.of( + ImmutableTriple.of("HOUR", + TimestampUtils.nowPlusHours(1), + dateNumberNowHour() + ), ImmutableTriple.of("DAY", TimestampUtils.nowPlusDays(1), dateNumberNowDay() @@ -108,6 +112,9 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan } private Integer getDateNumber(String dateType) { + if (Objects.equals(dateType, "HOUR")) { + return dateNumberNowHour(); + } if (Objects.equals(dateType, "DAY")) { return dateNumberNowDay(); } @@ -120,6 +127,10 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan return 0; } + private Integer dateNumberNowHour() { + return Integer.valueOf(ZonedDateTimeAsiaRiyadhUtils.nowFormat("yyyyMMddHH")); + } + private Integer dateNumberNowMonth() { return ZonedDateTimeAsiaRiyadhUtils.nowYearMonthToInt(); } @@ -193,6 +204,7 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan return; } + updateCorrectionData(roomId, userId, "HOUR", quantity.longValue()); updateCorrectionData(roomId, userId, "DAY", quantity.longValue()); updateCorrectionData(roomId, userId, "WEEK", quantity.longValue()); updateCorrectionData(roomId, userId, "MONTH", quantity.longValue()); @@ -200,7 +212,7 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan } /** - * 矫正年月日数据 + * 矫正数据 */ private void updateCorrectionData(Long roomId, Long userId, String dateType, Long quantity) {