diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenRankingQueryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenRankingQueryExe.java index acd7a0f0..121d7bc7 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenRankingQueryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenRankingQueryExe.java @@ -11,6 +11,9 @@ import com.red.circle.other.infra.database.mongo.service.activity.WeekKingQueenC import com.red.circle.other.inner.enums.activity.KingQueenType; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.tool.core.collection.CollectionUtils; +import com.red.circle.tool.core.date.DateFormatConstant; +import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; +import com.red.circle.tool.core.date.ZonedDateTimeUtils; import com.red.circle.tool.core.num.NumUtils; import java.util.List; import java.util.Map; @@ -40,8 +43,8 @@ public class WeekKingQueenRankingQueryExe { public PageResult execute(WeekKingQueenRankingQueryCmd cmd) { Page kingQueenCountPage = pageWeekTop(cmd.getReqSysOrigin().getOrigin(), KingQueenType.valueOf(cmd.getKingQueenType()), - Objects.equals(cmd.getType(), WeekLeaderboardEnum.THIS_WEEK) ? 0 : 1, - PageRequest.of(cmd.getCurrent().intValue() - 1, cmd.getSize().intValue())); + Objects.equals(cmd.getType(), WeekLeaderboardEnum.THIS_WEEK) ? getThisWeekDate() : getLastWeekDate(), + cmd.getCurrent(), cmd.getSize()); List weekKingQueens = kingQueenCountPage.getContent(); @@ -96,9 +99,8 @@ public class WeekKingQueenRankingQueryExe { return CollectionUtils.newArrayList(); } - private Page pageWeekTop(String sysOrigin, KingQueenType type, - Integer weekType, Pageable pageable) { - return weekKingQueenCountService.pageWeekTop(sysOrigin, type, weekType, pageable); + private Page pageWeekTop(String sysOrigin, KingQueenType type, String group, Long current, Long size) { + return weekKingQueenCountService.pageWeekQuery(sysOrigin, type, group, current, size); } private Set getUserIds(List weekStarGiftCounts) { @@ -107,4 +109,17 @@ public class WeekKingQueenRankingQueryExe { .collect(Collectors.toSet()); } + + private String getLastWeekDate() { + return ZonedDateTimeUtils.format(ZonedDateTimeAsiaRiyadhUtils.getLastWeekMonday(), + DateFormatConstant.yyyyMMdd); + } + + + private String getThisWeekDate() { + return ZonedDateTimeUtils.format(ZonedDateTimeAsiaRiyadhUtils.nowWeekMonday(), + DateFormatConstant.yyyyMMdd); + } + + }