Merge remote-tracking branch 'origin/master'
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-account-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @ApiModel("推送订单Dto") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PushOrderDto { |
| | | @ApiModelProperty("车辆vin") |
| | | private String vin; |
| | | |
| | | // 订单id |
| | | @ApiModelProperty("订单id") |
| | | private Long orderId; |
| | | private String orderId; |
| | | |
| | | |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.api.factory.order; |
| | | |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; |
| | | import com.xiaopeng.api.feignClient.order.XpOrderClient; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | |
| | | /** |
| | | * 订单Feign客户端降级工厂 |
| | | * |
| | | * @author mitao |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class XpCruiseOrderClientFallbackFactory implements FallbackFactory<XpCruiseOrderClient> { |
| | | |
| | | @Override |
| | | public XpCruiseOrderClient create(Throwable cause) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return new XpCruiseOrderClient() { |
| | | @Override |
| | | public R<String> addCruiseOrder(XpCruiseOrder order) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<String> updateCruiseOrder(String vin) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<String> closeCruiseOrder(String vin) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<XpCruiseOrder> getCruiseOrder(String orderId) { |
| | | log.error("订单服务调用失败: {}", cause.getMessage()); |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.feignClient.order; |
| | | |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.factory.order.XpCruiseOrderClientFallbackFactory; |
| | | import com.xiaopeng.api.factory.order.XpOrderClientFallbackFactory; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 巡游订单Feign客户端 |
| | | * |
| | | * @author mitao |
| | | */ |
| | | @FeignClient(contextId = "XpCruiseOrderClient", |
| | | value = ServiceNameConstantsEnum.XP_ORDER_SERVICE, |
| | | fallbackFactory = XpCruiseOrderClientFallbackFactory.class) |
| | | public interface XpCruiseOrderClient { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加订单 |
| | | * |
| | | * @param order 订单信息 |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/addCruiseOrder") |
| | | R<String> addCruiseOrder(@RequestBody XpCruiseOrder order); |
| | | |
| | | |
| | | /** |
| | | * 查询并关闭订单信息 返回id信息 |
| | | * |
| | | * @param vin 订单信息 |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/updateCruiseOrder") |
| | | R<String> updateCruiseOrder(@RequestParam String vin); |
| | | |
| | | |
| | | /** |
| | | * 关闭 |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/closeCruiseOrder") |
| | | R<String> closeCruiseOrder(@RequestParam String vin); |
| | | |
| | | /** |
| | | * 查询订单信息 |
| | | * |
| | | * @param orderId 订单信息id |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/getCruiseOrder") |
| | | R<XpCruiseOrder> getCruiseOrder(@RequestParam String orderId); |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则") |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明") |
| | | private Integer descriptionType; |
| | | |
| | | @ApiModelProperty(value = "富文本内容") |
| | |
| | | @ApiModelProperty(value = "距离 单位米") |
| | | @TableField(exist = false) |
| | | private BigDecimal distance; |
| | | |
| | | @ApiModelProperty(value = "0否 1是充电点位") |
| | | @TableField("charge_point") |
| | | private Integer chargePoint; |
| | | |
| | | @ApiModelProperty(value = "0否 1是收车点位") |
| | | @TableField("parking_point") |
| | | private Integer parkingPoint; |
| | | } |
| | |
| | | @TableField("city_id") |
| | | private Integer cityId; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField(exist = false) |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty(value = "备注说明") |
| | | @TableField("remark") |
| | | private String remark; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_system_setting") |
| | | @ApiModel(value="XpSystemSetting对象", description="系统设置表") |
| | | @ApiModel(value = "XpSystemSetting对象", description = "系统设置表") |
| | | public class XpSystemSetting extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @TableField("arrive_time") |
| | | private Integer arriveTime; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "常见问题首页展示数") |
| | | @TableField("head_show_count") |
| | | private Integer headShowCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "附近站点距离") |
| | | @TableField("near_point_distance") |
| | | private Integer nearPointDistance; |
| | | |
| | | |
| | | @ApiModelProperty(value = "吸附距离") |
| | | @TableField("adsorption_distance") |
| | | private Integer adsorptionDistance; |
| | | |
| | | @ApiModelProperty(value = "热修复状态 0-关闭 1-开始") |
| | | @TableField("hotfix_status") |
| | | private Integer hotfixStatus; |
| | | |
| | | @ApiModelProperty(value = "热修复开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_start_time") |
| | | private LocalDateTime hotfixStartTime; |
| | | |
| | | @ApiModelProperty(value = "热修复结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_end_time") |
| | | private LocalDateTime hotfixEndTime; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.model.order; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单-巡游 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("xp_cruise_order") |
| | | @ApiModel(value="XpCruiseOrder对象", description="订单巡游") |
| | | public class XpCruiseOrder extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | |
| | | @ApiModelProperty(value = "车辆vin") |
| | | private String vehicleVin; |
| | | |
| | | @ApiModelProperty(value = "订单类型 1=正常巡游单 2返程单") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(value = "出发地经度值") |
| | | private Double startLon; |
| | | |
| | | @ApiModelProperty(value = "出发地纬度值") |
| | | private Double startLat; |
| | | |
| | | @ApiModelProperty(value = "目的地经度") |
| | | private Double endLon; |
| | | |
| | | @ApiModelProperty(value = "目的地纬度") |
| | | private Double endLat; |
| | | |
| | | @ApiModelProperty(value = "状态 1进行中 2已停止") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "下单站点id") |
| | | @TableField("start_point_id") |
| | | private Long startPointId; |
| | | |
| | | @ApiModelProperty(value = "下单终点站点Id") |
| | | @TableField("end_point_id") |
| | | private Long endPointId; |
| | | |
| | | @ApiModelProperty(value = "下单站点名称") |
| | | @TableField("start_point_name") |
| | | private String startPointName; |
| | | |
| | | @ApiModelProperty(value = "下单终点站点名称") |
| | | @TableField("end_point_name") |
| | | private String endPointName; |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | @TableField("mission_id") |
| | | private String missionId; |
| | | |
| | | @ApiModelProperty(value = "返程上次的订单id") |
| | | @TableField("last_order_id") |
| | | private String lastOrderId; |
| | | } |
| | |
| | | * 当前电量 |
| | | */ |
| | | private Float currentElectricity; |
| | | /** |
| | | * 当前电量 |
| | | */ |
| | | private Float mileageRange; |
| | | |
| | | /** |
| | | * 是否有巡游单子 1有 0否 |
| | |
| | | /** |
| | | * 电池电量(0-100%) |
| | | */ |
| | | private Float battery_level; |
| | | private Float bms_soc_disp; |
| | | /** |
| | | * 综合续航 单位KM |
| | | */ |
| | | private Float dst_bat_disp; |
| | | } |
| | |
| | | com.xiaopeng.api.factory.maintenance.XpCheckLocationClientFallbackFactory |
| | | com.xiaopeng.api.factory.automaticPilot.OrderMissionClientFallbackFactory |
| | | com.xiaopeng.api.factory.maintenance.XpClockInClientFallbackFactory |
| | | com.xiaopeng.api.factory.account.SysGroupMenuClientFallbackFactory |
| | | com.xiaopeng.api.factory.account.SysGroupMenuClientFallbackFactory |
| | | com.xiaopeng.api.factory.order.XpCruiseOrderClientFallbackFactory |
| | |
| | | @PostMapping("/inner/pushOrder") |
| | | public R<Boolean> pushOrder(@RequestBody PushOrderDto dto) { |
| | | RTTask task = new RTTask(); |
| | | task.setOrder_id(dto.getOrderId().toString()); |
| | | task.setOrder_id(dto.getOrderId()); |
| | | task.setTask_id("MISSION_"+ IdUtil.fastUUID()); |
| | | task.setTask_type(TaskType.ROBOTAXI); |
| | | if(dto.getOrderId().contains("XU")){ |
| | | task.setTask_type(TaskType.CRUISE); |
| | | }else { |
| | | task.setTask_type(TaskType.ROBOTAXI); |
| | | } |
| | | task.setStatus(TaskStatus.PENDING); |
| | | SnowFlake snowFlake = new SnowFlake(0, 0); |
| | | snowFlake.withStartTimestamp(1420041600000L); |
| | | long sequence = snowFlake.nextId(); |
| | | MqttPublishDto mqttPublishDto = xpuUtil.cloudCreateOrder(task, dto.getVin(),sequence); |
| | | if (mqttPublishDto.getCode()== 200) { |
| | | |
| | | // 正常单子才修改 巡游单子不修改状态 |
| | | if (!dto.getOrderId().contains("XU") && mqttPublishDto.getCode()== 200) { |
| | | // 修改车子为接单状态 |
| | | xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(),1)); |
| | | |
| | |
| | | package com.xiaopeng.automaticPilot.service; |
| | | |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.automaticPilot.MqttPublishDto; |
| | | 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.pushMessage.SendMessageDTO; |
| | | import com.xiaopeng.api.feignClient.map.XpMapClient; |
| | | import com.xiaopeng.api.feignClient.operation.ReassignOrderClient; |
| | | import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; |
| | | 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.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.GeoPoint; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.ResponseMessage; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.StatusCode; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.RTTask; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskStatus; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskType; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.*; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudPushNavigation.RestoreNavigationData; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.up.MessageType; |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.OrderStatusEnum; |
| | | import com.xiaopeng.common.core.enums.PushMessageTypeEnum; |
| | | import com.xiaopeng.common.core.utils.SnowFlake; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | |
| | | private UserVehicleClient userVehicleClient; |
| | | |
| | | @Resource |
| | | private XpCruiseOrderClient xpCruiseOrderClient; |
| | | |
| | | @Resource |
| | | private Snowflake snowflake; |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | |
| | | /** |
| | |
| | | //车辆动态信息 |
| | | VehicleDynamicStatus dynamicStatus = vehicleStatus.getDynamic_status(); |
| | | dynamicStatus.setSpeed(dynamicStatus.getSpeed()); |
| | | vehiclePosition.setCurrentElectricity(dynamicStatus.getBattery_level()); |
| | | vehiclePosition.setCurrentElectricity(dynamicStatus.getBms_soc_disp()); |
| | | vehiclePosition.setMileageRange(dynamicStatus.getDst_bat_disp()); |
| | | //订单信息 |
| | | OrderStatusInfo runningOrderStatusInfo = systemRuntimeStatus.getRunning_order_status_info(); |
| | | Long orderId = null; |
| | |
| | | //订单类型 1:乘客订单,2=巡游订单 |
| | | LonLatDto destination = new LonLatDto(); |
| | | LonLatDto origin = new LonLatDto(); |
| | | //导航id |
| | | String routeID = ""; |
| | | Long vehicleId = null; |
| | | if (orderId.contains("XU")) { |
| | | // todo 下发巡游单的导航数据 |
| | | //巡游单 |
| | | if (orderPhase.equals(OrderPhase.ROUTE_TO_CRUISE)) { |
| | | origin.setLongitude(116.40528); |
| | | origin.setLatitude(39.90498); |
| | | destination.setLongitude(116.40528); |
| | | destination.setLatitude(39.90498); |
| | | |
| | | //先响应消息 |
| | | responseMessage(sequence, ""); |
| | | /* 构建导航数据给到车端 */ |
| | | R<XpCruiseOrder> cruiseOrder = xpCruiseOrderClient.getCruiseOrder(orderId); |
| | | XpCruiseOrder xpCruiseOrder = cruiseOrder.getData(); |
| | | |
| | | origin.setLongitude(xpCruiseOrder.getStartLon()); |
| | | origin.setLatitude(xpCruiseOrder.getStartLat()); |
| | | destination.setLongitude(xpCruiseOrder.getEndLon()); |
| | | destination.setLatitude(xpCruiseOrder.getEndLat()); |
| | | |
| | | OrderRouteAndFareDto dto = new OrderRouteAndFareDto(); |
| | | dto.setOrderId(Long.parseLong(orderId)); |
| | | dto.setOrigin(origin); |
| | | dto.setDestination(destination); |
| | | R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto); |
| | | if (200 != routeVoR.getCode()) { |
| | | throw new RuntimeException("获取订单线路和运费失败"); |
| | | } |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | routeID = routeVo.getRouteID(); |
| | | |
| | | |
| | | // vehicleId = xpOrder.getVehicleId(); |
| | | } |
| | | } else { |
| | | //正常单 |
| | |
| | | origin.setLatitude(vehiclePosition.getPoint().getY()); |
| | | destination.setLongitude(xpOrder.getStartLon()); |
| | | destination.setLatitude(xpOrder.getStartLat()); |
| | | |
| | | OrderRouteAndFareDto dto = new OrderRouteAndFareDto(); |
| | | dto.setOrderId(Long.parseLong(orderId)); |
| | | dto.setOrigin(origin); |
| | | dto.setDestination(destination); |
| | | R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto); |
| | | if (200 != routeVoR.getCode()) { |
| | | throw new RuntimeException("获取订单线路和运费失败"); |
| | | } |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | routeID = routeVo.getRouteID(); |
| | | } |
| | | //驶往下车点的行程 |
| | | if (orderPhase.equals(OrderPhase.ROUTE_TO_DESTINATION)) { |
| | | //查询起点到终点的线路 |
| | | origin.setLongitude(xpOrder.getStartLon()); |
| | | origin.setLatitude(xpOrder.getStartLat()); |
| | | destination.setLongitude(xpOrder.getEndLon()); |
| | | destination.setLatitude(xpOrder.getEndLat()); |
| | | //直接取缓存中的导航数据推送给车端和乘客 |
| | | Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_DATA:" + xpOrder.getAppUserId()); |
| | | if(null == cacheObject){ |
| | | //没有缓存数据,重新规划线路 |
| | | //查询起点到终点的线路 |
| | | origin.setLongitude(xpOrder.getStartLon()); |
| | | origin.setLatitude(xpOrder.getStartLat()); |
| | | destination.setLongitude(xpOrder.getEndLon()); |
| | | destination.setLatitude(xpOrder.getEndLat()); |
| | | OrderRouteAndFareDto dto = new OrderRouteAndFareDto(); |
| | | dto.setOrderId(Long.parseLong(orderId)); |
| | | dto.setOrigin(origin); |
| | | dto.setDestination(destination); |
| | | R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto); |
| | | if (200 != routeVoR.getCode()) { |
| | | throw new RuntimeException("获取订单线路和运费失败"); |
| | | } |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | routeID = routeVo.getRouteID(); |
| | | //缓存导航数据,用于后面的逻辑中给乘客端推送导航数据 |
| | | redisService.setCacheObject("ORDER_NAVIGATION_DATA:" + xpOrder.getAppUserId(), com.alibaba.fastjson.JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | }else{ |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | | routeID = routeVo.getRouteID(); |
| | | } |
| | | } |
| | | OrderRouteAndFareDto dto = new OrderRouteAndFareDto(); |
| | | dto.setOrderId(Long.parseLong(orderId)); |
| | | dto.setOrigin(origin); |
| | | dto.setDestination(destination); |
| | | R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto); |
| | | if (200 != routeVoR.getCode()) { |
| | | throw new RuntimeException("获取订单线路和运费失败"); |
| | | } |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData(); |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | R<String> stringR = xpMapClient.queryRouted(routeVo.getRouteID()); |
| | | vehicleId = xpOrder.getVehicleId(); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(routeID)){ |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(vehicleId).getData(); |
| | | R<String> stringR = xpMapClient.queryRouted(routeID); |
| | | if (200 != stringR.getCode()) { |
| | | throw new RuntimeException("根据导航ID获取车端需要的导航数据失败"); |
| | | } |
| | | //构建导航下发请求对象 |
| | | cloudPushNavigationInfo(requestId, routeVo.getRouteID(), stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId()); |
| | | cloudPushNavigationInfo(requestId, routeID, stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId()); |
| | | } |
| | | } |
| | | |
| | |
| | | if(orderId.contains("XU")){ |
| | | //巡游单 |
| | | //响应消息 |
| | | // TODO 1.处理结束当前巡游订单 2.创建新的巡游订单 返航 3.调用xpu车机接口 (判断是返航还是正常 返航需要存储之前的订单id) |
| | | responseMessage(sequence, ""); |
| | | //前往目的地 |
| | | if(OrderStatusEnum.IN_SERVICE.equals(status)){ |
| | |
| | | //到达目的地 |
| | | if(OrderStatusEnum.COMPLETED.equals(status)){ |
| | | |
| | | // 返程找到目前的订单 -》之前的订单 查询生成一个 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 每次判断是否收车状态 是则不进行处理了 |
| | | // 找到这个订单 |
| | | R<XpCruiseOrder> cruiseOrder = xpCruiseOrderClient.getCruiseOrder(orderId); |
| | | if(cruiseOrder!=null){ |
| | | XpCruiseOrder xpCruiseOrder = cruiseOrder.getData(); |
| | | Long vehicleId = xpCruiseOrder.getVehicleId(); |
| | | |
| | | // 关闭当前巡游单子 已完成 |
| | | xpCruiseOrderClient.closeCruiseOrder(xpCruiseOrder.getVehicleVin()); |
| | | R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(vehicleId); |
| | | XpVehicle xpVehicle = xpVehicleR.getData(); |
| | | // 运营中 继续执行 |
| | | if(xpVehicle.getOperatingStatus()==1 && xpVehicle.getState()==0){ |
| | | // 创建新的巡游单子 判断是否为返程单子 |
| | | if(xpCruiseOrder.getOrderType()==2){ |
| | | R<XpCruiseOrder> lastOrder = xpCruiseOrderClient.getCruiseOrder(xpCruiseOrder.getLastOrderId()); |
| | | XpCruiseOrder lastXpCruiseOrder = lastOrder.getData(); |
| | | |
| | | // 修改一下id 加一个一样的巡游单子 |
| | | lastXpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); |
| | | lastXpCruiseOrder.setStatus(1); |
| | | xpCruiseOrderClient.addCruiseOrder(lastXpCruiseOrder); |
| | | |
| | | |
| | | RTTask task = new RTTask(); |
| | | task.setOrder_id(lastXpCruiseOrder.getId()); |
| | | task.setTask_id("MISSION_"+ IdUtil.fastUUID()); |
| | | task.setTask_type(TaskType.CRUISE); |
| | | task.setStatus(TaskStatus.PENDING); |
| | | SnowFlake snowFlake = new SnowFlake(0, 0); |
| | | snowFlake.withStartTimestamp(1420041600000L); |
| | | long sequence1 = snowFlake.nextId(); |
| | | xpuUtil.cloudCreateOrder(task, xpVehicle.getVehicleVin(),sequence1); |
| | | }else if(xpCruiseOrder.getOrderType()==1){ |
| | | // 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 TODO v |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | }else{ |
| | | //普通单 |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-automaticPilot" # 与spring.application.name一致 |
| | | application.id = "xp-robotaxi-automatic-pilot-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | | } |
| | |
| | | String voJsonStr = JSONObject.toJSONString(routeAndFareVo); |
| | | // 进行缓存 |
| | | redisService.setCacheObject(key, voJsonStr, 5l, TimeUnit.MINUTES); |
| | | |
| | | //缓存导航数据,用于下单后推送导航给车端和乘客端 |
| | | redisService.setCacheObject("ORDER_NAVIGATION_DATA:" + userId, JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | return routeAndFareVo; |
| | | } |
| | | |
| | |
| | | # 中文 |
| | | path.not.found=????? |
| | | to.work= ??????????,?????? |
| | | path.not.found=路径不存在 |
| | | to.work=当前的接送点距离过近。建议步行前往 |
| | | welcome.message=欢迎来到我们的应用程序! |
| | |
| | | # 中文 |
| | | path.not.found=????? |
| | | to.work=\ ??????????,?????? |
| | | path.not.found=路径不存在 |
| | | to.work=当前的接送点距离过近。建议步行前往 |
| | | welcome.message=欢迎来到我们的应用程序! |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-itinerary-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | @ApiOperation(value = "事故任务确认到达", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/confirmArrive") |
| | | @Transactional |
| | | public R confirmArrive( Integer id) { |
| | | public R confirmArrive( Long id) { |
| | | return xpTaskService.confirmArrive(id); |
| | | } |
| | | @ApiOperation(value = "查询车辆不分页列表", tags = "运维APP-任务中心") |
| New file |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.XpErrorType; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.account.LoginOperationUser; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | | import com.xiaopeng.maintenance.dto.SaveVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.TaskPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.XpTaskRecordPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.*; |
| | | import com.xiaopeng.maintenance.service.IXpErrorTypeService; |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import com.xiaopeng.maintenance.vo.VehicleListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 任务中心 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = "管理后台-任务工单") |
| | | @RequestMapping("/api/v1/taskManagement") |
| | | public class XpTaskManagementController { |
| | | @Resource |
| | | private XpTaskService xpTaskService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private IXpErrorTypeService xpErrorTypeService; |
| | | @Resource |
| | | private XpFleetOperationsClient xpFleetOperationsClient; |
| | | @Resource |
| | | private XpVehicleClient xpVehicleClient; |
| | | @ApiOperation(value = "事故类型列表", response = XpErrorType.class) |
| | | @GetMapping("/errorTypeList") |
| | | public R<List<XpErrorType>> errorTypeList() { |
| | | return xpErrorTypeService.errorTypeList(); |
| | | } |
| | | @ApiOperation(value = "任务中心列表", response = TaskPageListVO.class) |
| | | @PostMapping("/pageList") |
| | | public R<PageInfo<TaskManagementPageListVO>> pageListManagement(@RequestBody TaskManagementPageListQuery query) { |
| | | PageInfo<TaskManagementPageListVO> pageList = xpTaskService.pageListManagement(query); |
| | | return R.ok(pageList); |
| | | } |
| | | /** |
| | | * 管理后台-车辆管理-运营车辆管理-删除任务/事故 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除任务/事故") |
| | | @DeleteMapping("/deleteTaskById") |
| | | public R<?> deleteTaskById(@ApiParam(name = "id", value = "任务ID")Long id){ |
| | | xpTaskService.deleteTaskById(id); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "任务分配") |
| | | @GetMapping("/assigneeTask") |
| | | public R assigneeTask(@ApiParam(name = "id", value = "任务ID") Long id, @ApiParam(name = "handlerUserId", value = "处理人id")Long handlerUserId) { |
| | | Long assigneeUserId = tokenService.getLoginUser().getSysUser().getId(); |
| | | return xpTaskService.assigneeTask(id, handlerUserId,assigneeUserId); |
| | | } |
| | | @ApiOperation(value = "创建任务事故") |
| | | @PostMapping("/saveTask") |
| | | public R saveTask(@RequestBody SaveErrorTaskDto dto) { |
| | | Long reportUserId = tokenService.getLoginUser().getSysUser().getId(); |
| | | xpTaskService.saveTask(dto, reportUserId); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "任务详情") |
| | | @GetMapping("/taskDetail") |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) { |
| | | return xpTaskService.taskDetail(id); |
| | | } |
| | | @ApiOperation(value = "查询车辆不分页列表") |
| | | @PostMapping(" /listVehicle") |
| | | public R<List<VehicleListVO>> listVehicle() { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | // 查询当前人员所属车队 查询车队关联车辆 |
| | | R<List<Long>> vehicleByUserId = xpFleetOperationsClient.getVehicleByUserId(xpOperationsUser.getId()); |
| | | List<Long> vehicleIds = vehicleByUserId.getData(); |
| | | if (vehicleIds != null && !vehicleIds.isEmpty()){ |
| | | // todo 查询车辆列表 获取经纬度 |
| | | List<XpVehicle> data = xpVehicleClient.listByIds(vehicleIds).getData(); |
| | | if (data!=null){ |
| | | List<VehicleListVO> vehicleListVOS = new ArrayList<>(); |
| | | for (XpVehicle xpVehicle : data) { |
| | | VehicleListVO vehicleListVO = new VehicleListVO(); |
| | | vehicleListVO.setId(xpVehicle.getId()); |
| | | // vehicleListVO.setVehicleLon(xpVehicle.getVehicleLon()); |
| | | // vehicleListVO.setVehicleLat(xpVehicle.getVehicleLat()); |
| | | vehicleListVO.setVehicleCode(xpVehicle.getVehicleCode()); |
| | | vehicleListVO.setVehicleColor(xpVehicle.getVehicleColor()); |
| | | vehicleListVO.setPlateNumber(xpVehicle.getPlateNumber()); |
| | | vehicleListVO.setOperatingStatus(xpVehicle.getOperatingStatus()); |
| | | vehicleListVOS.add(vehicleListVO); |
| | | } |
| | | return R.ok(vehicleListVOS); |
| | | |
| | | } |
| | | } |
| | | |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | @ApiOperation(value = "上传车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping(" /saveVehicleAccident") |
| | | public R saveVehicleAccident(@RequestBody SaveVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | xpTaskService.saveVehicleAccident(dto, xpOperationsUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /vehicleRoutineDetail") |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) { |
| | | return xpTaskService.vehicleRoutineDetail(id); |
| | | } |
| | | @ApiOperation(value = "上传车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @PostMapping(" /saveRoutineDetail") |
| | | public R saveRoutineDetail(@RequestBody SaveRoutineDetailDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | Long id = loginOperationUser.getId(); |
| | | return xpTaskService.saveRoutineDetail(dto, id); |
| | | } |
| | | @ApiOperation(value = "车辆常规充电任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /chargingDetail") |
| | | public R<TaskChargingDetailVO> chargingDetail(Long id) { |
| | | return xpTaskService.chargingDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆常规维修任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /repairDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskRepairDetailVO> repairDetail(Long id) { |
| | | return xpTaskService.repairDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规整备任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /preparationDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskPreparationDetailVO> preparationDetail(Long id) { |
| | | return xpTaskService.preparationDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规检测任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /detectionDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskDetectionDetailVO> detectionDetail(Long id) { |
| | | return xpTaskService.detectionDetail(id); |
| | | } |
| | | @ApiOperation(value = "车辆常规洗车任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping(" /cleanDetail") |
| | | public R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id) { |
| | | return xpTaskService.cleanDetail(id); |
| | | } |
| | | @ApiOperation(value = "处理车辆事故", tags = "运维APP-任务中心") |
| | | @PostMapping(" /handleVehicleAccident") |
| | | @Transactional |
| | | public R handleVehicleAccident(@RequestBody HandleVehicleAccidentDto dto) { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | XpOperationsUser xpOperationsUser = loginOperationUser.getXpOperationsUser(); |
| | | return xpTaskService.handleVehicleAccident(dto,xpOperationsUser); |
| | | } |
| | | |
| | | /** |
| | | * 通过车辆id查询任务事故分页列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过车辆id查询任务事故分页列表", tags = {"管理后台-车辆管理-运营车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/queryTaskByVehicleId") |
| | | public R<PageInfo<XpTaskRecordVO>> queryTaskByVehicleId(@Valid @RequestBody XpTaskRecordPageQuery query) { |
| | | return R.ok(xpTaskService.queryTaskByVehicleId(query)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "事故类型列表", response = XpErrorType.class, tags = "管理后台-车辆管理-运营车辆管理") |
| | | @GetMapping(" /errorTypeTreeList") |
| | | public R<List<XpErrorType>> errorTypeTreeList() { |
| | | return xpErrorTypeService.errorTypeList(); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.maintenance.service.IXpVehicleDescriptionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Api(tags = "车辆整备、充电、检测说明") |
| | | @RestController |
| | | @RequestMapping("/xp-vehicle-description") |
| | | public class XpVehicleDescriptionController { |
| | | |
| | | private final IXpVehicleDescriptionService xpVehicleDescriptionService; |
| | |
| | | this.xpVehicleDescriptionService = xpVehicleDescriptionService; |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则",tags = {"运维APP-车辆管理"}) |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicle/vehicleDescription") |
| | | public R<XpVehicleDescription> getVehicleDescription(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"管理后台-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicle-description/vehicleDescription") |
| | | @ApiImplicitParam(name = "descriptionType", value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明", required = true, paramType = "query", dataTypeClass = Integer.class) |
| | | public R<XpVehicleDescription> getVehicleDescriptionByType(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, descriptionType) |
| | | .last("LIMIT 1")); |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存车辆整备、充电、检测、保险、年检、保养、运营资质说明") |
| | | @PostMapping("/api/v1/vehicle-description/save") |
| | | public R<?> saveVehicleDescription(@RequestBody XpVehicleDescription xpVehicleDescription) { |
| | | if (xpVehicleDescription.getDescriptionType() == null) { |
| | | return R.fail("descriptionType不能为空"); |
| | | } |
| | | // 先查询是否存在 |
| | | XpVehicleDescription existing = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, xpVehicleDescription.getDescriptionType()) |
| | | .last("LIMIT 1")); |
| | | if (existing != null) { |
| | | // 存在则更新 |
| | | existing.setDescriptionContent(xpVehicleDescription.getDescriptionContent()); |
| | | xpVehicleDescriptionService.updateById(existing); |
| | | } else { |
| | | // 不存在则插入 |
| | | xpVehicleDescriptionService.save(xpVehicleDescription); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchAcceptDTO; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchDepartureDTO; |
| | | import com.xiaopeng.maintenance.model.query.OperationRecordsQuery; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private IXpVehiclePreparationService xpVehiclePreparationService; |
| | | @Autowired |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Autowired |
| | | private XpCruiseOrderClient xpCruiseOrderClient; |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private OrderMissionClient orderMissionClient; |
| | | |
| | | /** |
| | | * 车辆详情-车辆调度-发车 收车 |
| | |
| | | @ApiOperation(value = "车辆运维-车辆调度-发车/收车", tags = {"运维APP-车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/vehicleDispatchDeparture") |
| | | public R<String> vehicleDispatchDeparture(@RequestBody VehicleDispatchDepartureDTO dto) { |
| | | |
| | | // 判断是否有正在进行的正常订单 |
| | | // 查询车辆 |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(dto.getVehicleId()).getData(); |
| | | if(xpVehicle.getState()==1){ |
| | | return R.fail("车辆正在接单中"); |
| | | } |
| | | xpVehicle.setOperatingStatus(dto.getDepartureStatus()); |
| | | xpVehicleClient.updateVehicleById(xpVehicle); |
| | | |
| | | // 发车 |
| | | if(dto.getDepartureStatus()==1){ |
| | | // 找车辆的任务 生成巡游单子 下发命令 TODO |
| | | }else if(dto.getDepartureStatus()==3){ |
| | | // 收车 关闭当前巡游单子 生成新的返程单子 找到收车站点 |
| | | R<String> r = xpCruiseOrderClient.updateCruiseOrder(xpVehicle.getVehicleVin()); |
| | | |
| | | // redis 获取当前最新经纬度位置 |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); |
| | | double x = vehiclePosition.getPoint().getX(); |
| | | double y = vehiclePosition.getPoint().getY(); |
| | | XpCruiseOrder xpCruiseOrder = new XpCruiseOrder(); |
| | | xpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); |
| | | xpCruiseOrder.setVehicleId(xpVehicle.getId()); |
| | | xpCruiseOrder.setOrderType(2); |
| | | xpCruiseOrder.setStartLon(x); |
| | | xpCruiseOrder.setStartLat(y); |
| | | // TODO 找到收车站点 |
| | | xpCruiseOrder.setStatus(1); |
| | | |
| | | |
| | | // 下发命令 |
| | | orderMissionClient.pushOrder(new PushOrderDto( xpCruiseOrder.getVehicleVin(),xpCruiseOrder.getId(),null)); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| New file |
| | |
| | | package com.xiaopeng.maintenance.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台创建事故任务DTO") |
| | | public class SaveErrorTaskDto { |
| | | @ApiModelProperty(value = "车辆ids") |
| | | private List<Long> vehicleIds; |
| | | @ApiModelProperty(value = "任务类型id 对应数据字典,多个逗号分割") |
| | | private String taskTypeId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "任务描述") |
| | | private String taskDescription; |
| | | @ApiModelProperty(value = "任务图片") |
| | | private String taskImage; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "车辆位置") |
| | | private String vehicleLocation; |
| | | @ApiModelProperty(value = "车辆经度") |
| | | private BigDecimal vehicleLon; |
| | | @ApiModelProperty(value = "车辆纬度") |
| | | private BigDecimal vehicleLat; |
| | | } |
| | |
| | | @ApiModelProperty(value = "发车状态 1=发车 3=收车") |
| | | private Integer departureStatus; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.maintenance.XpTask; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.WorkBenchQuery; |
| | | import com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO; |
| | | import com.xiaopeng.maintenance.model.vo.WorkBenchVO; |
| | | import com.xiaopeng.maintenance.model.query.TaskPageListQuery; |
| | | import com.xiaopeng.maintenance.model.vo.TaskPageListVO; |
| | |
| | | List<WorkBenchVO> workbench(@Param("pageInfo") PageInfo<WorkBenchVO> pageInfo, @Param("query")WorkBenchQuery query); |
| | | |
| | | List<TaskPageListVO> pageList(@Param("pageInfo")PageInfo<TaskPageListVO> pageInfo, @Param("query")TaskPageListQuery query); |
| | | |
| | | List<TaskManagementPageListVO> pageListManagement(@Param("pageInfo")PageInfo<TaskManagementPageListVO> pageInfo,@Param("query") TaskManagementPageListQuery query); |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.query; |
| | | |
| | | import com.xiaopeng.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台任务工单列表查询query") |
| | | public class TaskManagementPageListQuery extends BasePage { |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "任务类别1常规 2事故") |
| | | private Integer taskCategory; |
| | | @ApiModelProperty(value = "常规任务类型枚举1车辆检查 2车辆充电 3车辆整备 4整备洗车 5车辆维修 6车辆保养 7车辆保险到期 8车辆年检到期 9车辆运营资质到期") |
| | | private Integer taskGeneralId; |
| | | @ApiModelProperty(value = "事故任务类型id") |
| | | private Long taskErrorId; |
| | | @ApiModelProperty(value = "任务优先级 0=P0 1=P1 2=P2 3=P3 不传为全部") |
| | | private Integer taskUrgencyLevel; |
| | | |
| | | @ApiModelProperty(value = "状态0=待到达 1=待处理 2=已完成 3=已取消") |
| | | private Integer status; |
| | | @ApiModelProperty(value = " 开始时间 yyyy-MM-dd HH:mm:ss") |
| | | private String startTime; |
| | | @ApiModelProperty(value = " 结束时间 yyyy-MM-dd HH:mm:ss") |
| | | private String endTime; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xiaopeng.api.model.maintenance.XpErrorType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 任务事故详情 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台任务事故详情VO") |
| | | public class TaskManagementAccidentDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "状态 0=待到达 1=待处理 2=已完成 3=已取消") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务类型名称 任务类别为2时返回") |
| | | private List<XpErrorType> errorTypeList; |
| | | @ApiModelProperty(value = "任务描述") |
| | | private String taskDescription; |
| | | @ApiModelProperty(value = "任务描述图片") |
| | | private String taskImage; |
| | | |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆图片") |
| | | private String vehiclePictures; |
| | | @ApiModelProperty(value = "上报地址") |
| | | private String vehicleLocation; |
| | | |
| | | @ApiModelProperty(value = "上报人id") |
| | | private Long reportUserId; |
| | | @ApiModelProperty(value = "上报人名称") |
| | | private String reportUserName; |
| | | @ApiModelProperty(value = "上报人电话") |
| | | private String reportUserPhone; |
| | | @ApiModelProperty(value = "上报人头像") |
| | | private String reportUserAvatar; |
| | | |
| | | @ApiModelProperty(value = "处理id") |
| | | private Long handleUserId; |
| | | @ApiModelProperty(value = "处理名称") |
| | | private String handleUserName; |
| | | @ApiModelProperty(value = "处理电话") |
| | | private String handleUserPhone; |
| | | @ApiModelProperty(value = "处理头像") |
| | | private String handleUserAvatar; |
| | | |
| | | @ApiModelProperty(value = "死亡人数") |
| | | private Integer deathCount; |
| | | |
| | | @ApiModelProperty(value = "重伤人数") |
| | | private Integer severeCount; |
| | | |
| | | @ApiModelProperty(value = "轻伤人数") |
| | | private Integer minorCount; |
| | | |
| | | @ApiModelProperty(value = "责任判断 1我方主责 2我方无责 3双方同责") |
| | | private Integer responsibilityJudgment; |
| | | |
| | | @ApiModelProperty(value = "交警判责现场情况") |
| | | private String responsibleDescription; |
| | | |
| | | @ApiModelProperty(value = "交警判责现场照片") |
| | | private String responsibleImage; |
| | | |
| | | @ApiModelProperty(value = "处置情况描述") |
| | | private String disposalDescription; |
| | | |
| | | @ApiModelProperty(value = "处置情况照片") |
| | | private String disposalImage; |
| | | |
| | | @ApiModelProperty(value = "现场情况描述") |
| | | private String situationDescription; |
| | | |
| | | @ApiModelProperty(value = "现场情况照片") |
| | | private String situationImage; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规充电任务详情VO") |
| | | public class TaskManagementChargingDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | @ApiModelProperty(value = "开始剩余电量") |
| | | private Integer startRemainingBattery; |
| | | @ApiModelProperty(value = "开始充电图片") |
| | | private String startChargingPicture; |
| | | @ApiModelProperty(value = "开始充电时间") |
| | | private LocalDateTime startTime; |
| | | @ApiModelProperty(value = "结束剩余电量") |
| | | private Integer endRemainingBattery; |
| | | @ApiModelProperty(value = "结束充电图片") |
| | | private String endChargingPicture; |
| | | @ApiModelProperty(value = "结束充电时间") |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty(value = "开始充电操作人") |
| | | private Long startOperationsUserId; |
| | | @ApiModelProperty(value = "开始充电操作人名称") |
| | | private String startOperationsUserName; |
| | | @ApiModelProperty(value = "结束充电操作人") |
| | | private Long endOperationsUserId; |
| | | @ApiModelProperty(value = "结束充电操作人名称") |
| | | private String endOperationsUserName; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规洗车任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规洗车任务详情VO") |
| | | public class TaskManagementCleanDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | |
| | | @ApiModelProperty(value = "完成情况图片") |
| | | private String taskImage; |
| | | @ApiModelProperty(value = "操作人id") |
| | | private Long operationUserId; |
| | | @ApiModelProperty(value = "操作人名称") |
| | | private String operationsUserName; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规检测任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台任务详情VO") |
| | | public class TaskManagementDetailVO implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "事故任务详情") |
| | | private TaskManagementAccidentDetailVO accidentDetailVO; |
| | | @ApiModelProperty(value = "充电任务详情") |
| | | private TaskManagementChargingDetailVO chargingDetailVO; |
| | | @ApiModelProperty(value = "检测任务详情") |
| | | private TaskManagementDetectionDetailVO detectionDetailVO; |
| | | @ApiModelProperty(value = "洗车任务详情") |
| | | private TaskManagementCleanDetailVO cleanDetailVO; |
| | | @ApiModelProperty(value = "整备任务详情") |
| | | private TaskManagementPreparationDetailVO preparationDetailVO; |
| | | @ApiModelProperty(value = "维修任务详情") |
| | | private TaskManagementRepairDetailVO repairDetailVO; |
| | | @ApiModelProperty(value = "保养、年检、保险、营运资质任务详情") |
| | | private TaskManagementRoutineDetailVO routineDetailVO; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规检测任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规检测任务详情VO") |
| | | public class TaskManagementDetectionDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "网络检测") |
| | | private Integer networkDetection; |
| | | |
| | | @ApiModelProperty(value = "版本核对") |
| | | private Integer versionVerification; |
| | | |
| | | @ApiModelProperty(value = "通讯自检") |
| | | private Integer communicationSelfCheck; |
| | | |
| | | @ApiModelProperty(value = "远程自检") |
| | | private Integer remoteSelfCheck; |
| | | |
| | | @ApiModelProperty(value = "防撞激活") |
| | | private Integer collisionPrevention; |
| | | |
| | | @ApiModelProperty(value = "传感器自检") |
| | | private Integer sensorSelfCheck; |
| | | |
| | | @ApiModelProperty(value = "传感器清洁") |
| | | private Integer sensorCleaning; |
| | | |
| | | @ApiModelProperty(value = "传感器清洁检测图") |
| | | private String sensorCleaningPicture; |
| | | |
| | | @ApiModelProperty(value = "交互屏") |
| | | private Integer interactiveScreen; |
| | | |
| | | @ApiModelProperty(value = "交互屏检测图") |
| | | private String interactiveScreenPicture; |
| | | |
| | | @ApiModelProperty(value = "求助按钮") |
| | | private Integer helpButton; |
| | | |
| | | @ApiModelProperty(value = "求助按钮图") |
| | | private String helpButtonPicture; |
| | | |
| | | @ApiModelProperty(value = "支付功能") |
| | | private Integer paymentFunction; |
| | | |
| | | @ApiModelProperty(value = "支付功能图") |
| | | private String paymentFunctionPicture; |
| | | |
| | | @ApiModelProperty(value = "系统检查") |
| | | private Integer systemCheck; |
| | | |
| | | @ApiModelProperty(value = "系统检查图") |
| | | private String systemCheckPicture; |
| | | |
| | | @ApiModelProperty(value = "检查人id") |
| | | private Long operationsUserId; |
| | | @ApiModelProperty(value = "检查人名称") |
| | | private String operationsUserName; |
| | | @ApiModelProperty(value = "检测时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime checkTime; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 任务中心分页列表VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台任务中心分页列表VO") |
| | | public class TaskManagementPageListVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "任务类别1常规 2事故") |
| | | private Integer taskCategory; |
| | | @ApiModelProperty(value = "任务类型id 任务类别为2时对应数据字典,多个逗号分割,为1的时候 枚举1车辆检查 2车辆充电 3车辆整备 4整备洗车 5车辆维修 6车辆保养 7车辆保险到期 8车辆年检到期 9车辆运营资质到期") |
| | | private String taskTypeId; |
| | | @ApiModelProperty(value = "任务类型名称 任务类别为2时返回") |
| | | private String taskTypeName; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "上报时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | @ApiModelProperty(value = "状态 0=待到达 1=待处理 2=已完成 3=已取消") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "处理人id") |
| | | private Integer handleUserId; |
| | | @ApiModelProperty(value = "处理人名称") |
| | | private String handleUserName; |
| | | @ApiModelProperty(value = "任务描述") |
| | | private String taskDescription; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规整备任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规整备任务详情VO") |
| | | public class TaskManagementPreparationDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | @ApiModelProperty(value = "左前轮") |
| | | private String leftFrontWheel; |
| | | @ApiModelProperty(value = "右前轮") |
| | | private String rightFrontWheel; |
| | | @ApiModelProperty(value = "左后轮") |
| | | private String leftRearWheel; |
| | | @ApiModelProperty(value = "右后轮") |
| | | private String rightRearWheel; |
| | | |
| | | @ApiModelProperty(value = "大灯") |
| | | private String headLight; |
| | | |
| | | @ApiModelProperty(value = "转向灯") |
| | | private String turnSignal; |
| | | |
| | | @ApiModelProperty(value = "刹车灯") |
| | | private String brakeLight; |
| | | |
| | | @ApiModelProperty(value = "雾灯") |
| | | private String fogLight; |
| | | |
| | | @ApiModelProperty(value = "车身标识") |
| | | private String bodyEmblem; |
| | | |
| | | @ApiModelProperty(value = "舱内清洁") |
| | | private String cabinCleaning; |
| | | |
| | | @ApiModelProperty(value = "遗失物品") |
| | | private String lostItems; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty(value = "操作人id") |
| | | private Long operationsUserId; |
| | | @ApiModelProperty(value = "操作人名称") |
| | | private String operationsUserName; |
| | | @ApiModelProperty(value = "操作时间") |
| | | private LocalDateTime operationsTime; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规维修任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规维修任务详情VO") |
| | | public class TaskManagementRepairDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Long vehicleId; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endTime; |
| | | |
| | | @ApiModelProperty(value = "维修原因") |
| | | private String repairReason; |
| | | |
| | | @ApiModelProperty(value = "维修前图片") |
| | | private String startRepairPicture; |
| | | |
| | | @ApiModelProperty(value = "维修费用") |
| | | private Double repairMoney; |
| | | |
| | | @ApiModelProperty(value = "维修费用明细") |
| | | private String repairMoneyDetail; |
| | | |
| | | @ApiModelProperty(value = "送修人") |
| | | private Long sendUserId; |
| | | @ApiModelProperty(value = "送修人名称") |
| | | private String sendUserName; |
| | | |
| | | @ApiModelProperty(value = "送修时间") |
| | | private LocalDateTime sendTime; |
| | | |
| | | @ApiModelProperty(value = "取回人") |
| | | private Long returnUserId; |
| | | @ApiModelProperty(value = "取回人名称") |
| | | private String returnUserName; |
| | | |
| | | @ApiModelProperty(value = "取回时间") |
| | | private LocalDateTime returnTime; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维APP 常规任务详情VO |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台常规任务保养、年检、保险、营运资质任务详情") |
| | | public class TaskManagementRoutineDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "任务id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "任务紧急程度 0=P0 1=P1 2=P2 3=P3") |
| | | private Integer taskUrgencyLevel; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String plateNumber; |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆编码") |
| | | private String vehicleCode; |
| | | @ApiModelProperty(value = "车辆Vin") |
| | | private String vehicleVin; |
| | | @ApiModelProperty(value = "车辆地址") |
| | | private String vehicleLocation; |
| | | @ApiModelProperty(value = "任务编号") |
| | | private String taskCode; |
| | | @ApiModelProperty(value = "完成任务情况描述") |
| | | private String taskDescription; |
| | | @ApiModelProperty(value = "完成图片") |
| | | private String taskImage; |
| | | @ApiModelProperty(value = "处理人id") |
| | | private Long handleUserId; |
| | | @ApiModelProperty(value = "处理人姓名") |
| | | private String handleUserName; |
| | | @ApiModelProperty(value = "处理时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime handleTime; |
| | | } |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | | import com.xiaopeng.maintenance.dto.SaveVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.WorkBenchQuery; |
| | | import com.xiaopeng.maintenance.model.query.XpTaskRecordPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.*; |
| | |
| | | |
| | | R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id); |
| | | |
| | | R confirmArrive(Integer id); |
| | | R confirmArrive(Long id); |
| | | |
| | | /** |
| | | * 通过车辆id查询任务事故分页列表 |
| | |
| | | * @param status |
| | | */ |
| | | void updateTaskStatus(Long taskId, Integer status); |
| | | |
| | | PageInfo<TaskManagementPageListVO> pageListManagement(TaskManagementPageListQuery query); |
| | | |
| | | R assigneeTask(Long id, Long handlerUserId,Long assigneeUserId); |
| | | |
| | | void saveTask(SaveErrorTaskDto dto, Long reportUserId); |
| | | |
| | | R<TaskManagementDetailVO> taskDetail(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.feignClient.account.SysUserClient; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.SysUser; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.*; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.maintenance.constant.I18nKeyConstant; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | | import com.xiaopeng.maintenance.dto.SaveVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.mapper.*; |
| | | import com.xiaopeng.maintenance.model.query.TaskManagementPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.TaskPageListQuery; |
| | | import com.xiaopeng.maintenance.model.query.WorkBenchQuery; |
| | | import com.xiaopeng.maintenance.model.query.XpTaskRecordPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.*; |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import com.xiaopeng.maintenance.utils.UUIDUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | private XpVehicleCleanMapper vehicleCleanMapper; |
| | | @Autowired |
| | | private XpOperationUserClient xpOperationUserClient; |
| | | @Autowired |
| | | private SysUserClient sysUserClient; |
| | | @Autowired |
| | | private XpTaskHandleDetailRoutineMapper xpTaskHandleDetailRoutineMapper; |
| | | |
| | |
| | | @Override |
| | | public void saveVehicleAccident(SaveVehicleAccidentDto dto, XpOperationsUser xpOperationsUser) { |
| | | XpTask xpTask = new XpTask(); |
| | | xpTask.setTaskCode("1"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | xpTask.setTaskCode(code); |
| | | xpTask.setTaskCategory(2); |
| | | xpTask.setTaskTypeId(dto.getTaskTypeId()); |
| | | xpTask.setTaskUrgencyLevel(dto.getTaskUrgencyLevel()); |
| | |
| | | @Override |
| | | public R<com.xiaopeng.maintenance.vo.TaskDetectionDetailVO> detectionDetail(Long id) { |
| | | com.xiaopeng.maintenance.vo.TaskDetectionDetailVO res = new com.xiaopeng.maintenance.vo.TaskDetectionDetailVO(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | XpTask task = this.getById(id); |
| | | if (task == null){ |
| | | throw new ServiceException( |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R confirmArrive(Integer id) { |
| | | public R confirmArrive(Long id) { |
| | | XpTask task = this.getById(id); |
| | | if (task!=null){ |
| | | task.setStatus(1); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TaskManagementPageListVO> pageListManagement(TaskManagementPageListQuery query) { |
| | | PageInfo<TaskManagementPageListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TaskManagementPageListVO> list = this.baseMapper.pageListManagement(pageInfo, query); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public R assigneeTask(Long id, Long handlerUserId,Long assigneeUserId) { |
| | | XpTask task = this.getById(id); |
| | | task.setAssigneeTime(LocalDateTime.now()); |
| | | task.setHandleUserId(handlerUserId); |
| | | task.setAssigneeUserId(assigneeUserId); |
| | | this.updateById(task); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public void saveTask(SaveErrorTaskDto dto, Long reportUserId) { |
| | | |
| | | XpTask task = new XpTask(); |
| | | BeanUtils.copyProperties(dto, task); |
| | | task.setReportTime(LocalDateTime.now()); |
| | | task.setStatus(0); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | task.setTaskCode(code); |
| | | // 查询规则 |
| | | XpTaskRule taskRule = xpTaskRuleMapper.selectOne(null); |
| | | if (taskRule != null){ |
| | | task.setEndTime(LocalDateTime.now().plusMinutes(taskRule.getProcessingTimeLimit())); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) { |
| | | TaskManagementDetailVO managementDetailVO = new TaskManagementDetailVO(); |
| | | XpTask task = this.getById(id); |
| | | if (task == null){ |
| | | throw new ServiceException( |
| | | "任务不存在", |
| | | I18nKeyConstant.TASK_NOT_EXIST |
| | | ); |
| | | } |
| | | XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData(); |
| | | if (vehicle == null){ |
| | | throw new ServiceException( |
| | | "车辆不存在", |
| | | I18nKeyConstant.VEHICLE_NOT_EXIST |
| | | ); |
| | | } |
| | | |
| | | if (task.getTaskCategory()==1){ |
| | | // 常规任务 |
| | | |
| | | switch (task.getTaskTypeId()){ |
| | | case "1": |
| | | // 检测 |
| | | TaskManagementDetectionDetailVO taskManagementDetectionDetailVO = new TaskManagementDetectionDetailVO(); |
| | | taskManagementDetectionDetailVO.setId(task.getId()); |
| | | taskManagementDetectionDetailVO.setVehicleId(vehicle.getId()); |
| | | taskManagementDetectionDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | taskManagementDetectionDetailVO.setPlateNumber(vehicle.getPlateNumber()); |
| | | taskManagementDetectionDetailVO.setVehicleColor(vehicle.getVehicleColor()); |
| | | taskManagementDetectionDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementDetectionDetailVO.setTaskCode(task.getTaskCode()); |
| | | // taskManagementDetectionDetailVO.setNetworkDetection(); |
| | | // taskManagementDetectionDetailVO.setVersionVerification(); |
| | | // taskManagementDetectionDetailVO.setCommunicationSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setRemoteSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setCollisionPrevention(); |
| | | // taskManagementDetectionDetailVO.setSensorSelfCheck(); |
| | | // taskManagementDetectionDetailVO.setSensorCleaning(); |
| | | // taskManagementDetectionDetailVO.setSensorCleaningPicture(); |
| | | // taskManagementDetectionDetailVO.setInteractiveScreen(); |
| | | // taskManagementDetectionDetailVO.setInteractiveScreenPicture(); |
| | | // taskManagementDetectionDetailVO.setHelpButton(); |
| | | // taskManagementDetectionDetailVO.setHelpButtonPicture(); |
| | | // taskManagementDetectionDetailVO.setPaymentFunction(); |
| | | // taskManagementDetectionDetailVO.setPaymentFunctionPicture(); |
| | | // taskManagementDetectionDetailVO.setSystemCheck(); |
| | | // taskManagementDetectionDetailVO.setSystemCheckPicture(); |
| | | // taskManagementDetectionDetailVO.setOperationsUserId(); |
| | | // taskManagementDetectionDetailVO.setOperationsUserName(); |
| | | // taskManagementDetectionDetailVO.setCheckTime(); |
| | | |
| | | break; |
| | | case "2": |
| | | // 充电 |
| | | TaskManagementChargingDetailVO taskManagementChargingDetailVO = new TaskManagementChargingDetailVO(); |
| | | break; |
| | | case "3": |
| | | // 整备 |
| | | TaskManagementPreparationDetailVO taskManagementPreparationDetailVO = new TaskManagementPreparationDetailVO(); |
| | | break; |
| | | case "4": |
| | | // 洗车 |
| | | TaskManagementCleanDetailVO taskManagementCleanDetailVO = new TaskManagementCleanDetailVO(); |
| | | break; |
| | | case "5": |
| | | // 维修 |
| | | TaskManagementRepairDetailVO taskManagementRepairDetailVO = new TaskManagementRepairDetailVO(); |
| | | break; |
| | | default: |
| | | // 保养、年检、保险、营运资质 |
| | | TaskManagementRoutineDetailVO res = new TaskManagementRoutineDetailVO(); |
| | | res.setId(task.getId()); |
| | | res.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | res.setPlateNumber(vehicle.getPlateNumber()); |
| | | res.setVehicleColor(vehicle.getVehicleColor()); |
| | | res.setVehicleCode(vehicle.getVehicleCode()); |
| | | res.setVehicleLocation(task.getVehicleLocation()); |
| | | res.setVehicleVin(vehicle.getVehicleVin()); |
| | | res.setTaskCode(task.getTaskCode()); |
| | | XpTaskHandleDetailRoutine xpTaskHandleDetailRoutine = xpTaskHandleDetailRoutineMapper.selectOne(new LambdaQueryWrapper<XpTaskHandleDetailRoutine>() |
| | | .eq(XpTaskHandleDetailRoutine::getTaskId, id)); |
| | | if (xpTaskHandleDetailRoutine!=null){ |
| | | res.setTaskDescription(xpTaskHandleDetailRoutine.getTaskDescription()); |
| | | res.setTaskImage(xpTaskHandleDetailRoutine.getTaskImage()); |
| | | res.setHandleUserId(task.getHandleUserId()); |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(xpTaskHandleDetailRoutine.getOperationsUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | res.setHandleUserId(operationsUser.getId()); |
| | | res.setHandleUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | |
| | | res.setHandleTime(task.getHandleTime()); |
| | | res.setId(id); |
| | | res.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | res.setPlateNumber(vehicle.getPlateNumber()); |
| | | res.setVehicleColor(vehicle.getVehicleColor()); |
| | | res.setVehicleCode(vehicle.getVehicleCode()); |
| | | res.setVehicleLocation(task.getVehicleLocation()); |
| | | res.setVehicleVin(vehicle.getVehicleVin()); |
| | | break; |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | // 事故任务 |
| | | TaskManagementAccidentDetailVO res = new TaskManagementAccidentDetailVO(); |
| | | |
| | | Map<Long, List<XpErrorType>> errorType = errorTypeMapper.selectList(new LambdaQueryWrapper<XpErrorType>() |
| | | .in(XpErrorType::getId, Arrays.asList(task.getTaskTypeId().split(",")))) |
| | | .stream().collect(Collectors.groupingBy(XpErrorType::getParentId)); |
| | | List<XpErrorType> xpErrorTypes = errorType.get(0L); |
| | | for (XpErrorType xpErrorType : xpErrorTypes) { |
| | | xpErrorType.setChild(errorType.get(xpErrorType.getId())); |
| | | } |
| | | res.setErrorTypeList(xpErrorTypes); |
| | | res.setStatus(task.getStatus()); |
| | | res.setTaskDescription(task.getTaskDescription()); |
| | | res.setTaskImage(task.getTaskImage()); |
| | | res.setId(id); |
| | | res.setVehicleId(vehicle.getId()); |
| | | res.setTaskUrgencyLevel(task.getTaskUrgencyLevel()); |
| | | res.setPlateNumber(vehicle.getPlateNumber()); |
| | | res.setVehicleColor(vehicle.getVehicleColor()); |
| | | res.setVehicleCode(vehicle.getVehicleCode()); |
| | | res.setVehicleLocation(task.getVehicleLocation()); |
| | | res.setVehicleVin(vehicle.getVehicleVin()); |
| | | List<Long> reportUserIds = new ArrayList<>(); |
| | | reportUserIds.add(task.getReportUserId()); |
| | | List<SysUser> sysUsers = sysUserClient.listByIds(reportUserIds).getData(); |
| | | if (sysUsers!=null && !sysUsers.isEmpty()){ |
| | | SysUser sysUser = sysUsers.get(0); |
| | | res.setReportUserId(sysUser.getId()); |
| | | res.setReportUserName(sysUser.getNickName()); |
| | | res.setReportUserPhone(sysUser.getPhoneNumber()); |
| | | res.setReportUserAvatar(sysUser.getAvatar()); |
| | | } |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(task.getHandleUserId()).getData(); |
| | | if (operationsUser != null){ |
| | | res.setHandleUserId(operationsUser.getId()); |
| | | res.setHandleUserName(operationsUser.getNickName()); |
| | | res.setHandleUserPhone(operationsUser.getPhoneNumber()); |
| | | res.setHandleUserAvatar(operationsUser.getAvatar()); |
| | | } |
| | | XpTaskHandleDetail xpTaskHandleDetail = xpTaskHandleDetailMapper.selectOne(new LambdaQueryWrapper<XpTaskHandleDetail>() |
| | | .eq(XpTaskHandleDetail::getTaskId, id)); |
| | | res.setDeathCount(xpTaskHandleDetail.getDeathCount()); |
| | | res.setSevereCount(xpTaskHandleDetail.getSevereCount()); |
| | | res.setMinorCount(xpTaskHandleDetail.getMinorCount()); |
| | | res.setResponsibilityJudgment(xpTaskHandleDetail.getResponsibilityJudgment()); |
| | | res.setResponsibleDescription(xpTaskHandleDetail.getResponsibleDescription()); |
| | | res.setResponsibleImage(xpTaskHandleDetail.getResponsibleImage()); |
| | | res.setDisposalDescription(xpTaskHandleDetail.getDisposalDescription()); |
| | | res.setDisposalImage(xpTaskHandleDetail.getDisposalImage()); |
| | | res.setSituationDescription(xpTaskHandleDetail.getSituationDescription()); |
| | | res.setSituationImage(xpTaskHandleDetail.getSituationImage()); |
| | | managementDetailVO.setAccidentDetailVO(res); |
| | | } |
| | | return R.ok(managementDetailVO); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.maintenance.utils; |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 定义生成随机码的工具类 |
| | | */ |
| | | public class UUIDUtil { |
| | | |
| | | private int i = 1; |
| | | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode() { |
| | | return UUIDUtil.getNativeUUID().replaceAll("-", ""); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getRandomCode(Integer num) throws Exception { |
| | | String str = null; |
| | | if (0 < num) { |
| | | if (num % 32 > 0) { |
| | | Integer s = num / 32; |
| | | Integer l = num % 32; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < s; i++) { |
| | | sb.append(UUIDUtil.getRandomCode()); |
| | | } |
| | | sb.append(UUIDUtil.getRandomCode().substring(0, l)); |
| | | str = sb.toString(); |
| | | } else if (num % 32 == 0) { |
| | | Integer s = num / 32; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < s; i++) { |
| | | sb.append(UUIDUtil.getRandomCode()); |
| | | } |
| | | str = sb.toString(); |
| | | } else { |
| | | str = UUIDUtil.getRandomCode().substring(0, num); |
| | | } |
| | | } else { |
| | | throw new Exception("参数只能大于0"); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr() { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmssS"); |
| | | return simpleDateFormat.format(new Date()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description: 获取数字随机码 |
| | | * @Author pzb |
| | | * @Date 2021/8/11 16:52 |
| | | * @Param |
| | | * @Return |
| | | * @Exception |
| | | */ |
| | | public static String getNumberRandom(Integer num) { |
| | | if (null == num) { |
| | | num = 32; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < num; i++) { |
| | | sb.append(Double.valueOf(Math.random() * 10).intValue()); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.maintenance.XpTask"> |
| | | <id column="id" property="id" /> |
| | | <result column="task_code" property="taskCode" /> |
| | | <result column="task_category" property="taskCategory" /> |
| | | <result column="task_type_id" property="taskTypeId" /> |
| | | <result column="task_urgency_level" property="taskUrgencyLevel" /> |
| | | <result column="task_description" property="taskDescription" /> |
| | | <result column="vehicle_location" property="vehicleLocation" /> |
| | | <result column="vehicle_id" property="vehicleId" /> |
| | | <result column="vehicle_lon" property="vehicleLon" /> |
| | | <result column="vehicle_lat" property="vehicleLat" /> |
| | | <result column="handle_user_id" property="handleUserId" /> |
| | | <result column="handle_time" property="handleTime" /> |
| | | <result column="assignee_user_id" property="assigneeUserId" /> |
| | | <result column="assignee_time" property="assigneeTime" /> |
| | | <result column="report_user_id" property="reportUserId" /> |
| | | <result column="report_time" property="reportTime" /> |
| | | <result column="status" property="status" /> |
| | | <result column="is_deleted" property="deleted" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <id column="id" property="id"/> |
| | | <result column="task_code" property="taskCode"/> |
| | | <result column="task_category" property="taskCategory"/> |
| | | <result column="task_type_id" property="taskTypeId"/> |
| | | <result column="task_urgency_level" property="taskUrgencyLevel"/> |
| | | <result column="task_description" property="taskDescription"/> |
| | | <result column="vehicle_location" property="vehicleLocation"/> |
| | | <result column="vehicle_id" property="vehicleId"/> |
| | | <result column="vehicle_lon" property="vehicleLon"/> |
| | | <result column="vehicle_lat" property="vehicleLat"/> |
| | | <result column="handle_user_id" property="handleUserId"/> |
| | | <result column="handle_time" property="handleTime"/> |
| | | <result column="assignee_user_id" property="assigneeUserId"/> |
| | | <result column="assignee_time" property="assigneeTime"/> |
| | | <result column="report_user_id" property="reportUserId"/> |
| | | <result column="report_time" property="reportTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="deleted"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, task_code, task_category,end_time, task_type_id,task_image, task_urgency_level, task_description, vehicle_location, vehicle_id, vehicle_lon, vehicle_lat, handle_user_id, handle_time, assignee_user_id, assignee_time, report_user_id, report_time, status, is_deleted, create_time, update_time, create_by, update_by |
| | | id |
| | | , task_code, task_category,end_time, task_type_id,task_image, task_urgency_level, task_description, vehicle_location, vehicle_id, vehicle_lon, vehicle_lat, handle_user_id, handle_time, assignee_user_id, assignee_time, report_user_id, report_time, status, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | <select id="workbench" resultType="com.xiaopeng.maintenance.model.vo.WorkBenchVO"> |
| | | select t1.*,t2.vehicle_vin as vehicleVin,t2.plate_number as plateNumber, |
| | | t2.vehicle_color as vehicleColor,t2.vehicle_pictures as vehiclePictures |
| | | select t1.*, |
| | | t2.vehicle_vin as vehicleVin, |
| | | t2.plate_number as plateNumber, |
| | | t2.vehicle_color as vehicleColor, |
| | | t2.vehicle_pictures as vehiclePictures |
| | | from xp_task t1 |
| | | left join xp_vehicle t2 on t1.vehicle_id = t2.id |
| | | left join xp_vehicle t2 on t1.vehicle_id = t2.id |
| | | where t1.handle_user_id = #{query.operationId} |
| | | and t1.status = 1 |
| | | and t1.is_deleted = 0 |
| | | and t1.status = 1 |
| | | and t1.is_deleted = 0 |
| | | order by t1.assignee_time asc |
| | | </select> |
| | | <select id="pageList" resultType="com.xiaopeng.maintenance.model.vo.TaskPageListVO"> |
| | | select t1.id,t1.task_code as taskCode,t1.end_time as endTime,t1.task_category as taskCategory,t1.task_type_id as taskTypeId,t1.task_urgency_level as taskUrgencyLevel,t1.task_description as taskDescription,t1.vehicle_location as vehicleLocation,t1.vehicle_id as vehicleId,t1.vehicle_lon as vehicleLon,t1.vehicle_lat as vehicleLat,t1.handle_user_id as handleUserId,t1.handle_time as handleTime,t1.assignee_user_id as assigneeUserId |
| | | ,t1.assignee_time as assigneeTime,t1.task_image as taskImage,t1.report_user_id as reportUserId,t1.report_time as reportTime,t1.status as status,t1.is_deleted as isDeleted,t1.create_time as createTime,t1.update_time as updateTime,t1.create_by as createBy,t1.update_by as updateBy,t2.plate_number as plateNumber |
| | | select t1.id,t1.task_code as taskCode,t1.end_time as endTime,t1.task_category as taskCategory,t1.task_type_id as |
| | | taskTypeId,t1.task_urgency_level as taskUrgencyLevel,t1.task_description as taskDescription,t1.vehicle_location |
| | | as vehicleLocation,t1.vehicle_id as vehicleId,t1.vehicle_lon as vehicleLon,t1.vehicle_lat as |
| | | vehicleLat,t1.handle_user_id as handleUserId,t1.handle_time as handleTime,t1.assignee_user_id as assigneeUserId |
| | | ,t1.assignee_time as assigneeTime,t1.task_image as taskImage,t1.report_user_id as reportUserId,t1.report_time as |
| | | reportTime,t1.status as status,t1.is_deleted as isDeleted,t1.create_time as createTime,t1.update_time as |
| | | updateTime,t1.create_by as createBy,t1.update_by as updateBy,t2.plate_number as plateNumber |
| | | from xp_task t1 |
| | | left join xp_vehicle t2 on t1.vehicle_id = t2.id |
| | | where t1.is_deleted = 0 |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="pageListManagement" resultType="com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO"> |
| | | select t.id,t.task_category as taskCategory,t.task_type_id as taskTypeId,t.task_urgency_level as |
| | | taskUrgencyLevel,t.task_description as taskDescription,t.handle_user_id as handleUserId,t.create_time as |
| | | createTime,t.status as status, |
| | | v.plate_number as plateNumber |
| | | from xp_task t |
| | | left join xp_vehicle v on t.vehicle_id = v.id |
| | | where t.is_deleted = 0 |
| | | <if test="query.taskCategory != null"> |
| | | and t.task_category = #{query.taskCategory} |
| | | </if> |
| | | <if test="query.taskUrgencyLevel != null"> |
| | | and t.task_urgency_level = #{query.taskUrgencyLevel} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and t.status = #{query.status} |
| | | </if> |
| | | <if test="query.plateNumber != null and query.plateNumber != ''"> |
| | | and v.plate_number like concat('%',#{query.plateNumber},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | and t.create_time between #{query.startTime} and #{query.endTime} |
| | | </if> |
| | | <if test="query.taskGeneralId != null"> |
| | | and t.task_type_id = #{query.taskGeneralId} |
| | | </if> |
| | | <if test="query.taskErrorId != null"> |
| | | and find_in_set(#{query.taskErrorId}, t.task_type_id) |
| | | and t.task_category = 2 |
| | | </if> |
| | | order by t.status,t.task_urgency_level asc, t.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-maintenance-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-map-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.apiguardian.api.API; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | public class XpAgreementController extends BaseController { |
| | | |
| | |
| | | public R<XpAgreementVo> getAppContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getContentByType(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取协议",tags = {"管理后台-内容中心"}) |
| | | @GetMapping("/api/v1/agreement/content/{type}") |
| | | public R<XpAgreement> getAgreementContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getAgreementContent(type)); |
| | | } |
| | | @ApiOperation(value = "保存协议",tags = {"管理后台-内容中心"}) |
| | | @PostMapping("/api/v1/agreement/save") |
| | | public R<?> saveAgreement(@RequestBody @Valid XpAgreementDTO dto){ |
| | | xpAgreementService.saveAgreement(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | public R<Boolean> getPrivacyAgreement(HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | long count = xpAgreementAppUserService.count(new LambdaQueryWrapper<XpAgreementAppUser>().eq(XpAgreementAppUser::getAppUserId, uid)); |
| | | long count = xpAgreementAppUserService.count(new LambdaQueryWrapper<XpAgreementAppUser>().eq(XpAgreementAppUser::getAppUserId, Long.valueOf(uid))); |
| | | if (count > 0) { |
| | | return R.ok(true); |
| | | } |
| | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "常见问题") |
| | | public class XpFrequentlyAskedQuestionsController { |
| | | |
| | | private final IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService; |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/frequently-asked-questions/getList") |
| | | @GetMapping("/base/v1/mini-program/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"常见问题列表"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getList() { |
| | | XpSystemSetting systemSetting = xpSystemSettingService.getOne(null); |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(new LambdaQueryWrapper<XpFrequentlyAskedQuestions>().last("limit "+systemSetting.getHeadShowCount())); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"管理后台-内容中心"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getQuestionList() { |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存常见问题") |
| | | @PostMapping("/api/v1/frequently-asked-questions/save") |
| | | public R<?> saveQuestion(@RequestBody XpFrequentlyAskedQuestionsDTO dto) { |
| | | xpFrequentlyAskedQuestionsService.saveQuestion(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除常见问题") |
| | | @DeleteMapping("/api/v1/frequently-asked-questions/delete/{id}") |
| | | public R<?> deleteQuestion(@PathVariable Long id) { |
| | | xpFrequentlyAskedQuestionsService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.xiaopeng.api.dto.operation.PointAddDto; |
| | | import com.xiaopeng.api.dto.operation.PointUpdateDto; |
| | | import com.xiaopeng.api.dto.operation.XpPointEnableDisableDto; |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.api.query.operation.PointPageListQuery; |
| | | import com.xiaopeng.operation.dto.XpPointSpecialDto; |
| | | import com.xiaopeng.operation.service.IXpElectronicFenceAreaService; |
| | | import com.xiaopeng.operation.service.IXpElectronicFenceService; |
| | | import com.xiaopeng.operation.service.XpPointService; |
| | |
| | | xpPointService.updateById(xpPoint); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置特殊点位 |
| | | */ |
| | | @PostMapping("/setSpecialPoint") |
| | | @ApiOperation(value = "设置特殊点位") |
| | | public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().set(XpPoint::getChargePoint, 0).set(XpPoint::getParkingPoint,0)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getChargePoints()).set(XpPoint::getChargePoint,1)); |
| | | xpPointService.update(new LambdaUpdateWrapper<XpPoint>().in(XpPoint::getId,dto.getParkingPoints()).set(XpPoint::getParkingPoint,2)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.operation.dto.PricingSetRuleDTO; |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.service.IXpGeoQueryEntityService; |
| | | import com.xiaopeng.operation.service.IXpWhitelistService; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.operation.service.*; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | import com.xiaopeng.operation.vo.SaveOrderVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | |
| | | private final IXpGeoQueryEntityService xpGeoQueryEntityService; |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final IXpWhitelistService xpWhitelistService; |
| | | private final XpOpenCityService xpOpenCityService; |
| | | |
| | | |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService) { |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService, XpRegionService xpRegionService, XpOpenCityService xpOpenCityService) { |
| | | this.xpPricingService = xpPricingService; |
| | | this.xpGeoQueryEntityService = xpGeoQueryEntityService; |
| | | this.userResourcesClient = userResourcesClient; |
| | | this.xpWhitelistService = xpWhitelistService; |
| | | this.xpOpenCityService = xpOpenCityService; |
| | | } |
| | | |
| | | |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | //获取城市信息 |
| | | String cityName = xpOpenCityService.getNameWithCityName(pricing.getCityId()); |
| | | pricing.setCityName(cityName); |
| | | return R.ok(pricing); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("") |
| | | @Api(tags = "系统设置模块") |
| | | public class XpSystemSettingController extends BaseController { |
| | | |
| | | // 系统设置实现类 |
| | |
| | | return R.ok(new CustomerServicePhoneVo(xpSystemSettingService.getCustomerServicePhone())); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "获取系统配置、热修复", tags = {"管理后台-系统"}) |
| | | @GetMapping("/api/v1/systemSetting") |
| | | public R<XpSystemSetting> getSystemSetting(){ |
| | | return R.ok(xpSystemSettingService.lambdaQuery().last("limit 1").one()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "基础价格json配置", required = true, notes = "{\n" + |
| | | " \"num3\": \"起步价数值1\",\n" + |
| | | " \"num4\": \"起步价数值2\",\n" + |
| | | " \"num5\": \"起步价数值3\",\n" + |
| | | " \"num6\": \"起步价数值4\",\n" + |
| | |
| | | " \"num7\": \"起步价数值5\"\n" + |
| | | " }\n" + |
| | | "]") |
| | | @NotBlank(message = "起步价json配置不能为空") |
| | | private String startingFareJson; |
| | | |
| | | @ApiModelProperty(value = "动态价格json配置", required = true, notes = " {\n" + |
| | |
| | | " }") |
| | | @NotBlank(message = "动态价格json配置不能为空") |
| | | private String dynamicPricingJson; |
| | | |
| | | @ApiModelProperty(value = "是否动态价格 0否 1是") |
| | | private Integer isDynamicPrice; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 14:41 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel("协议数据传输对象") |
| | | public class XpAgreementDTO { |
| | | @NotNull(message = "协议类型不能为空") |
| | | @ApiModelProperty(value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明") |
| | | private Integer contentType; |
| | | |
| | | @NotBlank(message = "协议内容不能为空") |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 15:12 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "常见问题数据传输对象") |
| | | public class XpFrequentlyAskedQuestionsDTO { |
| | | @ApiModelProperty(value = "常见问题列表") |
| | | private List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "XpPointSpecialDto",description = "特殊点位") |
| | | public class XpPointSpecialDto { |
| | | |
| | | // 充电点位 |
| | | @ApiModelProperty(value = "充电点位") |
| | | private List<Long> chargePoints; |
| | | |
| | | |
| | | // 收车点位 |
| | | @ApiModelProperty(value = "收车点位") |
| | | private List<Long> parkingPoints; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpFrequentlyAskedQuestionsService extends IService<XpFrequentlyAskedQuestions> { |
| | | |
| | | void saveQuestion(XpFrequentlyAskedQuestionsDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<XpAgreementVo> getContentByTypeAll(); |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | XpAgreement getAgreementContent(Integer type); |
| | | |
| | | |
| | | /** |
| | | * 保存协议 |
| | | * @param dto |
| | | */ |
| | | void saveAgreement(@Valid XpAgreementDTO dto); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | void upDown(Long id, Integer status); |
| | | |
| | | /** |
| | | * 获取开通城市名称,如果开通城市层级是区级,则返回市级名称>区名称 |
| | | * @param cityId |
| | | * @return |
| | | */ |
| | | String getNameWithCityName(Integer cityId); |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.mapper.XpAgreementMapper; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return xpAgreementVos; |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public XpAgreement getAgreementContent(Integer type) { |
| | | return this.lambdaQuery().eq(XpAgreement::getContentType, type).last("limit 1").one(); |
| | | } |
| | | |
| | | @Override |
| | | public void saveAgreement(XpAgreementDTO dto) { |
| | | //根据类型查询协议 |
| | | Optional<XpAgreement> opt = this.lambdaQuery().eq(XpAgreement::getContentType, dto.getContentType()).last("limit 1").oneOpt(); |
| | | |
| | | //如果存在则更新,不存在则新增 |
| | | if (opt.isPresent()) { |
| | | XpAgreement xpAgreement = opt.get(); |
| | | xpAgreement.setContent(dto.getContent()); |
| | | updateById(xpAgreement); |
| | | } else { |
| | | XpAgreement xpAgreement = BeanUtil.copyProperties(dto, XpAgreement.class); |
| | | this.save(xpAgreement); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.mapper.XpFrequentlyAskedQuestionsMapper; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class XpFrequentlyAskedQuestionsServiceImpl extends ServiceImpl<XpFrequentlyAskedQuestionsMapper, XpFrequentlyAskedQuestions> implements IXpFrequentlyAskedQuestionsService { |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void saveQuestion(XpFrequentlyAskedQuestionsDTO dto) { |
| | | List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList = dto.getFrequentlyAskedQuestionsList(); |
| | | saveOrUpdateBatch(frequentlyAskedQuestionsList); |
| | | } |
| | | } |
| | |
| | | public void upDown(Long id, Integer status) { |
| | | lambdaUpdate().eq(XpOpenCity::getId, id).set(XpOpenCity::getStatus, status).update(); |
| | | } |
| | | |
| | | @Override |
| | | public String getNameWithCityName(Integer cityId) { |
| | | String cityName = ""; |
| | | XpOpenCity openCity = getById(cityId); |
| | | if (Objects.nonNull(openCity)) { |
| | | if (StringUtils.isNotBlank(openCity.getDistrictCode())) { |
| | | cityName = openCity.getCityName() + ">" + openCity.getDistrictName(); |
| | | } else { |
| | | cityName = openCity.getCityName(); |
| | | } |
| | | } |
| | | return cityName; |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.DateUtils; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | |
| | | try { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | if (StringUtils.isNotBlank(dto.getBasicPricingJson())) { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getStartingFareJson())) { |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getDynamicPricingJson())) { |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ServiceException("价格配置JSON格式不正确", I18nKeyConstant.PRICING_JSON_INVALID); |
| | | } |
| | |
| | | XpPricing update = new XpPricing(); |
| | | update.setId(dto.getId()); |
| | | update.setBasicPricingJson(dto.getBasicPricingJson()); |
| | | update.setStartingFareJson(dto.getStartingFareJson()); |
| | | update.setStartingFareJson(StringUtils.isNotBlank(dto.getStartingFareJson()) ? dto.getStartingFareJson() : null); |
| | | update.setDynamicPricingJson(dto.getDynamicPricingJson()); |
| | | update.setIsDynamicPrice(dto.getIsDynamicPrice()); |
| | | this.updateById(update); |
| | | } |
| | | |
| | |
| | | import com.xiaopeng.api.dto.vehicleConvoy.BaseVehicleUserDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.map.XpMapClient; |
| | | import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; |
| | | import com.xiaopeng.api.feignClient.order.XpOrderClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.UserVehicleClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | |
| | | private IXpTradingStrategyService xpTradingStrategyService; |
| | | |
| | | @Autowired |
| | | private UserVehicleClient userVehicleClient; |
| | | private XpCruiseOrderClient xpCruiseOrderClient; |
| | | |
| | | @Autowired |
| | | private XpVehicleClient xpVehicleClient; |
| | |
| | | lock.unlock(); |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 TODO |
| | | |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehiclePosition.getVehicleVin()); |
| | | |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setOrderId(xpOrder.getId()); |
| | | pushOrderDto.setOrderId(xpOrder.getId().toString()); |
| | | pushOrderDto.setVin(vehiclePosition.getVehicleVin()); |
| | | |
| | | |
| | |
| | | lock.unlock(); |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 TODO |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | |
| | | |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setOrderId(xpOrder.getId()); |
| | | pushOrderDto.setOrderId(xpOrder.getId().toString()); |
| | | pushOrderDto.setVin(vehiclePosition.getVin()); |
| | | |
| | | // 调用推送服务 orderId + carVin |
| | |
| | | lock.unlock(); |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 TODO |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setOrderId(data.getId()); |
| | | pushOrderDto.setOrderId(data.getId().toString()); |
| | | pushOrderDto.setVin(vehiclePosition.getVin()); |
| | | // 调用推送服务 orderId + carVin |
| | | orderMissionClient.pushOrder(pushOrderDto); |
| | |
| | | public class PricingPageListVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | |
| | | --- |
| | | |
| | | #--- |
| | | #spring: |
| | | # shardingsphere: |
| | | # props: |
| | | # sql-show: true |
| | | # sql-simple: true |
| | | # datasource: |
| | | # names: xp0 |
| | | # xp0: |
| | | # type: com.alibaba.druid.pool.DruidDataSource |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # url: jdbc:mysql://192.168.110.34:3306/xprt_operation?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: 123456 |
| | | # rules: |
| | | # sharding: |
| | | # tables: |
| | | # sys_oper_log: |
| | | # actual-data-nodes: xp0.sys_oper_log |
| | | # database-strategy: |
| | | # standard: |
| | | # sharding-column: userId |
| | | # sharding-algorithm-name: sys-oper-log-inline |
| | | # key-generate-strategy: |
| | | # column: oper_id |
| | | # key-generator-name: snowflake |
| | | # xp_agreement_app_user: |
| | | # actual-data-nodes: xp0.xp_agreement_app_user |
| | | # database-strategy: |
| | | # standard: |
| | | # sharding-column: app_user_id |
| | | # sharding-algorithm-name: xp-agreement-app-user-inline |
| | | # key-generate-strategy: |
| | | # column: id |
| | | # key-generator-name: snowflake |
| | | # xp_point: |
| | | # actual-data-nodes: xp0.xp_point |
| | | # database-strategy: |
| | | # standard: |
| | | # sharding-column: id |
| | | # sharding-algorithm-name: xp-point-inline |
| | | # key-generate-strategy: |
| | | # column: id |
| | | # key-generator-name: snowflake |
| | | # sharding-algorithms: |
| | | # sys-oper-log-inline: |
| | | # type: INLINE |
| | | # props: |
| | | # algorithm-expression: sys_oper_log |
| | | # xp-agreement-app-user-inline: |
| | | # type: INLINE |
| | | # props: |
| | | # algorithm-expression: xp_agreement_app_user |
| | | # xp-point-inline: |
| | | # type: INLINE |
| | | # props: |
| | | # algorithm-expression: xp_point |
| | | # key-generators: |
| | | # snowflake: |
| | | # type: SNOWFLAKE |
| | | |
| | | # single-table: |
| | | # tables: |
| | | # - xp0.sys_config |
| | | # - xp0.sys_dict_data |
| | | # - xp0.sys_dict_type |
| | | # - xp0.sys_logininfor |
| | | # - xp0.sys_menu |
| | | # - xp0.xp_acticity |
| | | # - xp0.xp_acticity_coupon |
| | | # - xp0.xp_agreement |
| | | # - xp0.xp_banner |
| | | # - xp0.xp_coupon |
| | | # - xp0.xp_electronic_fence |
| | | # - xp0.xp_electronic_fence_area |
| | | # - xp0.xp_feedback_type |
| | | # - xp0.xp_frequently_asked_questions |
| | | # - xp0.xp_invitation_code |
| | | # - xp0.xp_notification |
| | | # - xp0.xp_open_city |
| | | # - xp0.xp_pricing |
| | | # - xp0.xp_pricing_item |
| | | # - xp0.xp_region |
| | | # - xp0.xp_ride_guide |
| | | # - xp0.xp_route_plan |
| | | # - xp0.xp_system_setting |
| | | # - xp0.xp_trading_strategy |
| | | # - xp0.xp_trading_strategy_city |
| | | # - xp0.xp_user_feedback |
| | | # - xp0.xp_whitelist |
| | | # - xp0.xp_whitelist_operlog |
| | |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.operation.vo.PricingPageListVO"> |
| | | SELECT |
| | | p.id, |
| | | p.create_time AS createTime, |
| | | p.vehicle_model AS vehicleModel, |
| | | CASE |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-operation-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | FROM registry.logan.xiaopeng.local/logancloud/logan-base:1.1.1-rc1-J1.8.0_372 |
| | | LABEL maintainer="Linzhaoming <linzm2@xiaopeng.com>" |
| | | |
| | | ENV JAVA_OPTS="-Xmx3072m -Xms1024m -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \ |
| | | ENV JAVA_OPTS="-Xmx1024m -Xms512m -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \ |
| | | -XX:+UseCMSInitiatingOccupancyOnly -XX:ReservedCodeCacheSize=128M -XX:ParallelGCThreads=2 \ |
| | | -XX:+ExplicitGCInvokesConcurrent -Duser.timezone=Asia/Shanghai" |
| | | |
| New file |
| | |
| | | package com.xiaopeng.order.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.order.service.IXpCruiseOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "巡游订单") |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class XpCruiseOrderController { |
| | | |
| | | private final IXpCruiseOrderService xpCruiseOrderService; |
| | | private final OrderMissionClient orderMissionClient; |
| | | |
| | | |
| | | /** |
| | | * 查询并终止订单信息 返回id信息 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/updateCruiseOrder") |
| | | public R<String> updateCruiseOrder(@RequestParam String vin) { |
| | | String id = xpCruiseOrderService.updateCruiseOrder(vin); |
| | | return R.ok(id); |
| | | } |
| | | /** |
| | | * 查询并完成订单信息 返回id信息 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/closeCruiseOrder") |
| | | public R<String> closeCruiseOrder(@RequestParam String vin) { |
| | | String id = xpCruiseOrderService.closeCruiseOrder(vin); |
| | | return R.ok(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询订单信息 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/getCruiseOrder") |
| | | public R<XpCruiseOrder> getCruiseOrder(@RequestParam String orderId){ |
| | | return R.ok(xpCruiseOrderService.getById(orderId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增订单 下发命令 |
| | | * |
| | | * @param |
| | | * @return 订单ID |
| | | */ |
| | | @PostMapping("/inner/cruiseOrder/addCruiseOrder") |
| | | public R<String> addCruiseOrder(@RequestBody XpCruiseOrder order) { |
| | | order.setId("XU"+ IdUtil.fastUUID()); |
| | | boolean save = xpCruiseOrderService.save(order); |
| | | if (!save) { |
| | | return R.fail("新增失败"); |
| | | } |
| | | |
| | | // 下发命令 |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setVin(order.getVehicleVin()); |
| | | pushOrderDto.setOrderId(order.getId()); |
| | | orderMissionClient.pushOrder(pushOrderDto); |
| | | |
| | | return R.ok(order.getId()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.dto.statistics.DailyCountDTO; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.order.model.query.XpHistoryOrderListQuery; |
| | | import com.xiaopeng.order.model.vo.XpOrderHistoryListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpCruiseOrderMapper extends BaseMapper<XpCruiseOrder> { |
| | | } |
| | |
| | | @TableField("start_point_id") |
| | | private Long startPointId; |
| | | |
| | | @ApiModelProperty(value = "起点停车时间限制") |
| | | private Integer startParkingTimeLimit; |
| | | |
| | | @ApiModelProperty(value = "下单终点站点Id") |
| | | @TableField("end_point_id") |
| | | private Long endPointId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "终点点停车时间限制") |
| | | private Integer endParkingTimeLimit; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "上车点") |
| | | private String boardingAddress; |
| | | |
| New file |
| | |
| | | package com.xiaopeng.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.model.order.XpCruiseOrder; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.order.FareBreakdownVo; |
| | | import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo; |
| | | import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; |
| | | import com.xiaopeng.api.vo.order.XpPointInfoVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.order.mangodb.model.OrderTrajectory; |
| | | import com.xiaopeng.order.model.dto.XpOrderCommentDto; |
| | | import com.xiaopeng.order.model.dto.XpOrderPayDto; |
| | | import com.xiaopeng.order.model.query.XpHistoryOrderListQuery; |
| | | import com.xiaopeng.order.model.query.XpOrderPageQuery; |
| | | import com.xiaopeng.order.model.vo.XpOrderDetailVO; |
| | | import com.xiaopeng.order.model.vo.XpOrderHistoryVO; |
| | | import com.xiaopeng.order.model.vo.XpOrderPageVO; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务类 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface IXpCruiseOrderService extends IService<XpCruiseOrder> { |
| | | |
| | | String updateCruiseOrder(String vin); |
| | | |
| | | |
| | | String closeCruiseOrder(String vin); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.order.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.ImmutableMap; |
| | | import com.xiaopeng.api.dto.account.GetUserCouponDto; |
| | | import com.xiaopeng.api.dto.account.UseUserCouponDto; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.HistoryEndPointsDto; |
| | | import com.xiaopeng.api.dto.order.HistoryStartPointsDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.pushMessage.SendMessageDTO; |
| | | import com.xiaopeng.api.dto.statistics.DailyCountDTO; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.dto.vehicleConvoy.BaseVehicleUserDto; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserClient; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpPointClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpPricingClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient; |
| | | import com.xiaopeng.api.feignClient.pushMessage.XpPushMessageClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.UserVehicleClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetVehicleClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.XpAppUser; |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.model.operation.XpGeoQueryEntity; |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.model.order.*; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.account.UserCouponVo; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType; |
| | | import com.xiaopeng.api.vo.order.*; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.AddTaxiPassengerVo; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo; |
| | | 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; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.DateUtils; |
| | | import com.xiaopeng.common.core.utils.GeodesyUtil; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.common.security.utils.SecurityUtils; |
| | | import com.xiaopeng.order.constant.I18nKeyConstant; |
| | | import com.xiaopeng.order.dto.MileageDto; |
| | | import com.xiaopeng.order.job.base.QuartzManager; |
| | | import com.xiaopeng.order.job.base.TimeJobType; |
| | | import com.xiaopeng.order.job.jobs.EndTripJob; |
| | | import com.xiaopeng.order.job.jobs.OrderCancelJob; |
| | | import com.xiaopeng.order.mangodb.model.OrderTrajectory; |
| | | import com.xiaopeng.order.mangodb.service.OrderTrajectoryService; |
| | | import com.xiaopeng.order.mapper.XpCruiseOrderMapper; |
| | | import com.xiaopeng.order.mapper.XpOrderDetailMapper; |
| | | import com.xiaopeng.order.mapper.XpOrderMapper; |
| | | import com.xiaopeng.order.model.dto.XpOrderCommentDto; |
| | | import com.xiaopeng.order.model.dto.XpOrderPayDto; |
| | | import com.xiaopeng.order.model.query.XpHistoryOrderListQuery; |
| | | import com.xiaopeng.order.model.query.XpOrderPageQuery; |
| | | import com.xiaopeng.order.model.vo.*; |
| | | import com.xiaopeng.order.service.*; |
| | | import com.xiaopeng.order.utils.TaxiPricingDemoService; |
| | | import com.xiaopeng.order.utils.TrajectoryGenerator; |
| | | import com.xiaopeng.order.utils.holiday.HolidayUtil; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class XpCruiseOrderServiceImpl extends ServiceImpl<XpCruiseOrderMapper, XpCruiseOrder> implements IXpCruiseOrderService { |
| | | |
| | | |
| | | /** |
| | | * 关闭当前巡游单子 |
| | | * @param vin |
| | | */ |
| | | @Override |
| | | public String updateCruiseOrder(String vin) { |
| | | LambdaQueryWrapper<XpCruiseOrder> wrapper = new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleVin, vin).eq(XpCruiseOrder::getStatus, 1); |
| | | XpCruiseOrder xpCruiseOrder = this.getOne(wrapper); |
| | | if (xpCruiseOrder != null) { |
| | | xpCruiseOrder.setStatus(2); |
| | | this.update(xpCruiseOrder, wrapper); |
| | | return xpCruiseOrder.getId(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String closeCruiseOrder(String vin) { |
| | | LambdaQueryWrapper<XpCruiseOrder> wrapper = new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleVin, vin).eq(XpCruiseOrder::getStatus, 1); |
| | | XpCruiseOrder xpCruiseOrder = this.getOne(wrapper); |
| | | if (xpCruiseOrder != null) { |
| | | xpCruiseOrder.setStatus(3); |
| | | this.update(xpCruiseOrder, wrapper); |
| | | return xpCruiseOrder.getId(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.order.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.xiaopeng.order.job.jobs.OrderCancelJob; |
| | | import com.xiaopeng.order.mangodb.model.OrderTrajectory; |
| | | import com.xiaopeng.order.mangodb.service.OrderTrajectoryService; |
| | | import com.xiaopeng.order.mapper.XpCruiseOrderMapper; |
| | | import com.xiaopeng.order.mapper.XpOrderDetailMapper; |
| | | import com.xiaopeng.order.mapper.XpOrderMapper; |
| | | import com.xiaopeng.order.model.dto.XpOrderCommentDto; |
| | |
| | | private final XpPushMessageClient xpPushMessageClient; |
| | | private final OrderMissionClient orderMissionClient; |
| | | private final XpOrderDetailMapper xpOrderDetailMapper; |
| | | private final XpCruiseOrderMapper xpCruiseOrderMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | |
| | | // 下发命令 |
| | | if(order.getStatus()>1){ |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setOrderId(order.getId()); |
| | | pushOrderDto.setOrderId(order.getId().toString()); |
| | | pushOrderDto.setVin(xpVehicle.getVehicleVin()); |
| | | pushOrderDto.setOperation_type(OrderOperationType.VEHICLE_CANCEL_ORDER); |
| | | orderMissionClient.cancelOrder(pushOrderDto); |
| | |
| | | // 下发命令 |
| | | if(order.getStatus()>1){ |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setOrderId(order.getId()); |
| | | pushOrderDto.setOrderId(order.getId().toString()); |
| | | pushOrderDto.setVin(xpVehicle.getVehicleVin()); |
| | | pushOrderDto.setOperation_type(OrderOperationType.CLOUD_CANCEL_ORDER); |
| | | orderMissionClient.cancelOrder(pushOrderDto); |
| | |
| | | // TODO 加配置文件取 |
| | | cancelTaxiPassengerVo.setAppId(""); |
| | | userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo); |
| | | |
| | | // 修改车辆接单状态 |
| | | vehicle.setState(0); |
| | | xpVehicleClient.updateVehicleById(vehicle); |
| | | } |
| | | |
| | | |
| | | |
| | | // 根据订单所属开通城市id 查询定价 |
| | | R<XpPricing> pricingByCityId = xpPricingClient.getPricingByCid(order.getCityId()); |
| | | XpPricing pricing = pricingByCityId.getData(); |
| | |
| | | useUserCouponDto.setUserCouponId(order.getCouponId()); |
| | | xpAppUserCouponClient.useUserCoupon(useUserCouponDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 结束后的车辆操作 |
| | | if(vehicle!=null){ |
| | | // 生成新的巡游单子 回到最新巡游的初始起点位置 |
| | | XpCruiseOrder xpCruiseOrders = xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 2).orderByDesc(BaseModel::getCreateTime).last("limit 1")); XpCruiseOrder xpCruiseOrder = new XpCruiseOrder(); |
| | | xpCruiseOrder.setVehicleId(vehicle.getId()); |
| | | xpCruiseOrder.setVehicleVin(vehicle.getVehicleVin()); |
| | | xpCruiseOrder.setOrderType(2); |
| | | // 返程起点是当前正常订单的终点 |
| | | xpCruiseOrder.setStartPointId(order.getEndPointId()); |
| | | xpCruiseOrder.setStartPointName(order.getEndPointName()); |
| | | xpCruiseOrder.setStartLon(order.getEndLon()); |
| | | xpCruiseOrder.setStartLat(order.getEndLat()); |
| | | |
| | | xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId()); |
| | | xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName()); |
| | | xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon()); |
| | | xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat()); |
| | | |
| | | xpCruiseOrder.setStatus(1); |
| | | xpCruiseOrder.setLastOrderId(xpCruiseOrders.getId()); |
| | | xpCruiseOrder.setCreateTime(LocalDateTime.now()); |
| | | xpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); |
| | | xpCruiseOrderMapper.insert(xpCruiseOrder); |
| | | |
| | | //下发命令 |
| | | orderMissionClient.pushOrder(new PushOrderDto(vehicle.getVehicleVin(),xpCruiseOrder.getId(),null)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | // TODO appid |
| | | addTaxiPassengerVo.setAppId(""); |
| | | |
| | | |
| | | // Redis弹出这个队列元素 |
| | | // value 订单Id_经纬度_状态_用户id_订单编号_距离_时间 |
| | | String popFirstElement = redisService.popFirstElement(order.getQueueName()); |
| | | XpGeoQueryEntity xpGeoQueryEntity = new XpGeoQueryEntity(); |
| | | String[] split = popFirstElement.split("_"); |
| | | xpGeoQueryEntity.setOrderId(split[0]); |
| | | // 存mongo数据 |
| | | xpPricingClient.updateXpGeoQueryEntity(split[0]); |
| | | this.updateById(order); |
| | | |
| | | // 修改车辆信息 |
| | | vehicle.setState(1); |
| | | xpVehicleClient.updateVehicleById(vehicle); |
| | | |
| | | |
| | | |
| | | // 推送点位轨迹信息 |
| | | |
| | | |
| | | // 绑定关系 |
| | | BaseVehicleUserDto baseVehicleUserDto = userVehicleClient.addTaxiPassenger(addTaxiPassengerVo); |
| | | if (baseVehicleUserDto.getCode() == 200) { |
| | | |
| | | // Redis弹出这个队列元素 |
| | | // value 订单Id_经纬度_状态_用户id_订单编号_距离_时间 |
| | | String popFirstElement = redisService.popFirstElement(order.getQueueName()); |
| | | XpGeoQueryEntity xpGeoQueryEntity = new XpGeoQueryEntity(); |
| | | String[] split = popFirstElement.split("_"); |
| | | xpGeoQueryEntity.setOrderId(split[0]); |
| | | // 存mongo数据 |
| | | xpPricingClient.updateXpGeoQueryEntity(split[0]); |
| | | this.updateById(order); |
| | | |
| | | // 修改车辆信息 |
| | | vehicle.setState(1); |
| | | xpVehicleClient.updateVehicleById(vehicle); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | return null; |
| | | } |
| | | BeanUtils.copyProperties(xpOrder, xpOrderDetailVO); |
| | | |
| | | R<XpPoint> xpPointR = xpPointClient.queryById(xpOrder.getStartPointId()); |
| | | if (xpPointR.getCode() == R.SUCCESS) { |
| | | XpPoint startPoint = xpPointR.getData(); |
| | | xpOrderDetailVO.setStartParkingTimeLimit(startPoint.getParkingTimeLimit()); |
| | | } |
| | | |
| | | R<XpPoint> xpPointR1 = xpPointClient.queryById(xpOrder.getEndPointId()); |
| | | if (xpPointR1.getCode() == R.SUCCESS) { |
| | | XpPoint endPoint = xpPointR1.getData(); |
| | | xpOrderDetailVO.setEndParkingTimeLimit(endPoint.getParkingTimeLimit()); |
| | | } |
| | | // 算时间 |
| | | if (xpOrder.getStatus() == 1) { |
| | | R<Integer> r = xpPricingClient.getWaitTime(new LonLatDto(xpOrder.getStartLon(), xpOrder.getStartLat())); |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xiaopeng.order.mapper.XpCruiseOrderMapper"> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, vehicle_id, fleet_id, order_number, transaction_id, order_source, ride_time, placement_lon, placement_lat, placement_address, start_lon, start_lat, end_lon, end_lat, start_address, end_address, boarding_lon, boarding_lat, boarding_address, boarding_time, getoff_lon, getoff_lat, getoff_address, getoff_time, pay_type, order_money, pay_money, prepay_money, start_mileage, start_money, mileage_kilometers, mileage_money, duration, duration_money, wait, wait_money, long_distance, long_distanceMoney, red_packet_money, coupon_money, red_packet_id, coupon_id, status, is_deleted, create_time, update_time, create_by, update_by,city_id |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-order-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-payment-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-push-message-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-remote-driving-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |
| | |
| | | id, vehicle_code, vehicle_vin, plate_number, vehicle_model, vehicle_color, vehicle_pictures, |
| | | procurement_source, remarks, annual_inspection_date, insurance_company, insurance_phone, |
| | | insurance_end_time, inspection_attachments, policy_information, electronic_id, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileageRange, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileage_range, |
| | | warehousing_time, vehicle_type, accept_or_test, accept_or_test_status, current_electricity, |
| | | is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | |
| | | # seata.conf |
| | | shardingsphere.transaction.seata.at.enable = true |
| | | shardingsphere.transaction.seata.tx.timeout = 60 |
| | | client { |
| | | application.id = "xp-robotaxi-vehicle-convoy-boot" # 与spring.application.name一致 |
| | | transaction.service.group = "seata_tx_group" |