| | |
| | | import com.xiaopeng.api.vo.OrderType; |
| | | import com.xiaopeng.api.vo.account.UserCouponVo; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.*; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.OrderStatus; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.api.vo.order.*; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.AddTaxiPassengerVo; |
| | |
| | | import com.xiaopeng.order.utils.GDMapGeocodingUtil; |
| | | import com.xiaopeng.order.utils.TaxiPricingDemoService; |
| | | import com.xiaopeng.order.utils.RegionCodeFilterUtil; |
| | | import com.xiaopeng.order.utils.TaxiPricingDemoService; |
| | | import com.xiaopeng.order.utils.XpPricingUtil; |
| | | import com.xiaopeng.order.utils.holiday.HolidayUtil; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | |
| | | 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)); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | | params.put("timestamp", new Date().getTime() + ""); |
| | | String message = JSONObject.toJSONString(params); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | |
| | | 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)); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | | params.put("timestamp", new Date().getTime() + ""); |
| | | String message = JSONObject.toJSONString(params); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | |
| | | pushOrderDto.setStartLongitude(order.getStartLon()); |
| | | pushOrderDto.setEndLatitude(order.getEndLat()); |
| | | pushOrderDto.setEndLongitude(order.getEndLon()); |
| | | pushOrderDto.setEndPoiName(order.getEndPointName()); |
| | | pushOrderDto.setOrderType(OrderType.USER_ORDER); |
| | | pushOrderDto.setStage(1); |
| | | // 调用推送服务 orderId + carVin |
| | |
| | | xpCruiseOrder.setStatus(0); |
| | | xpCruiseOrder.setCreateTime(LocalDateTime.now()); |
| | | |
| | | // 判断当前时分秒是否大于收车时间 |
| | | if(null != xpTaskRule){ |
| | | // 判断当前时分秒是否大于收车时间&&收车配置开启 |
| | | if(null != xpTaskRule && xpTaskRule.getVehicleCollection()){ |
| | | LocalTime vehicleCollectionTime = xpTaskRule.getVehicleCollectionTime(); |
| | | if (vehicleCollectionTime.isBefore(LocalTime.now())) { |
| | | XpVehicle vehicle1 = new XpVehicle(); |
| | |
| | | xpCruiseOrder.setStatus(0); |
| | | xpCruiseOrder.setCreateTime(LocalDateTime.now()); |
| | | |
| | | // 判断当前时分秒是否大于收车时间 |
| | | if(null != xpTaskRule){ |
| | | // 判断当前时分秒是否大于收车时间&&收车配置开启 |
| | | if(null != xpTaskRule && xpTaskRule.getVehicleCollection()){ |
| | | LocalTime vehicleCollectionTime = xpTaskRule.getVehicleCollectionTime(); |
| | | if (vehicleCollectionTime.isBefore(LocalTime.now())) { |
| | | XpVehicle vehicle1 = new XpVehicle(); |
| | |
| | | @Override |
| | | public XpVehicle queryVehicleByOrderId(Long orderId, String uid) { |
| | | XpOrder xpOrder = this.getById(orderId); |
| | | if (xpOrder == null || xpOrder.getVehicleId() == null) { |
| | | return null; |
| | | } |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData(); |
| | | return xpVehicle; |
| | | } |
| | |
| | | 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_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)){ |
| | |
| | | dto2.setOrigin(origin); |
| | | dto2.setDestination(destination); |
| | | dto2.setRouteType(1); |
| | | dto2.setVehicleId(vehicle.getId()); |
| | | R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto2); |
| | | if (200 != routeVoR.getCode()) { |
| | | throw new RuntimeException("获取订单线路和运费失败"); |
| | |
| | | xpOrderDetailVO.setVehiclePictures(vehicle.getVehiclePictures()); |
| | | } |
| | | Integer status = xpOrder.getStatus(); |
| | | if(status == 4 || status == 7 || status == 8){ |
| | | if(status > 2 && status < 8){ |
| | | Boolean data = xpVehicleClient.getVehicleTrunkOpenStatus(xpOrder.getAppUserId(), xpOrder.getVehicleId()).getData(); |
| | | xpOrder.setOpenTrunk(data ? 1 : 2); |
| | | xpOrderDetailVO.setOpenTrunk(data ? 1 : 2); |