liujie
2026-03-25 d597b03477f904bc87bc9c3a984f9bfa485a906d
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleCleanController.java
@@ -18,6 +18,7 @@
import com.xiaopeng.maintenance.model.vo.XpVehicleCleanVO;
import com.xiaopeng.maintenance.service.IXpVehicleCleanService;
import com.xiaopeng.maintenance.service.XpTaskService;
import com.xiaopeng.maintenance.utils.AliOssDownloadUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -64,6 +65,8 @@
    private ThreadPoolTaskScheduler taskScheduler;
    @Autowired
    private AliOssService aliOssService;
    @Autowired
    private AliOssDownloadUtil aliOssDownloadUtil;
    /**
     * 车辆运维-车辆运维-车身清洁
@@ -168,23 +171,7 @@
        for (XpVehicleClean record : records) {
            String taskImage = record.getTaskImage();
            if (StringUtils.isNotBlank(taskImage)) {
                JSONArray jsonArray = JSONArray.parseArray(taskImage);
                for (int i = 0; i < jsonArray.size(); i++) {
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    if (Objects.isNull(jsonObject)) {
                        continue;
                    }
                    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);
                }
                record.setTaskImage(JSONArray.toJSONString(jsonArray));
            }
            record.setTaskImage(aliOssDownloadUtil.getPictureJsonArray(record.getTaskImage()));
            data.stream().filter(xpOperationsUser -> xpOperationsUser.getId().equals(record.getOperationsUserId())).findFirst().ifPresent(xpOperationsUser -> record.setCreateBy(xpOperationsUser.getNickName()));
        }
        return R.ok(page);