From 8ad3e49abf615d868460e0fab004c365148b90cb Mon Sep 17 00:00:00 2001
From: zhuml4 <zhuml4@xiaopeng.com>
Date: 星期六, 07 三月 2026 21:01:53 +0800
Subject: [PATCH] fix:用户中心返回
---
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java
index a3f71e3..e28b9c0 100644
--- a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java
+++ b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java
@@ -4,11 +4,10 @@
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.xiaopeng.api.dto.account.UserResourcesDto;
+import com.xiaopeng.api.dto.account.UcUserInfo;
import com.xiaopeng.api.feignClient.account.UserResourcesClient;
import com.xiaopeng.api.model.operation.XpFeedbackType;
import com.xiaopeng.api.model.operation.XpUserFeedback;
-import com.xiaopeng.api.vo.account.GetUserListByUidsVo;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.mapper.XpUserFeedbackMapper;
import com.xiaopeng.operation.query.UserFeedBackQuery;
@@ -19,7 +18,6 @@
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy;
-import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.util.Collections;
@@ -52,15 +50,14 @@
//获取小鹏用户信息
List<Long> xpUid = xpUserFeedbackVOS.stream().map(XpUserFeedback::getFeedbackUserId).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(xpUid)) {
- UserResourcesDto resultData = userResourcesClient.getUserListByUids(xpUid, false);
- if (resultData.getCode().equals(HttpStatus.OK.value())) {
- JSONObject jsonObject = JSONObject.parseObject(resultData.getData().toString());
+ Map<String, UcUserInfo> userInfoMap = userResourcesClient.getUserListByUids(xpUid, false);
+ if (userInfoMap != null && !userInfoMap.isEmpty()) {
for (XpUserFeedbackVO xpUserFeedbackVO : xpUserFeedbackVOS) {
- JSONObject userInfo = jsonObject.getJSONObject(xpUserFeedbackVO.getFeedbackUserId().toString());
+ UcUserInfo userInfo = userInfoMap.get(xpUserFeedbackVO.getFeedbackUserId().toString());
if (Objects.nonNull(userInfo)) {
- xpUserFeedbackVO.setNickname(userInfo.getString("nickName"));
- xpUserFeedbackVO.setAvatar(userInfo.getString("headImg"));
- xpUserFeedbackVO.setPhone(userInfo.getString("mobile"));
+ xpUserFeedbackVO.setNickname(userInfo.getNickName());
+ xpUserFeedbackVO.setAvatar(userInfo.getHeadImg());
+ xpUserFeedbackVO.setPhone(userInfo.getMobile());
}
}
}
--
Gitblit v1.7.1