From 3692b4d087a45f41a21a4967b7544451eee5dbc9 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 18 三月 2026 11:08:29 +0800
Subject: [PATCH] 修改图片获取

---
 xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpUserFeedbackServiceImpl.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 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 91ef5d2..336c0c1 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
@@ -2,6 +2,7 @@
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xiaopeng.api.dto.account.UcUserInfo;
@@ -9,6 +10,7 @@
 import com.xiaopeng.api.model.operation.XpFeedbackType;
 import com.xiaopeng.api.model.operation.XpUserFeedback;
 import com.xiaopeng.common.core.web.page.PageInfo;
+import com.xiaopeng.evi.oss.service.AliOssService;
 import com.xiaopeng.operation.mapper.XpUserFeedbackMapper;
 import com.xiaopeng.operation.query.UserFeedBackQuery;
 import com.xiaopeng.operation.service.IXpFeedbackTypeService;
@@ -20,6 +22,7 @@
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
+import java.io.UnsupportedEncodingException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -36,6 +39,7 @@
 public class XpUserFeedbackServiceImpl extends ServiceImpl<XpUserFeedbackMapper, XpUserFeedback> implements IXpUserFeedbackService {
     private final UserResourcesClient userResourcesClient;
     private final IXpFeedbackTypeService xpFeedbackTypeService;
+    private final AliOssService aliOssService;
 
     @Override
     public PageInfo<XpUserFeedbackVO> getPageList(UserFeedBackQuery query) {
@@ -73,6 +77,29 @@
         pageInfo.setTotal(page.getTotal());
         pageInfo.setSize(page.getSize());
         pageInfo.setPages(page.getPages());
+
+        for (XpUserFeedbackVO xpUserFeedbackVO : xpUserFeedbackVOS) {
+
+
+            String feedbackPictures = xpUserFeedbackVO.getFeedbackPictures();
+            if (StringUtils.isNotBlank(feedbackPictures)) {
+                JSONArray jsonArray = JSONArray.parseArray(feedbackPictures);
+                ArrayList<String> list = new ArrayList<>(jsonArray.size());
+                for (Object o : jsonArray) {
+                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
+                    String downloadUrl = null;
+                    try {
+                        downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
+                    } catch (UnsupportedEncodingException e) {
+                        throw new RuntimeException(e);
+                    }
+                    list.add(downloadUrl);
+                }
+                xpUserFeedbackVO.setFeedbackPictures(String.join(",", list));
+            }
+
+        }
+
         pageInfo.setRecords(xpUserFeedbackVOS);
         return pageInfo;
     }

--
Gitblit v1.7.1