| | |
| | | String vehiclePictures = xpVehicleDetectionVO.getVehiclePictures(); |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 2 |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicleDetectionVO.setVehiclePictures(downloadUrl); |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehicleDetectionVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | | |
| | | |
| | | String sensorCleaningPicture = xpVehicleDetectionVO.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(sensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(sensorCleaningPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | // 2 |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setSensorCleaningPicture(String.join(",", list)); |
| | | xpVehicleDetectionVO.setSensorCleaningPicture(JSONArray.toJSONString(jsonArray)); |
| | | } |
| | | |
| | | |