清空上周游戏王奖励处理
This commit is contained in:
parent
6ca7fd6046
commit
f7590e05a5
@ -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.activity.props.ActivityRewardPropsDTO;
|
||||||
import com.red.circle.other.inner.model.dto.sys.ActivityConfigDTO;
|
import com.red.circle.other.inner.model.dto.sys.ActivityConfigDTO;
|
||||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
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.ZonedDateTimeAsiaRiyadhUtils;
|
||||||
|
import com.red.circle.tool.core.date.ZonedDateTimeUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -54,7 +56,7 @@ public class RankingRewardGrantCmdExe {
|
|||||||
String templateId, List<RankingUserData> currentRankingUsers,
|
String templateId, List<RankingUserData> currentRankingUsers,
|
||||||
ActivityConfigVO activityConfig) {
|
ActivityConfigVO activityConfig) {
|
||||||
|
|
||||||
RankingRewardSnapshot lastSnapshot = snapshotService.getLatestSnapshot(activityType, origin, cycleKey);
|
RankingRewardSnapshot lastSnapshot = snapshotService.getLatestSnapshot(activityType, origin, isWeeklyReset() ? getLastWeekDate() : cycleKey);
|
||||||
|
|
||||||
Map<Integer, RankingUserData> currentRankMap = currentRankingUsers.stream()
|
Map<Integer, RankingUserData> currentRankMap = currentRankingUsers.stream()
|
||||||
.collect(Collectors.toMap(RankingUserData::getRank, u -> u));
|
.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;
|
return now.getDayOfWeek() == DayOfWeek.MONDAY && now.getHour() == 0 && now.getMinute() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getLastWeekDate() {
|
||||||
|
return ZonedDateTimeUtils.format(ZonedDateTimeAsiaRiyadhUtils.getLastWeekMonday(),
|
||||||
|
DateFormatConstant.yyyyMMdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收回所有用户的奖励(星期一重置).
|
* 收回所有用户的奖励(星期一重置).
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user