diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java index 541efc73..1ef72306 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/PropsBackpackService.java @@ -131,9 +131,9 @@ public interface PropsBackpackService extends BaseService { List listNotExpiredUseProps(Long userId); /** - * 获取一组未过期的道具信息. + * 获取一组正在使用道具信息. */ - List listNotExpiredProps(Set userIds); + List listNotExpiredUseProps(Set userIds); /** * 获取一组正在使用道具信息. diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java index 6c58e1af..b92572c3 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/props/impl/PropsBackpackServiceImpl.java @@ -194,13 +194,14 @@ public class PropsBackpackServiceImpl extends } @Override - public List listNotExpiredProps(Set userIds) { + public List listNotExpiredUseProps(Set userIds) { if (CollectionUtils.isEmpty(userIds)) { return Lists.newArrayList(); } return Optional.ofNullable(query() .in(userIds.size() > 1, PropsBackpack::getUserId, userIds) .eq(Objects.equals(userIds.size(), 1), PropsBackpack::getUserId, userIds.iterator().next()) + .eq(PropsBackpack::getUseProps, Boolean.TRUE) .gt(PropsBackpack::getExpireTime, TimestampUtils.now()) .list()) .orElse(Lists.newArrayList()); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 5213ddc7..dba58552 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -21,6 +21,7 @@ import com.red.circle.other.infra.database.rds.entity.family.FamilyMemberInfo; import com.red.circle.other.infra.database.rds.entity.props.PropsBackpack; import com.red.circle.other.infra.database.rds.entity.user.user.BaseInfo; import com.red.circle.other.infra.database.rds.entity.user.user.OneTimeTask; +import com.red.circle.other.infra.database.rds.entity.user.user.CpRelationship; import com.red.circle.other.infra.database.rds.service.badge.BadgeConfigService; import com.red.circle.other.infra.database.rds.service.badge.BadgePictureConfigService; import com.red.circle.other.infra.database.rds.service.family.FamilyMemberInfoService; @@ -30,6 +31,8 @@ import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpa import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService; import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService; import com.red.circle.other.infra.database.rds.service.user.user.OneTimeTaskService; +import com.red.circle.other.infra.database.rds.service.user.user.CpRelationshipService; +import com.red.circle.other.infra.database.rds.service.user.user.CpValueService; import com.red.circle.other.infra.utils.ZonedDateTimeUtils; import com.red.circle.other.inner.enums.material.BadgeBackpackExpireType; import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum; @@ -45,13 +48,17 @@ import com.red.circle.other.inner.model.dto.material.UseBadgeDTO; import com.red.circle.other.inner.model.dto.material.UsePropsDTO; import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO; import com.red.circle.other.inner.model.dto.user.PhotoItem; +import com.red.circle.other.inner.model.dto.user.CpSimpleUserProfileCO; import com.red.circle.tool.core.collection.CollectionUtils; +import com.red.circle.tool.core.date.DateUtils; import com.red.circle.tool.core.date.TimestampUtils; import com.red.circle.tool.core.json.JacksonUtils; +import java.math.BigDecimal; import java.sql.Timestamp; import java.time.Duration; import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -383,7 +390,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo } List propsBackpacks = propsUserInfraConvertor.toListPropsBackpackDTO( - propsBackpackService.listNotExpiredProps(userIds) + propsBackpackService.listNotExpiredUseProps(userIds) ); if (CollectionUtils.isEmpty(propsBackpacks)) { diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsBackpackClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsBackpackClientServiceImpl.java index ce474c1c..5df76550 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsBackpackClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsBackpackClientServiceImpl.java @@ -22,6 +22,7 @@ import java.math.BigDecimal; import java.sql.Timestamp; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -144,7 +145,7 @@ public class PropsBackpackClientServiceImpl implements PropsBackpackClientServic @Override public List listNotExpiredUseProps(Set userIds) { return propsInnerConvertor.toListPropsBackpackDTO( - propsBackpackService.listNotExpiredProps(userIds) + propsBackpackService.listNotExpiredUseProps(userIds) ); }