房间新增日统计
This commit is contained in:
parent
a19efc4511
commit
d9024a0d23
@ -47,6 +47,10 @@ public class RoomContributionRankCountServiceImpl implements RoomContributionRan
|
||||
|
||||
// 类型,过期时间,分组日期
|
||||
List<ImmutableTriple<String, Timestamp, Integer>> 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) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user