| | |
| | | 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; |
| | |
| | | private ThreadPoolTaskScheduler taskScheduler; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | @Autowired |
| | | private AliOssDownloadUtil aliOssDownloadUtil; |
| | | |
| | | /** |
| | | * 车辆运维-车辆运维-车身清洁 |
| | |
| | | |
| | | 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); |