diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/CpLevelUpAvatarFrameService.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/CpLevelUpAvatarFrameService.java index 18a77bcb..5c9d1558 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/CpLevelUpAvatarFrameService.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/CpLevelUpAvatarFrameService.java @@ -5,6 +5,7 @@ import com.red.circle.other.domain.gateway.props.ActivitySourceGroupGateway; import com.red.circle.other.domain.gateway.props.PropsStoreGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.model.user.UserProfile; +import com.red.circle.other.infra.database.rds.entity.props.PropsBackpack; import com.red.circle.other.infra.database.rds.entity.user.user.CpLevelConfig; import com.red.circle.other.infra.database.rds.entity.user.user.CpRelationship; import com.red.circle.other.infra.database.rds.service.user.user.CpValueService; @@ -16,6 +17,7 @@ import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardProps; import com.red.circle.other.inner.model.dto.material.props.ProductProps; import com.red.circle.other.inner.model.dto.material.props.PropsResources; import com.red.circle.tool.core.collection.CollectionUtils; +import com.red.circle.tool.core.date.TimestampUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -34,7 +36,7 @@ import java.util.Objects; @RequiredArgsConstructor public class CpLevelUpAvatarFrameService { - private static final int DAYS = 36500; + private static final int DAYS = 30; private final CpValueService cpValueService; private final UserProfileGateway userProfileGateway; @@ -110,8 +112,9 @@ public class CpLevelUpAvatarFrameService { return; } - if (propsBackpackService.getUserProps(userId, propsSourceId, PropsCommodityType.AVATAR_FRAME) != null) { - log.info("CP头像框已存在背包,跳过发放, userId={}, propsSourceId={}", userId, propsSourceId); + PropsBackpack userProps = propsBackpackService.getUserProps(userId, propsSourceId, PropsCommodityType.AVATAR_FRAME); + if (userProps != null && TimestampUtils.expiredIntervalMillisecond(userProps.getExpireTime(), TimestampUtils.now()) < 0) { + log.info("CP头像框未过期已存在背包,跳过发放, userId={}, propsSourceId={}", userId, propsSourceId); return; }