From ec14ac9fd79928bafd789aac1c0a35395ef15b87 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 2 Feb 2026 21:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EcurrentDay=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/task/query/CheckInRewardQryExe.java | 10 ++++++++-- .../app/dto/clientobject/task/CheckInRewardListCO.java | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/query/CheckInRewardQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/query/CheckInRewardQryExe.java index 4e3229b2..0682dc73 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/query/CheckInRewardQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/query/CheckInRewardQryExe.java @@ -12,6 +12,8 @@ import com.red.circle.other.infra.database.cache.service.other.CheckInCacheServi import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import java.util.List; import java.util.Optional; + +import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -35,9 +37,13 @@ public class CheckInRewardQryExe { .listActivityResource(cmd.requireReqSysOriginEnum(), activityType)); + String dailyKey = CheckInKeys.AZIZI_CHECK_IN.getKey("AZIZI_CHECK_IN" + cmd.getReqUserId() + ZonedDateTimeAsiaRiyadhUtils.nowDateToInt()); + Boolean checkIn = checkInCacheService.checkDailyCheckIn(cmd.getReqUserId(), dailyKey); + Integer days = Optional.ofNullable(checkInCacheService.getCheckInDays(buildKey(cmd.getReqUserId(), activityType.name()))).orElse(0); + return new CheckInRewardListCO() - .setDays(Optional.ofNullable(checkInCacheService.getCheckInDays(buildKey(cmd.getReqUserId(), activityType.name()))) - .orElse(0)) + .setDays(days) + .setCurrentDay(checkIn ? days : Math.min(days + 1, 7) ) .setRewards(rewards); } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/task/CheckInRewardListCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/task/CheckInRewardListCO.java index dcefb84b..98a70cfc 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/task/CheckInRewardListCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/task/CheckInRewardListCO.java @@ -24,6 +24,11 @@ public class CheckInRewardListCO extends ClientObject { */ private Integer days; + /** + * 当前天数 + */ + private Integer currentDay; + /** * 打卡奖励列表