| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public XpChargingRecordVO chargingDetail(Long id) { |
| | | public XpChargingRecordVO chargingDetail(Long id) throws UnsupportedEncodingException { |
| | | // 查询车辆充电记录 |
| | | XpChargingRecord xpChargingRecord = this.getById(id); |
| | | XpChargingRecordVO xpChargingRecordVO = new XpChargingRecordVO(); |
| | |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpChargingRecord.getVehicleId()).getData(); |
| | | if (Objects.nonNull(xpVehicle)) { |
| | | xpChargingRecordVO.setPlateNumber(xpVehicle.getPlateNumber()); |
| | | xpChargingRecordVO.setVehiclePictures(xpVehicle.getVehiclePictures()); |
| | | |
| | | |
| | | |
| | | String vehiclePictures =xpVehicle.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpChargingRecordVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | xpChargingRecordVO.setAcceptOrTest(xpVehicle.getAcceptOrTest()); |
| | | xpChargingRecordVO.setVehicleColor(xpVehicle.getVehicleColor()); |
| | | } |