xuhy
2026-03-20 5d69dd309795358d6bbdef2fe2ac805f4e6df6d4
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleCleanController.java
@@ -20,6 +20,7 @@
import com.xiaopeng.maintenance.service.XpTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
@@ -31,6 +32,7 @@
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -41,6 +43,7 @@
 * @author xiaochen
 * @since 2026-02-06
 */
@Slf4j
@Api(tags = "车辆清洁")
@RestController
@RequestMapping("")
@@ -89,7 +92,12 @@
        if (vehiclePictures != null && !vehiclePictures.isEmpty()) {
            JSONObject jsonObject = JSONObject.parseObject(vehiclePictures);
            // 1
            String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
                String downloadUrl = jsonObject.getString("url");;
                try {
                    downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
                } catch (UnsupportedEncodingException e) {
                    log.error("获取图片下载地址失败", e);
                }
            jsonObject.put("url", downloadUrl);
            xpVehicleCleanVO.setVehiclePictures(jsonObject.toJSONString());
        }
@@ -99,14 +107,16 @@
        String taskImage = xpVehicleCleanVO.getTaskImage();
        if (StringUtils.isNotBlank(taskImage)) {
            JSONArray jsonArray = JSONArray.parseArray(taskImage);
            for (Object o : jsonArray) {
                JSONObject jsonObject = (JSONObject)o;
                String downloadUrl = null;
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                if (Objects.isNull(jsonObject)) {
                    continue;
                }
                String downloadUrl = jsonObject.getString("url");;
                try {
                    //1
                    downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
                } catch (UnsupportedEncodingException e) {
                    throw new RuntimeException(e);
                    log.error("获取图片下载地址失败", e);
                }
                jsonObject.put("url", downloadUrl);
            }
@@ -160,14 +170,16 @@
            String taskImage = record.getTaskImage();
            if (StringUtils.isNotBlank(taskImage)) {
                JSONArray jsonArray = JSONArray.parseArray(taskImage);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = (JSONObject)o;
                    String downloadUrl = null;
                for (int i = 0; i < jsonArray.size(); i++) {
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    if (Objects.isNull(jsonObject)) {
                        continue;
                    }
                    String downloadUrl = jsonObject.getString("url");;
                    try {
                        //1
                        downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
                    } catch (UnsupportedEncodingException e) {
                        throw new RuntimeException(e);
                        log.error("获取图片下载地址失败", e);
                    }
                    jsonObject.put("url", downloadUrl);
                }