From 0dee3e6ca931b8a8ef5b85b59612b43fb14c7cf0 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 27 May 2026 12:03:48 +0800 Subject: [PATCH] feat: batch query wealthLevel and set to userBaseInfo in pageFreight --- .../user/impl/UserFreightBalanceRestServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java index 6413e1fe..121d694f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java @@ -11,6 +11,7 @@ import com.red.circle.other.app.dto.clientobject.user.UserFreightBalanceCO; import com.red.circle.other.app.service.sys.AppConfigService; import com.red.circle.other.app.service.user.UserFreightBalanceRestService; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.model.user.UserConsumptionLevel; import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.infra.database.mongo.entity.user.region.SysRegionConfig; import com.red.circle.other.infra.database.mongo.service.user.region.SysRegionConfigService; @@ -103,6 +104,8 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest Map userBaseInfoMap = ResponseAssert.requiredSuccess(userProfileClient.mapByUserIds(pagedUserIds)); Map transactionCountMap = freightGoldClient.mapTransactionCountByUserIds(pagedUserIds).getBody(); Map followMap = userProfileGateway.mapIsFollow(reqUserId, pagedUserIds); + Map consumptionLevelMap = userProfileGateway.getUserConsumptionLevel( + appExtCommand.getReqSysOriginPlatformEnum(), pagedUserIds); AppCountryCodeCO appCountryCode = appConfigService.getAppCountryCode(); Map countryFlagMap = buildCountryFlagMap(appCountryCode); @@ -120,6 +123,14 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest co.setIsFollow(Boolean.TRUE.equals(followMap.get(dto.getUserId()))); co.setUserBaseInfo(userBaseInfoMap.get(dto.getUserId())); + UserProfileDTO userBaseInfo = co.getUserBaseInfo(); + if (userBaseInfo != null) { + UserConsumptionLevel level = consumptionLevelMap.get(dto.getUserId()); + if (level != null) { + userBaseInfo.setWealthLevel(level.getWealthLevel()); + } + } + if (dto.getCreateTime() != null) { long days = ChronoUnit.DAYS.between(dto.getCreateTime().toLocalDateTime(), LocalDateTime.now()); co.setBecomeDays((int) days);