| | |
| | | import com.xiaopeng.api.dto.account.UcUserInfo; |
| | | import com.xiaopeng.api.dto.account.UseUserCouponDto; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.dto.automaticPilot.VehicleEventDTO; |
| | | import com.xiaopeng.api.dto.operation.CruisePointDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.VehicleBuriedPointClient; |
| | | import com.xiaopeng.api.feignClient.maintenance.XpTaskRuleClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpCruisePlanClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpPointClient; |
| | |
| | | private final XpCruisePlanClient xpCruisePlanClient; |
| | | private final XpPricingUtil xpPricingUtil; |
| | | private final GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | private final VehicleBuriedPointClient vehicleBuriedPointClient; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | log.info("已将原车辆状态设为空闲,车辆ID: {}", oldVehicleId); |
| | | |
| | | // 6.1.4 为原车辆创建返程巡游订单 |
| | | -------------- |
| | | createReturnCruiseOrder(oldVehicle.getId(), order); |
| | | } else { |
| | | log.warn("查询原车辆信息失败,车辆ID: {}", oldVehicleId); |
| | |
| | | |
| | | /** |
| | | * 取消订单后的继续巡游任务 |
| | | * @param vehicle |
| | | * @param vehicleId |
| | | */ |
| | | public void addCruiseMission(Long vehicleId) { |
| | | XpVehicle vehicle = xpVehicleClient.queryById(vehicleId).getData(); |
| | |
| | | xpCruiseOrder.setVehicleId(null); |
| | | xpCruiseOrderMapper.updateById(xpCruiseOrder); |
| | | log.info("修改巡游单状态,开始执行巡游单 {}", dto.getOrderId()); |
| | | // 封装埋点消息实体 |
| | | VehicleEventDTO vehicleEventDTO = new VehicleEventDTO(); |
| | | vehicleEventDTO.setVin(dto.getXpVehicleVin()); |
| | | vehicleEventDTO.setXpuId(""); |
| | | vehicleEventDTO.setOrderId(String.valueOf(dto.getOrderId())); |
| | | vehicleEventDTO.setEventKey("RT_xpu_vehicle_trace_upload"); |
| | | vehicleEventDTO.setEventTime(System.currentTimeMillis()); |
| | | Map<String,Object> attributes = new HashMap<>(); |
| | | attributes.put("vin",vehicleEventDTO.getVin()); |
| | | attributes.put("order_id",vehicleEventDTO.getOrderId()); |
| | | attributes.put("order_type","cruise_order"); |
| | | attributes.put("timestamp",vehicleEventDTO.getEventTime()); |
| | | attributes.put("current_main_status",OrderStatus.ORDER_STARTED); |
| | | attributes.put("current_sub_status",""); |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(dto.getXpVehicleVin())), VehiclePosition.class); |
| | | if(Objects.nonNull(vehiclePosition)){ |
| | | attributes.put("odometer_km",vehiclePosition.getTotalOdometer()); |
| | | }else { |
| | | attributes.put("odometer_km",""); |
| | | } |
| | | vehicleEventDTO.setAttributes(attributes); |
| | | vehicleBuriedPointClient.sendVehicleEvent(vehicleEventDTO); |
| | | log.info("巡游单埋点消息,开始执行推送: {}", dto.getOrderId()); |
| | | } |
| | | } |
| | | //乘客单处理逻辑 |
| | |
| | | //推送乘客车辆到达预约点的导航数据 |
| | | sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin()); |
| | | } |
| | | |
| | | if(order.getStatus() == 2){ |
| | | // 封装埋点消息实体 |
| | | VehicleEventDTO vehicleEventDTO = new VehicleEventDTO(); |
| | | vehicleEventDTO.setVin(dto.getXpVehicleVin()); |
| | | vehicleEventDTO.setXpuId(""); |
| | | vehicleEventDTO.setOrderId(String.valueOf(dto.getOrderId())); |
| | | vehicleEventDTO.setEventKey("RT_xpu_vehicle_trace_upload"); |
| | | vehicleEventDTO.setEventTime(System.currentTimeMillis()); |
| | | Map<String,Object> attributes = new HashMap<>(); |
| | | attributes.put("vin",vehicleEventDTO.getVin()); |
| | | attributes.put("order_id",vehicleEventDTO.getOrderId()); |
| | | attributes.put("order_type","user_order"); |
| | | attributes.put("timestamp",vehicleEventDTO.getEventTime()); |
| | | attributes.put("current_main_status",OrderStatus.ORDER_EN_ROUTE_TO_PICKUP); |
| | | attributes.put("current_sub_status",""); |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(dto.getXpVehicleVin())), VehiclePosition.class); |
| | | if(Objects.nonNull(vehiclePosition)){ |
| | | attributes.put("odometer_km",vehiclePosition.getTotalOdometer()); |
| | | }else { |
| | | attributes.put("odometer_km",""); |
| | | } |
| | | vehicleEventDTO.setAttributes(attributes); |
| | | vehicleBuriedPointClient.sendVehicleEvent(vehicleEventDTO); |
| | | log.info("用户单埋点消息,开始执行推送: {}", dto.getOrderId()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |