xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -6,12 +6,15 @@ import com.alibaba.fastjson2.JSONObject; import com.xiaopeng.api.dto.map.OrderRouteAndFareDto; import com.xiaopeng.api.dto.operation.LonLatDto; import com.xiaopeng.api.dto.operation.ReassignOrderDTO; import com.xiaopeng.api.dto.order.PopOrderDto; import com.xiaopeng.api.dto.pushMessage.PushOrderRouteDTO; import com.xiaopeng.api.dto.pushMessage.SendMessageDTO; import com.xiaopeng.api.feignClient.map.XpMapClient; import com.xiaopeng.api.feignClient.operation.ReassignOrderClient; import com.xiaopeng.api.feignClient.order.XpOrderClient; import com.xiaopeng.api.feignClient.pushMessage.XpPushMessageClient; import com.xiaopeng.api.feignClient.vehicleConvoy.UserVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; import com.xiaopeng.api.model.order.XpOrder; import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; @@ -32,7 +35,9 @@ import com.xiaopeng.api.vo.automaticPilot.proto.up.xpuNavigationRequest.NavigationRequest; import com.xiaopeng.api.vo.automaticPilot.proto.up.xpuNavigationRequest.OrderPhase; import com.xiaopeng.api.vo.operation.RouteVo; import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo; import com.xiaopeng.automaticPilot.util.XPUUtil; import com.xiaopeng.common.core.constant.CacheConstants; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.enums.OrderStatusEnum; import com.xiaopeng.common.core.enums.PushMessageTypeEnum; @@ -80,6 +85,10 @@ @Resource private XpPushMessageClient xpPushMessageClient; @Resource private ReassignOrderClient reassignOrderClient; @Resource private UserVehicleClient userVehicleClient; @@ -117,6 +126,7 @@ case SYSTEM_STATUS_XPU: log.info("XPU发布系统运行状态 (XPU→云端):{}", message); systemStatusXpu(msgContent); systemStatusXpuAndReassign(msgContent); break; case XPU_NAVIGATION_REQUEST: log.info("XPU向云端请求导航 (XPU→云端):{}", message); @@ -278,6 +288,11 @@ //开始处理消息对应的业务逻辑 SystemRuntimeStatus systemRuntimeStatus = msgContent.getContent_detail().getObject("systemRuntimeStatus", SystemRuntimeStatus.class); AbnormalReason abnormalReason = systemRuntimeStatus.getSystem_status().getAbnormal_reason(); // 存储车辆挡位 GearLevel gearLevel = systemRuntimeStatus.getVehicle_status().getDynamic_status().getGear_level(); int value = gearLevel.getValue(); redisTemplate.opsForValue().set(CacheConstants.GEAR_LEVEL + systemRuntimeStatus.getVehicle_status().getStatic_info().getVin(), value); // 判断是否为故障状态 if (abnormalReason == AbnormalReason.FAULT) { log.info("车辆故障,开始处理故障"); xp-robotaxi-common/xp-common-core/src/main/java/com/xiaopeng/common/core/constant/CacheConstants.java
@@ -132,4 +132,8 @@ * 订单车辆轨迹,禁止用于其他用处 */ public static final String ORDER_ROUTE_CAPTURE = "order_route_capture:"; /** * 车辆挡位 */ public static final String GEAR_LEVEL = "gear_level:"; } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/constant/I18nKeyConstant.java
@@ -25,4 +25,7 @@ String FLEET_OPERATION_USER_BOUND_2 = "fleet.operation.user.bound.v2"; String FLEET_VEHICLE_BOUND_V1 = "fleet.vehicle.bound.v1"; String FLEET_VEHICLE_BOUND_V2 = "fleet.vehicle.bound.v2"; // ========== 车辆开关车门 ========== String VEHICLE_NOT_P_GEAR = "vehicle.not.p.gear"; } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -18,9 +18,11 @@ import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandEnum; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandParamVo; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandVo; import com.xiaopeng.common.core.constant.CacheConstants; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.exception.ServiceException; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.redis.service.RedisService; import com.xiaopeng.vehicleConvoy.constant.I18nKeyConstant; import com.xiaopeng.vehicleConvoy.mapper.XpVehicleMapper; import com.xiaopeng.vehicleConvoy.model.dto.*; @@ -67,9 +69,10 @@ @Autowired private IXpVehicleAnnualRecordService xpVehicleAnnualRecordService; @Resource private XpuVinClient xpuVinClient; @Autowired private RedisService redisService; @Override public List<XpVehicle> listByIds(List<Long> ids) { @@ -142,6 +145,11 @@ if("door".equals(dto.getDoorType())){ vehiclesCommandVo.setCommandCode(VehiclesCommandEnum.DOOR_UNLOCK); }else { // 开启后备箱 判断是否为P档 Integer gearLevel = redisService.getCacheObject(CacheConstants.GEAR_LEVEL + xpVehicle.getVehicleVin()); if(gearLevel == null || gearLevel != 4){ throw new ServiceException("车辆非P档,无法开启后备箱", I18nKeyConstant.VEHICLE_NOT_P_GEAR); } vehiclesCommandVo.setCommandCode(VehiclesCommandEnum.DOOR_TRUNK_OPEN); } try{ xp-robotaxi-vehicle-convoy-boot/src/main/resources/i18n/messages_en_US.properties
@@ -12,4 +12,5 @@ vehicle.import.data.empty=Import data is empty! vehicle.operation.info.incomplete=The following information is incomplete and cannot start operation: {0} vehicle.batch.operation.condition.not.met=The following vehicles do not meet operating conditions: {0} vehicle.time.expired=The following dates have expired, please enter valid dates: {0} vehicle.time.expired=The following dates have expired, please enter valid dates: {0} vehicle.not.p.gear=The trunk cannot be opened when the vehicle is not in P gear xp-robotaxi-vehicle-convoy-boot/src/main/resources/i18n/messages_zh_CN.properties
@@ -12,4 +12,5 @@ vehicle.import.data.empty=导入数据为空! vehicle.operation.info.incomplete=以下信息未完善,无法开始运营:{0} vehicle.batch.operation.condition.not.met=以下车辆不满足运营条件:{0} vehicle.time.expired=以下时间已过期,请填写有效日期:{0} vehicle.time.expired=以下时间已过期,请填写有效日期:{0} vehicle.not.p.gear=车辆非P档,无法开启后备箱