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