xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java
@@ -66,7 +66,7 @@ return R.ok(count); } @PostMapping("/api/v1/notification/read") @GetMapping("/api/v1/notification/read") @ApiOperation(value = "操作已读", tags = "运维APP-消息通知") public R<?> readNotification(@RequestParam Long notificationId){ notificationService.lambdaUpdate().set(XpOperationsUserNotification::getReadStatus, 1).eq(XpOperationsUserNotification::getId, notificationId).update(); xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleDetectionController.java
@@ -106,7 +106,7 @@ if (vehiclePictures != null && !vehiclePictures.isEmpty()) { JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); // 2 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -123,7 +123,7 @@ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -141,7 +141,7 @@ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -159,7 +159,7 @@ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -177,7 +177,7 @@ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -195,7 +195,7 @@ for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehiclePreparationController.java
@@ -87,9 +87,6 @@ jsonObject.put("url", downloadUrl); xpVehiclePreparationVO.setVehiclePictures(jsonObject.toJSONString()); } return R.ok(xpVehiclePreparationVO); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleRepairController.java
@@ -101,7 +101,7 @@ if (StringUtils.isNotBlank(vehiclePictures)) { JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -120,7 +120,7 @@ continue; } // 1 String downloadUrl = jsonObject.getString("url");; String downloadUrl = jsonObject.getString("url"); try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { @@ -130,7 +130,20 @@ } xpVehicleRepairVO.setStartRepairPicture(JSONArray.toJSONString(jsonArray)); } String repairMoneyDetail = xpVehicleRepairVO.getRepairMoneyDetail(); if (StringUtils.isNotBlank(repairMoneyDetail)) { JSONObject jsonObject = JSONObject.parseObject(repairMoneyDetail); if(jsonObject!=null){ String downloadUrl = null; try { downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (Exception e) { e.printStackTrace(); } jsonObject.put("url", downloadUrl); xpVehicleRepairVO.setRepairMoneyDetail(jsonObject.toJSONString()); } } return R.ok(xpVehicleRepairVO); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpChargingRecordServiceImpl.java
@@ -112,9 +112,6 @@ 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); @@ -128,8 +125,6 @@ jsonObject.put("url", downloadUrl); xpChargingRecordVO.setVehiclePictures(jsonObject.toJSONString()); } xpChargingRecordVO.setAcceptOrTest(xpVehicle.getAcceptOrTest()); xpChargingRecordVO.setVehicleColor(xpVehicle.getVehicleColor()); } @@ -144,6 +139,41 @@ } 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; } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpVehiclePreparationServiceImpl.java
@@ -1,5 +1,7 @@ package com.xiaopeng.maintenance.service.impl; 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.xiaopeng.api.feignClient.account.XpOperationUserClient; @@ -8,6 +10,7 @@ import com.xiaopeng.api.model.maintenance.XpVehiclePreparation; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; import com.xiaopeng.evi.oss.service.AliOssService; import com.xiaopeng.maintenance.model.query.XpVehiclePreparationPageQuery; import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; import com.xiaopeng.api.vo.maintenance.XpVehiclePreparationDetailVO; @@ -61,7 +64,8 @@ private XpVehicleClient xpVehicleClient; @Autowired private MongoTemplate mongoTemplate; @Autowired private AliOssService aliOssService; @Override public PageInfo<OperationRecordsVO> operationRecords(OperationRecordsQuery query) { @@ -152,6 +156,82 @@ if (Objects.nonNull(operationsUserStart)) { xpVehiclePreparationVO.setOperatorStartName(operationsUserStart.getNickName()); } // 图片封装 try { // 大灯 String headLight = xpVehiclePreparation.getHeadLight(); if (StringUtils.isNotBlank(headLight)) { JSONArray jsonArray = JSONArray.parseArray(headLight); 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); } xpVehiclePreparationVO.setHeadLight(JSONArray.toJSONString(jsonArray)); } // 转向灯 String turnSignal = xpVehiclePreparation.getTurnSignal(); if (StringUtils.isNotBlank(turnSignal)) { JSONArray jsonArray = JSONArray.parseArray(turnSignal); 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); } xpVehiclePreparationVO.setTurnSignal(JSONArray.toJSONString(jsonArray)); } // 刹车灯 String brakeLight = xpVehiclePreparation.getBrakeLight(); if (StringUtils.isNotBlank(brakeLight)) { JSONArray jsonArray = JSONArray.parseArray(brakeLight); 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); } xpVehiclePreparationVO.setBrakeLight(JSONArray.toJSONString(jsonArray)); } // 雾灯 String fogLight = xpVehiclePreparation.getFogLight(); if (StringUtils.isNotBlank(fogLight)) { JSONArray jsonArray = JSONArray.parseArray(fogLight); 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); } xpVehiclePreparationVO.setFogLight(JSONArray.toJSONString(jsonArray)); } // 舱内清洁 String cabinCleaning = xpVehiclePreparation.getCabinCleaning(); if (StringUtils.isNotBlank(cabinCleaning)) { JSONArray jsonArray = JSONArray.parseArray(cabinCleaning); 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); } xpVehiclePreparationVO.setCabinCleaning(JSONArray.toJSONString(jsonArray)); } } catch (Exception e) { e.printStackTrace(); } return xpVehiclePreparationVO; } xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java
@@ -2,6 +2,7 @@ import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.dto.operation.PointMapQuery; @@ -17,6 +18,7 @@ import com.xiaopeng.common.core.constant.CacheConstants; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.redis.service.RedisService; import com.xiaopeng.evi.oss.service.AliOssService; import com.xiaopeng.operation.dto.NearestDto; import com.xiaopeng.operation.mapper.XpPointMapper; import com.xiaopeng.operation.mapper.XpSystemSettingMapper; @@ -30,6 +32,7 @@ import com.xiaopeng.operation.vo.NearestNextVo; import com.xiaopeng.operation.vo.NearestVo; import com.xiaopeng.operation.vo.OrderDistanceVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -70,7 +73,8 @@ @Resource private IXpElectronicFenceService xpElectronicFenceService; @Autowired private AliOssService aliOssService; @Override public NearestVo nearest(NearestDto dto) { @@ -228,6 +232,22 @@ query.setOperationStatusIds(statusIds); } List<XpPoint> list = this.baseMapper.listAll(query); for (XpPoint xpPoint : list) { if (StringUtils.hasLength(xpPoint.getPointPictures())) { JSONObject jsonObject = JSONObject.parseObject(xpPoint.getPointPictures()); if(jsonObject!=null){ String downloadUrl = null; try { // 1 downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (Exception e) { e.printStackTrace(); } jsonObject.put("url", downloadUrl); xpPoint.setPointPictures(jsonObject.toJSONString()); } } } return list; } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java
@@ -913,6 +913,19 @@ xpVehicleVO.setMileageRange(0F); xpVehicleVO.setCurrentElectricity(0); } if (StringUtils.isNotBlank(xpVehicleVO.getVehiclePictures())) { JSONObject jsonObject = JSONObject.parseObject(xpVehicleVO.getVehiclePictures()); if(jsonObject!=null){ String downloadUrl = null; try { downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (Exception e) { e.printStackTrace(); } jsonObject.put("url", downloadUrl); xpVehicleVO.setVehiclePictures(jsonObject.toJSONString()); } } // 判断车辆维修状态 Integer maintenanceStatus = xpVehicleRepairClient.getMaintenanceStatus(xpVehicleVO.getId()).getData(); xpVehicleVO.setMaintenanceStatus(maintenanceStatus);