xuhy
2026-03-24 c56b75cd9d5a286cd4b2b4e77ff479d9f5c001e7
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -1,11 +1,12 @@
package com.xiaopeng.maintenance.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.xiaopeng.api.dto.pushMessage.AliPushMessageDTO;
import com.xiaopeng.api.feignClient.account.SysUserClient;
import com.xiaopeng.api.feignClient.account.XpOperationUserClient;
@@ -14,6 +15,7 @@
import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetVehicleClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.account.SysUser;
import com.xiaopeng.api.model.account.XpOperationsRole;
import com.xiaopeng.api.model.account.XpOperationsUser;
import com.xiaopeng.api.model.account.XpOperationsUserNotification;
@@ -150,7 +152,13 @@
            if (StringUtils.isNotBlank(vehiclePictures)) {
                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);
                workBenchVO.setVehiclePictures(jsonObject.toJSONString());
            }
@@ -202,7 +210,6 @@
        pageInfo.setRecords(list);
        return pageInfo;
    }
    @Override
@@ -436,10 +443,18 @@
        String taskImage = res.getTaskImage();
        if (StringUtils.isNotBlank(taskImage)) {
            JSONArray jsonArray = JSONArray.parseArray(taskImage);
            for (Object o : jsonArray) {
                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                // 1
                String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
            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);
            }
            res.setTaskImage(JSONArray.toJSONString(jsonArray));
@@ -447,6 +462,7 @@
        return R.ok(res);
    }
    @ShardingSphereTransactionType(TransactionType.BASE)
    @Transactional(rollbackFor = Exception.class)
    @Override
@@ -537,10 +553,16 @@
        String taskImage = res.getTaskImage();
        if (StringUtils.isNotBlank(taskImage)) {
            JSONArray jsonArray = JSONArray.parseArray(taskImage);
            for (Object o : jsonArray) {
                JSONObject jsonObject = JSONObject.parseObject(o.toString());
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                // 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);
            }
            res.setTaskImage(JSONArray.toJSONString(jsonArray));
@@ -589,14 +611,17 @@
            String startChargingPicture = res.getStartChargingPicture();
            if (StringUtils.isNotBlank(startChargingPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(startChargingPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -607,19 +632,20 @@
            res.setEndRemainingBattery(chargingRecord.getEndRemainingBattery());
            String endChargingPicture = chargingRecord.getEndChargingPicture();
            if (StringUtils.isNotBlank(endChargingPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(endChargingPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -686,18 +712,20 @@
            res.setRepairReason(vehicleRepair.getRepairReason());
            String startRepairPicture = vehicleRepair.getStartRepairPicture();
            if (StringUtils.isNotBlank(startRepairPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(startRepairPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -830,18 +858,19 @@
            res.setSensorCleaning(vehicleDetection.getSensorCleaning());
            String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture();
            if (StringUtils.isNotBlank(SensorCleaningPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -849,20 +878,21 @@
            }
            res.setInteractiveScreen(vehicleDetection.getInteractiveScreen());
            String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture();
            String InteractiveScreenPicture = vehicleDetection.getInteractiveScreenPicture();
            if (StringUtils.isNotBlank(InteractiveScreenPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -870,23 +900,23 @@
            }
            res.setHelpButton(vehicleDetection.getHelpButton());
            String HelpButtonPicture =vehicleDetection.getHelpButtonPicture();
            String HelpButtonPicture = vehicleDetection.getHelpButtonPicture();
            if (StringUtils.isNotBlank(HelpButtonPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -896,18 +926,20 @@
            res.setPaymentFunction(vehicleDetection.getPaymentFunction());
            String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture();
            String PaymentFunctionPicture = vehicleDetection.getPaymentFunctionPicture();
            if (StringUtils.isNotBlank(PaymentFunctionPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -917,17 +949,20 @@
            res.setSystemCheck(vehicleDetection.getSystemCheck());
            String SystemCheckPicture =vehicleDetection.getSystemCheckPicture();
            String SystemCheckPicture = vehicleDetection.getSystemCheckPicture();
            if (StringUtils.isNotBlank(SystemCheckPicture)) {
                JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
                }
@@ -1021,16 +1056,23 @@
            res.setHandleTime(vehicleDetection.getCreateTime());
            res.setTaskImage(vehicleDetection.getTaskImage());
            String taskImage = res.getTaskImage();
            if (StringUtils.isNotBlank(taskImage)) {
                JSONArray jsonArray = JSONArray.parseArray(taskImage);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    // 1
                    String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true);
                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);
                }
                res.setTaskImage(JSONArray.toJSONString(jsonArray));
@@ -1119,7 +1161,7 @@
                            .account(operationsUser.getPhoneNumber())
                            .title("任务状态变更")
                            .body(bodyJson)
                            .pushType(AliPushTypeConstant.NOTICE)
                            .pushType(AliPushTypeConstant.MESSAGE)
                            .build());
                }
            } catch (Exception e) {
@@ -1247,12 +1289,16 @@
        for (XpTaskRecordVO record : records) {
            String taskImage =record.getTaskImage();
            String taskImage = record.getTaskImage();
            if (StringUtils.isNotBlank(taskImage)) {
                JSONArray jsonArray = JSONArray.parseArray(taskImage);
                for (Object o : jsonArray) {
                    JSONObject jsonObject = JSONObject.parseObject(o.toString());
                    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);
@@ -1265,7 +1311,6 @@
            }
        }
        pageInfo.setRecords(records);
@@ -1296,10 +1341,10 @@
        PageInfo<TaskManagementPageListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TaskManagementPageListVO> list = this.baseMapper.pageListManagement(pageInfo, query);
        for (TaskManagementPageListVO taskManagementPageListVO : list) {
            if (org.springframework.util.StringUtils.hasLength(taskManagementPageListVO.getHandleUserId())){
            if (org.springframework.util.StringUtils.hasLength(taskManagementPageListVO.getHandleUserId())) {
                String[] split = taskManagementPageListVO.getHandleUserId().split(",");
                List<XpOperationsUser> users = operationUserClient.listByIds(Arrays.stream(split).map(Long::parseLong).collect(Collectors.toList())).getData();
                if (users!=null){
                if (users != null) {
                    StringBuilder handleUserName = new StringBuilder();
                    for (XpOperationsUser user : users) {
                        handleUserName.append(user.getNickName()).append(";");
@@ -1370,10 +1415,10 @@
    public List<TaskManagementPageListVO> exportList(TaskManagementPageListQuery query) {
        List<TaskManagementPageListVO> list = this.baseMapper.exportList(query);
        for (TaskManagementPageListVO taskManagementPageListVO : list) {
            if (org.springframework.util.StringUtils.hasLength(taskManagementPageListVO.getHandleUserId())){
            if (org.springframework.util.StringUtils.hasLength(taskManagementPageListVO.getHandleUserId())) {
                String[] split = taskManagementPageListVO.getHandleUserId().split(",");
                List<XpOperationsUser> users = operationUserClient.listByIds(Arrays.stream(split).map(Long::parseLong).collect(Collectors.toList())).getData();
                if (users!=null){
                if (users != null) {
                    StringBuilder handleUserName = new StringBuilder();
                    for (XpOperationsUser user : users) {
                        handleUserName.append(user.getNickName()).append(";");
@@ -1533,6 +1578,7 @@
            task.setReportTime(LocalDateTime.now());
            task.setExpiredNoticeSent(0);
            task.setWillTimeoutNoticeSent(0);
            task.setTaskSource(2);
            saveTask.add(task);
        }
        this.saveBatch(saveTask);
@@ -1573,10 +1619,15 @@
                    taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation());
                    if(vehicle.getVehiclePictures()!=null){
                    if (vehicle.getVehiclePictures() != null) {
                        JSONObject jsonObject = JSONObject.parseObject(vehicle.getVehiclePictures());
                        // 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);
                        taskManagementDetectionDetailVO.setVehiclePictures(jsonObject.toJSONString());
                    }
@@ -1597,14 +1648,16 @@
                        String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture();
                        if (StringUtils.isNotBlank(SensorCleaningPicture)) {
                            JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture);
                            for (Object o : jsonArray) {
                                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                                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);
                            }
@@ -1612,21 +1665,22 @@
                        }
                        taskManagementDetectionDetailVO.setInteractiveScreen(vehicleDetection.getInteractiveScreen());
                        String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture();
                        String InteractiveScreenPicture = vehicleDetection.getInteractiveScreenPicture();
                        if (StringUtils.isNotBlank(InteractiveScreenPicture)) {
                            JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture);
                            for (Object o : jsonArray) {
                                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                                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);
                            }
@@ -1636,17 +1690,19 @@
                        taskManagementDetectionDetailVO.setHelpButton(vehicleDetection.getHelpButton());
                        String HelpButtonPicture =vehicleDetection.getHelpButtonPicture();
                        String HelpButtonPicture = vehicleDetection.getHelpButtonPicture();
                        if (StringUtils.isNotBlank(HelpButtonPicture)) {
                            JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture);
                            for (Object o : jsonArray) {
                                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                                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);
                            }
@@ -1656,17 +1712,19 @@
                        taskManagementDetectionDetailVO.setPaymentFunction(vehicleDetection.getPaymentFunction());
                        String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture();
                        String PaymentFunctionPicture = vehicleDetection.getPaymentFunctionPicture();
                        if (StringUtils.isNotBlank(PaymentFunctionPicture)) {
                            JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture);
                            for (Object o : jsonArray) {
                                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                                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);
                            }
@@ -1677,17 +1735,20 @@
                        taskManagementDetectionDetailVO.setSystemCheck(vehicleDetection.getSystemCheck());
                        String SystemCheckPicture =vehicleDetection.getSystemCheckPicture();
                        String SystemCheckPicture = vehicleDetection.getSystemCheckPicture();
                        if (StringUtils.isNotBlank(SystemCheckPicture)) {
                            JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture);
                            for (Object o : jsonArray) {
                                JSONObject jsonObject = JSONObject.parseObject(o.toString());
                                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);
                            }
@@ -1914,7 +1975,27 @@
            res.setErrorTypeList(xpErrorTypes);
            res.setStatus(task.getStatus());
            res.setTaskDescription(task.getTaskDescription());
            res.setTaskImage(task.getTaskImage());
            String taskImage = res.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);
                }
                res.setTaskImage(JSONArray.toJSONString(jsonArray));
            }
            res.setId(id);
            res.setVehicleId(vehicle.getId());
            res.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
@@ -1923,24 +2004,34 @@
            res.setVehicleCode(vehicle.getVehicleCode());
            res.setVehicleLocation(task.getVehicleLocation());
            res.setVehicleVin(vehicle.getVehicleVin());
            if (task.getReportUserId().equals(0L)){
            if (task.getReportUserId().equals(0L)) {
                // 系统补偿上传车辆异常任务 为系统创建
                res.setReportUserId(0L);
                res.setReportUserName("系统");
                // todo 临时设置 待客户确认默认头像和电话号码
                res.setReportUserPhone("111111");
                res.setReportUserAvatar("[]");
            }else{
                XpOperationsUser data = xpOperationUserClient.queryById(task.getReportUserId()).getData();
                if (data != null ) {
                    res.setReportUserId(data.getId());
                    res.setReportUserName(data.getNickName());
                    res.setReportUserPhone(data.getPhoneNumber());
                    res.setReportUserAvatar(data.getAvatar());
            } else {
                if (Objects.nonNull(task.getTaskSource()) && task.getTaskSource().equals(2)) {
                    List<SysUser> list = sysUserClient.listByIds(Lists.newArrayList(task.getReportUserId())).getData();
                    if (CollUtil.isNotEmpty(list)) {
                        SysUser sysUser = list.get(0);
                        res.setReportUserId(sysUser.getId());
                        res.setReportUserName(sysUser.getNickName());
                        res.setReportUserPhone(sysUser.getPhoneNumber());
                    }
                } else {
                    XpOperationsUser data = xpOperationUserClient.queryById(task.getReportUserId()).getData();
                    if (data != null) {
                        res.setReportUserId(data.getId());
                        res.setReportUserName(data.getNickName());
                        res.setReportUserPhone(data.getPhoneNumber());
                        res.setReportUserAvatar(data.getAvatar());
                    }
                }
            }
            if (task.getHandleUserId()!=null && task.getHandleUserId().split(",").length == 1) {
            if (task.getHandleUserId() != null && task.getHandleUserId().split(",").length == 1) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(Long.valueOf(task.getHandleUserId())).getData();
                if (operationsUser != null) {
                    res.setHandleUserId(operationsUser.getId());
@@ -1966,7 +2057,6 @@
            managementDetailVO.setAccidentDetailVO(res);
        }
        return R.ok(managementDetailVO);