| | |
| | | import com.xiaopeng.api.vo.OrderType; |
| | | import com.xiaopeng.api.vo.account.GetUserListByUidsVo; |
| | | import com.xiaopeng.api.vo.account.UserCouponVo; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.api.vo.order.*; |
| | |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", order.getId()); |
| | | content.put("orderId", order.getId().toString()); |
| | | content.put("status", OrderStatusEnum.CANCELED.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content)); |
| | |
| | | userVehicleClient.addTaxiPassenger(addTaxiPassengerVo); |
| | | //推送乘客车辆到达预约点的导航数据 |
| | | sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA"); |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin()); |
| | | }else{ |
| | | //推送行起点到终点的驶轨迹给乘客端 |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_END_DATA"); |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_END_DATA", dto.getXpVehicleVin()); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param appUserId |
| | | * @param keyStr |
| | | */ |
| | | public void sendRoute(String appUserId, Long orderId, String keyStr){ |
| | | public void sendRoute(String appUserId, Long orderId, String keyStr, String vin){ |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | | Object cacheObject = redisService.getCacheObject(keyStr + ":" + appUserId); |
| | | if(null != cacheObject){ |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | |
| | | JSONObject content = new JSONObject(); |
| | | content.put("orderId", orderId); |
| | | content.put("routeType", "ORDER_NAVIGATION_START_DATA".equals(keyStr) ? 1 : 2); |
| | | content.put("direction", null != vehiclePosition ? vehiclePosition.getCourse() : 0); |
| | | JSONObject route = new JSONObject(); |
| | | route.put("distance", routeVo.getDistance()); |
| | | route.put("duration", routeVo.getDuration()); |