From f7590e05a540da045812f5d2e18e273efc6be913 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 5 Jan 2026 08:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=A9=BA=E4=B8=8A=E5=91=A8=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E7=8E=8B=E5=A5=96=E5=8A=B1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/activity/RankingRewardGrantCmdExe.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/RankingRewardGrantCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/RankingRewardGrantCmdExe.java index a459f1d1..4e398697 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/RankingRewardGrantCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/RankingRewardGrantCmdExe.java @@ -18,7 +18,9 @@ import com.red.circle.other.inner.model.cmd.material.GivePropsBackpackCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardPropsDTO; import com.red.circle.other.inner.model.dto.sys.ActivityConfigDTO; 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 lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -54,7 +56,7 @@ public class RankingRewardGrantCmdExe { String templateId, List currentRankingUsers, ActivityConfigVO activityConfig) { - RankingRewardSnapshot lastSnapshot = snapshotService.getLatestSnapshot(activityType, origin, cycleKey); + RankingRewardSnapshot lastSnapshot = snapshotService.getLatestSnapshot(activityType, origin, isWeeklyReset() ? getLastWeekDate() : cycleKey); Map currentRankMap = currentRankingUsers.stream() .collect(Collectors.toMap(RankingUserData::getRank, u -> u)); @@ -121,6 +123,12 @@ public class RankingRewardGrantCmdExe { return now.getDayOfWeek() == DayOfWeek.MONDAY && now.getHour() == 0 && now.getMinute() == 0; } + private String getLastWeekDate() { + return ZonedDateTimeUtils.format(ZonedDateTimeAsiaRiyadhUtils.getLastWeekMonday(), + DateFormatConstant.yyyyMMdd); + } + + /** * 收回所有用户的奖励(星期一重置). */