| | |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpChargingRecord.getVehicleId()).getData(); |
| | | if (Objects.nonNull(xpVehicle)) { |
| | | xpChargingRecordVO.setPlateNumber(xpVehicle.getPlateNumber()); |
| | | |
| | | |
| | | |
| | | String vehiclePictures =xpVehicle.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | |
| | | jsonObject.put("url", downloadUrl); |
| | | xpChargingRecordVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | | |
| | | |
| | | xpChargingRecordVO.setAcceptOrTest(xpVehicle.getAcceptOrTest()); |
| | | xpChargingRecordVO.setVehicleColor(xpVehicle.getVehicleColor()); |
| | | } |
| | |
| | | } |
| | | xpChargingRecordVO.setStartMileageRange(Objects.nonNull(xpChargingRecord.getStartMileageRange()) ? xpChargingRecord.getStartMileageRange() : 0F); |
| | | xpChargingRecordVO.setEndMileageRange(Objects.nonNull(xpChargingRecord.getEndMileageRange()) ? xpChargingRecord.getEndMileageRange() : 0F); |
| | | |
| | | // 图片封装 |
| | | try { |
| | | // 开始 |
| | | String startChargingPicture = xpChargingRecordVO.getStartChargingPicture(); |
| | | if (StringUtils.isNotBlank(startChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startChargingPicture); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | xpChargingRecordVO.setStartChargingPicture(JSONArray.toJSONString(jsonArray)); |
| | | } |
| | | // 结束 |
| | | String endChargingPicture = xpChargingRecordVO.getEndChargingPicture(); |
| | | if (StringUtils.isNotBlank(endChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(endChargingPicture); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | xpChargingRecordVO.setEndChargingPicture(JSONArray.toJSONString(jsonArray)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return xpChargingRecordVO; |
| | | } |
| | | |