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; + /** * 打卡奖励列表