From a054181a4f8131c3df40fe27dacd90842bb4fb7d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 11 Dec 2025 21:21:36 +0800 Subject: [PATCH] =?UTF-8?q?cpValue=20=E5=AE=9E=E6=97=B6=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/user/CpSimpleUserProfileCO.java | 2 ++ .../user/query/UserProfileUseQryExe.java | 22 +++++++++++++++++++ .../UserRunProfileTransportGatewayImpl.java | 1 + 3 files changed, 25 insertions(+) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java index d87cd603..984a591e 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java @@ -62,6 +62,8 @@ public class CpSimpleUserProfileCO implements Serializable { */ private String cpUserNickname; + private Long cpValId; + /** * 心动值 */ diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java index 9807dcc6..b4bbf149 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/query/UserProfileUseQryExe.java @@ -1,5 +1,6 @@ package com.red.circle.other.app.command.user.query; +import cn.hutool.core.collection.CollectionUtil; import com.red.circle.common.business.core.AppBusinessUtils; import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd; import com.red.circle.component.redis.service.RedisService; @@ -15,12 +16,19 @@ import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.infra.database.mongo.entity.live.RoomProfileManager; import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; +import com.red.circle.other.infra.database.rds.service.user.user.CpValueService; +import com.red.circle.other.inner.model.dto.user.CpSimpleUserProfileCO; import com.red.circle.tool.core.text.StringUtils; import com.red.circle.other.inner.asserts.user.UserErrorCode; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -42,6 +50,7 @@ public class UserProfileUseQryExe { private final RoomProfileManagerService roomProfileManagerService; private final RedisService redisService; private final UserSupportRelationService userRelationInterviewService; + private final CpValueService cpValueService; public UserProfileDTO execute(UserProfileQryCmd cmd) { UserProfile userProfile = getUserProfile(cmd); @@ -87,6 +96,19 @@ public class UserProfileUseQryExe { userRelationInterviewService.addVisitor(userIdCmd); } + // 重新赋值cpValue + if (CollectionUtil.isNotEmpty(userProfileDTO.getCpList())) { + Set cpValIdSet = userProfileDTO.getCpList().stream().map(CpSimpleUserProfileCO::getCpValId).collect(Collectors.toSet()); + Map mapCpVal = cpValueService.mapCpVal(cpValIdSet); + + userProfileDTO.getCpList().forEach(cp -> { + BigDecimal cpValue = mapCpVal.get(cp.getCpValId()); + if (Objects.nonNull(cpValue)) { + cp.setCpValue(cpValue); + } + }); + } + return userProfileDTO; } 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 b0e844a1..f42eb380 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 @@ -367,6 +367,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo .setCpAccount(cpUser.getAccount()) .setCpUserAvatar(cpUser.getUserAvatar()) .setCpUserNickname(cpUser.getUserNickname()) + .setCpValId(cpRelationship.getCpValId()) .setCpValue(cpValue) .setCreateTime(cpRelationship.getCreateTime()) .setDays(days)