xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/CruisePointDto.java
New file @@ -0,0 +1,20 @@ package com.xiaopeng.api.dto.operation; import com.xiaopeng.api.model.order.XpCruiseOrder; import lombok.Data; @Data public class CruisePointDto { // 运车车辆id private Long vehicleId; // 当前点位id private Long pointId; // 1正方 2反方 private Integer orderReverse; // 订单数据 private XpCruiseOrder newXpCruiseOrder; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/NewCruiseOrderDto.java
New file @@ -0,0 +1,19 @@ package com.xiaopeng.api.dto.operation; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.web.bind.annotation.RequestParam; @Data @AllArgsConstructor @NoArgsConstructor public class NewCruiseOrderDto { // 车id private Long vehicleId; // 车vin private String vehicleVin; // 车队id private Long fleetId; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpCruisePlanClientFallbackFactory.java
New file @@ -0,0 +1,53 @@ package com.xiaopeng.api.factory.operation; import com.xiaopeng.api.dto.map.XpPointExportExcelQuery; import com.xiaopeng.api.dto.operation.*; import com.xiaopeng.api.dto.order.HistoryEndPointsDto; import com.xiaopeng.api.dto.order.HistoryStartPointsDto; import com.xiaopeng.api.feignClient.operation.XpCruisePlanClient; import com.xiaopeng.api.feignClient.operation.XpPointClient; import com.xiaopeng.api.model.operation.XpElectronicFenceArea; import com.xiaopeng.api.model.operation.XpPoint; import com.xiaopeng.api.model.order.XpCruiseOrder; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo; import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.page.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.Collections; import java.util.List; @Slf4j @Component public class XpCruisePlanClientFallbackFactory implements FallbackFactory<XpCruisePlanClient> { @Override public XpCruisePlanClient create(Throwable cause) { return new XpCruisePlanClient() { @Override public R<XpCruiseOrder> getCruisePoint(CruisePointDto dto) { log.error("XpCruisePlanClientFallbackFactory getCruisePoint error:{}", cause.getMessage()); return null; } @Override public R<XpCruiseOrder> getNewCruiseOrder(NewCruiseOrderDto dto) { log.error("XpCruisePlanClientFallbackFactory getNewCruiseOrder error:{}", cause.getMessage()); return null; } @Override public R<XpCruiseOrder> findReturnCruisePoint(XpCruiseOrder xpCruiseOrder) { log.error("XpCruisePlanClientFallbackFactory findReturnCruisePoint error:{}", cause.getMessage()); return null; } }; } } xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpCruisePlanClient.java
New file @@ -0,0 +1,55 @@ package com.xiaopeng.api.feignClient.operation; import com.xiaopeng.api.dto.map.XpPointExportExcelQuery; import com.xiaopeng.api.dto.operation.*; import com.xiaopeng.api.dto.order.HistoryEndPointsDto; import com.xiaopeng.api.dto.order.HistoryStartPointsDto; import com.xiaopeng.api.factory.operation.XpCruisePlanClientFallbackFactory; import com.xiaopeng.api.factory.operation.XpPointClientFallbackFactory; import com.xiaopeng.api.model.operation.XpCruisePlanPoint; import com.xiaopeng.api.model.operation.XpElectronicFenceArea; import com.xiaopeng.api.model.operation.XpPoint; import com.xiaopeng.api.model.order.XpCruiseOrder; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo; import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum; import com.xiaopeng.common.core.web.page.PageInfo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @FeignClient(contextId = "XpCruisePlanClient", value = ServiceNameConstantsEnum.XP_OPERATION_SERVICE, fallbackFactory = XpCruisePlanClientFallbackFactory.class) public interface XpCruisePlanClient { /** * 获取车辆下个点位 * @return */ @PostMapping("/inner/cruise/getCruisePoint") R<XpCruiseOrder> getCruisePoint(@RequestBody CruisePointDto dto); /** * 组装巡游单子 * @return */ @PostMapping("/inner/cruise/getNewCruiseOrder") R<XpCruiseOrder> getNewCruiseOrder(@RequestBody NewCruiseOrderDto dto); /** * 找到收车点位 * @return */ @PostMapping("/inner/cruise/findReturnCruisePoint") R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder); } xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/vehicleConvoy/XpVehicleClient.java
@@ -109,4 +109,13 @@ @PostMapping("/inner/vehicle/updateVehicleStatus") R<?> updateVehicleStatus(@RequestBody UpdateVehicleStateDto updateVehicleStateDto); /** * 根据车辆id查询车辆所属的车队id * * @param vehicleId * @return */ @GetMapping("/inner/vehicle/findFleetIdByVehicleId") R<Long> findFleetIdByVehicleId(@RequestParam Long vehicleId); } xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpTask.java
@@ -51,6 +51,9 @@ @ApiModelProperty(value = "任务描述图片") private String taskImage; @ApiModelProperty(value = "任务描述图片") private String belongUserIds; @ApiModelProperty(value = "车辆id") private Long vehicleId; @@ -62,7 +65,7 @@ private BigDecimal vehicleLat; @ApiModelProperty(value = "处理人id") private Long handleUserId; private String handleUserId; @ApiModelProperty(value = "处理时间") private LocalDateTime handleTime; xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpBanner.java
@@ -4,6 +4,7 @@ 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; @@ -34,10 +35,12 @@ @ApiModelProperty(value = "广告开始时间") @TableField("start_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startTime; @ApiModelProperty(value = "广告结束时间") @TableField("end_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; @ApiModelProperty(value = "状态(0=未开始,1=进行中,2=已结束)") xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpCruisePlanPoint.java
@@ -38,7 +38,7 @@ private Long cruisePlanId; @ApiModelProperty(value = "点位ID") private Integer pointId; private Long pointId; @ApiModelProperty(value = "排序") private Integer sortOrder; xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/order/XpCruiseOrder.java
@@ -40,6 +40,9 @@ @ApiModelProperty(value = "车辆vin") private String vehicleVin; @ApiModelProperty(value = "车队id") private Long fleetId; @ApiModelProperty(value = "订单类型 1=正常巡游单 2返程单") private Integer orderType; @@ -76,7 +79,7 @@ @ApiModelProperty(value = "任务id") @TableField("mission_id") private String missionId; private Long missionId; @ApiModelProperty(value = "返程上次的订单id") @TableField("last_order_id") @@ -85,4 +88,8 @@ @ApiModelProperty(value = "订单号") @TableField("order_number") private String orderNumber; @ApiModelProperty(value = "方向 1正2反") @TableField("order_reverse") private Integer orderReverse; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/vehicleConvoy/XpVehicle.java
@@ -119,4 +119,9 @@ @TableField(exist = false) private String electronicName; @ApiModelProperty(value = "车队id") @TableField(exist = false) private Long fleetId; } xp-robotaxi-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -20,6 +20,7 @@ com.xiaopeng.api.factory.operation.XpCouponClientFallbackFactory com.xiaopeng.api.factory.operation.XpWhiteListClientFallbackFactory com.xiaopeng.api.factory.operation.XpElectronicFenceClientFallbackFactory com.xiaopeng.api.factory.operation.XpCruisePlanClientFallbackFactory com.xiaopeng.api.factory.operation.ReassignOrderClientFallbackFactory com.xiaopeng.api.factory.vehicleConvoy.UserVehicleClientFallbackFactory com.xiaopeng.api.factory.vehicleConvoy.XpFleetOperationsClientFallbackFactory xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -7,6 +7,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.util.JsonFormat; import com.xiaopeng.api.dto.map.OrderRouteAndFareDto; import com.xiaopeng.api.dto.operation.CruisePointDto; import com.xiaopeng.api.dto.operation.LonLatDto; import com.xiaopeng.api.dto.operation.ReassignOrderDTO; import com.xiaopeng.api.dto.order.PopOrderDto; @@ -14,6 +15,7 @@ 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.operation.XpCruisePlanClient; import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; import com.xiaopeng.api.feignClient.order.XpOrderClient; import com.xiaopeng.api.feignClient.pushMessage.XpPushMessageClient; @@ -93,6 +95,10 @@ @Resource private RedisService redisService; @Autowired private XpCruisePlanClient xpCruisePlanClient; /** @@ -852,9 +858,48 @@ long sequence1 = snowFlake.nextId(); xpuUtil.cloudCreateOrder(taskList, xpVehicle.getVehicleVin(),sequence1); }else if(xpCruiseOrder.getOrderType()==1){ // 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 TODO v // 正常巡游 找到下一个点位 若到达最后点位 则反向找点位 // 起点 Double endLon = xpCruiseOrder.getEndLon(); Double endLat = xpCruiseOrder.getEndLat(); XpCruiseOrder newXpCruiseOrder = new XpCruiseOrder(); newXpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); newXpCruiseOrder.setVehicleId(xpCruiseOrder.getVehicleId()); newXpCruiseOrder.setVehicleVin(xpCruiseOrder.getVehicleVin()); newXpCruiseOrder.setFleetId(xpCruiseOrder.getFleetId()); newXpCruiseOrder.setOrderType(1); newXpCruiseOrder.setStartLat(endLat); newXpCruiseOrder.setStartLon(endLon); newXpCruiseOrder.setStartPointId(xpCruiseOrder.getEndPointId()); newXpCruiseOrder.setStartPointName(xpCruiseOrder.getEndPointName()); newXpCruiseOrder.setStatus(1); newXpCruiseOrder.setLastOrderId(xpCruiseOrder.getId()); // 通过车找终点id CruisePointDto cruisePointDto = new CruisePointDto(); cruisePointDto.setNewXpCruiseOrder(newXpCruiseOrder); cruisePointDto.setVehicleId(xpCruiseOrder.getVehicleId()); cruisePointDto.setPointId(newXpCruiseOrder.getStartPointId()); cruisePointDto.setOrderReverse(xpCruiseOrder.getOrderReverse()); R<XpCruiseOrder> cruisePoint = xpCruisePlanClient.getCruisePoint(cruisePointDto); if(cruisePoint!=null){ xpCruiseOrderClient.addCruiseOrder(cruisePoint.getData()); // 下发任务 RTTask task = new RTTask(); task.setOrder_id(newXpCruiseOrder.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); } } } xp-robotaxi-common/xp-common-redis/pom.xml
@@ -31,7 +31,7 @@ <!-- redis分布式锁框架 --> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.19.3</version> </dependency> </dependencies> xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpTaskController.java
@@ -68,7 +68,8 @@ @GetMapping("/api/v1/task/confirmArrive") @Transactional public R confirmArrive( Long id) { return xpTaskService.confirmArrive(id); Long userId = tokenService.getLoginOperationUser().getXpOperationsUser().getId(); return xpTaskService.confirmArrive(id,userId); } @ApiOperation(value = "查询车辆不分页列表", tags = "运维APP-任务中心") @PostMapping("/api/v1/task/listVehicle") xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleOperationsController.java
@@ -2,7 +2,9 @@ import cn.hutool.core.util.IdUtil; import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; import com.xiaopeng.api.dto.operation.NewCruiseOrderDto; import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; import com.xiaopeng.api.feignClient.operation.XpCruisePlanClient; import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; import com.xiaopeng.api.model.order.XpCruiseOrder; @@ -52,6 +54,8 @@ private MongoTemplate mongoTemplate; @Resource private OrderMissionClient orderMissionClient; @Autowired private XpCruisePlanClient xpCruisePlanClient; /** * 车辆详情-车辆调度-发车 收车 @@ -71,16 +75,17 @@ // 发车 if(dto.getDepartureStatus()==1){ // 找车辆的任务 生成巡游单子 下发命令 TODO v // 找车辆的任务 生成巡游单子 下发命令 R<XpCruiseOrder> newCruiseOrder = xpCruisePlanClient.getNewCruiseOrder(new NewCruiseOrderDto(xpVehicle.getId(),xpVehicle.getVehicleVin(),xpVehicle.getFleetId())); if(newCruiseOrder.getData()!=null){ // 下发命令 orderMissionClient.pushOrder(new PushOrderDto(xpVehicle.getVehicleVin(),newCruiseOrder.getData().getId(),null)); } }else if(dto.getDepartureStatus()==3){ // 收车 关闭当前巡游单子 生成新的返程单子 找到收车站点 xpCruiseOrderClient.updateCruiseOrder(xpVehicle.getVehicleVin()); R<String> r = xpCruiseOrderClient.updateCruiseOrder(xpVehicle.getVehicleVin()); // redis 获取当前最新经纬度位置 VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); @@ -89,25 +94,22 @@ XpCruiseOrder xpCruiseOrder = new XpCruiseOrder(); xpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); xpCruiseOrder.setVehicleId(xpVehicle.getId()); xpCruiseOrder.setFleetId(xpVehicle.getFleetId()); xpCruiseOrder.setOrderType(2); xpCruiseOrder.setStartLon(x); xpCruiseOrder.setStartLat(y); // TODO v 找到收车站点 xpCruiseOrder.setStatus(1); xpCruiseOrder.setOrderReverse(1); xpCruiseOrder.setLastOrderId(r.getData()); xpCruiseOrderClient.addCruiseOrder(xpCruiseOrder); // 下发命令 orderMissionClient.pushOrder(new PushOrderDto( xpCruiseOrder.getVehicleVin(),xpCruiseOrder.getId(),null)); // 找到收车站点 R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder); if(returnCruisePoint!=null){ xpCruiseOrderClient.addCruiseOrder(returnCruisePoint.getData()); // 下发命令 orderMissionClient.pushOrder(new PushOrderDto( xpCruiseOrder.getVehicleVin(),xpCruiseOrder.getId(),null)); } } return R.ok(); xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/model/vo/TaskManagementRoutineDetailVO.java
@@ -42,7 +42,7 @@ @ApiModelProperty(value = "完成图片") private String taskImage; @ApiModelProperty(value = "处理人id") private Long handleUserId; private String handleUserId; @ApiModelProperty(value = "处理人姓名") private String handleUserName; @ApiModelProperty(value = "处理时间") xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/model/vo/TaskRoutineDetailVO.java
@@ -67,7 +67,7 @@ private String taskImage; @ApiModelProperty(value = "处理人id") private Long handleUserId; private String handleUserId; @ApiModelProperty(value = "处理人姓名") private String handleUserName; xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/XpTaskService.java
@@ -52,7 +52,7 @@ R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id); R confirmArrive(Long id); R confirmArrive(Long id,Long userId); /** * 通过车辆id查询任务事故分页列表 xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -226,7 +226,7 @@ } task.setHandleTime(LocalDateTime.now()); task.setHandleUserId(xpOperationsUser.getId()); task.setHandleUserId(xpOperationsUser.getId().toString()); task.setStatus(2); // 存储事故处理日志 XpTaskHandleDetail xpTaskHandleDetail = new XpTaskHandleDetail(); @@ -282,8 +282,8 @@ res.setTaskImage(task.getTaskImage()); res.setHandleUserId(task.getHandleUserId()); res.setHandleTime(task.getHandleTime()); if (Objects.nonNull(task.getHandleUserId())) { XpOperationsUser data = xpOperationUserClient.queryById(task.getHandleUserId()).getData(); if (Objects.nonNull(task.getHandleUserId())&&task.getHandleUserId().split(",").length==1) { XpOperationsUser data = xpOperationUserClient.queryById(Long.valueOf(task.getHandleUserId())).getData(); if (Objects.nonNull(data)) { res.setHandleUserName(data.getNickName()); } @@ -617,7 +617,7 @@ } @Override public R confirmArrive(Long id) { public R confirmArrive(Long id,Long userId) { XpTask task = this.getById(id); if (task!=null){ task.setStatus(1); @@ -759,7 +759,7 @@ public R assigneeTask(Long id, Long handlerUserId,Long assigneeUserId) { XpTask task = this.getById(id); task.setAssigneeTime(LocalDateTime.now()); task.setHandleUserId(handlerUserId); task.setHandleUserId(handlerUserId.toString()); task.setAssigneeUserId(assigneeUserId); this.updateById(task); return R.ok(); @@ -1027,7 +1027,7 @@ res.setHandleUserId(task.getHandleUserId()); XpOperationsUser operationsUser = xpOperationUserClient.queryById(xpTaskHandleDetailRoutine.getOperationsUserId()).getData(); if (operationsUser != null){ res.setHandleUserId(operationsUser.getId()); res.setHandleUserId(operationsUser.getId().toString()); res.setHandleUserName(operationsUser.getNickName()); } } @@ -1079,12 +1079,14 @@ 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()); if (task.getHandleUserId().split(",").length==1){ XpOperationsUser operationsUser = xpOperationUserClient.queryById(Long.valueOf(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)); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java
@@ -1,13 +1,25 @@ package com.xiaopeng.operation.controller; import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.xiaopeng.api.dto.operation.CruisePointDto; import com.xiaopeng.api.dto.operation.NewCruiseOrderDto; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; import com.xiaopeng.api.model.operation.XpCruisePlan; import com.xiaopeng.api.model.operation.XpCruisePlanPoint; import com.xiaopeng.api.model.operation.XpCruisePlanVehicle; import com.xiaopeng.api.model.operation.XpPoint; import com.xiaopeng.api.model.order.XpCruiseOrder; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.operation.dto.XpCruisePlanAddDTO; import com.xiaopeng.operation.dto.XpCruisePlanEditDTO; import com.xiaopeng.operation.query.CruisePlanQuery; import com.xiaopeng.operation.service.IXpCruisePlanPointService; import com.xiaopeng.operation.service.IXpCruisePlanService; import com.xiaopeng.operation.service.IXpCruisePlanVehicleService; import com.xiaopeng.operation.service.XpPointService; import com.xiaopeng.operation.vo.XpCruisePlanDetailVO; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -22,9 +34,13 @@ import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import io.swagger.annotations.ApiParam; import java.util.List; import java.util.stream.Collectors; /** * <p> @@ -39,39 +55,166 @@ @RequiredArgsConstructor(onConstructor_ = @Lazy) public class XpCruisePlanController { private final IXpCruisePlanService xpCruisePlanService; private final IXpCruisePlanVehicleService xpCruisePlanVehicleService; private final IXpCruisePlanPointService xpCruisePlanPointService; private final XpPointService pointService; private final XpVehicleClient xpVehicleClient; @ApiOperation(value = "获取巡游计划分页列表", tags = {"管理后台-巡游计划"}) @PostMapping(value = {"/api/v1/xp-cruise-plan/pageList"}) public R<PageInfo<XpCruisePlan>> getPageList(@RequestBody CruisePlanQuery query){ public R<PageInfo<XpCruisePlan>> getPageList(@RequestBody CruisePlanQuery query) { return R.ok(xpCruisePlanService.getPageList(query)); } @ApiOperation(value = "新增巡游计划", tags = {"管理后台-巡游计划"}) @PostMapping(value = {"/api/v1/xp-cruise-plan/add"}) public R<?> add(@Valid @RequestBody XpCruisePlanAddDTO dto){ public R<?> add(@Valid @RequestBody XpCruisePlanAddDTO dto) { xpCruisePlanService.add(dto); return R.ok(); } @ApiOperation(value = "编辑巡游计划", tags = {"管理后台-巡游计划"}) @PostMapping(value = {"/api/v1/xp-cruise-plan/edit"}) public R<?> edit(@Valid @RequestBody XpCruisePlanEditDTO dto){ public R<?> edit(@Valid @RequestBody XpCruisePlanEditDTO dto) { xpCruisePlanService.edit(dto); return R.ok(); } @ApiOperation(value = "删除巡游计划", tags = {"管理后台-巡游计划"}) @DeleteMapping(value = {"/api/v1/xp-cruise-plan/deleteById/{id}"}) public R<?> deleteById(@ApiParam(name = "id", value = "巡游计划ID") @PathVariable Long id){ public R<?> deleteById(@ApiParam(name = "id", value = "巡游计划ID") @PathVariable Long id) { xpCruisePlanService.deleteById(id); return R.ok(); } @ApiOperation(value = "巡游计划详情", tags = {"管理后台-巡游计划"}) @GetMapping(value = {"/api/v1/xp-cruise-plan/detail"}) public R<XpCruisePlanDetailVO> detail(@ApiParam(name = "id", value = "巡游计划ID") @RequestParam Long id){ public R<XpCruisePlanDetailVO> detail(@ApiParam(name = "id", value = "巡游计划ID") @RequestParam Long id) { return R.ok(xpCruisePlanService.detail(id)); } /** * 获取车辆下个点位 * @return */ @PostMapping("/inner/cruise/getCruisePoint") public R<XpCruiseOrder> getCruisePoint(@RequestBody CruisePointDto dto) { // 先找计划 XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, dto.getVehicleId())); // 找对应的多个点位 List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder)); // 找到现在这个点位 // 根据dto的pointId 是第几个 int index = 0; for (int i = 0; i < planPointList.size(); i++) { if (planPointList.get(i).getPointId().equals(dto.getPointId())) { index = i; break; } } XpCruiseOrder newXpCruiseOrder = dto.getNewXpCruiseOrder(); XpCruisePlanPoint xpCruisePlanPoint = null; // 判断是否是最后一个 是则往前一个 否找下一个 if (index == planPointList.size() - 1) { // 最后一个 找上一个 xpCruisePlanPoint = planPointList.get(index - 1); newXpCruiseOrder.setOrderReverse(2); } else if (index == 0) { // 第一个 找下一个 xpCruisePlanPoint = planPointList.get(index + 1); newXpCruiseOrder.setOrderReverse(1); } else { // 中间点位 if (dto.getOrderReverse() == 1) { // 正向 找下一个 xpCruisePlanPoint = planPointList.get(index + 1); newXpCruiseOrder.setOrderReverse(1); } else { // 反向找上一个 xpCruisePlanPoint = planPointList.get(index - 1); newXpCruiseOrder.setOrderReverse(2); } } Long pointId = xpCruisePlanPoint.getPointId(); XpPoint point = pointService.getById(pointId); newXpCruiseOrder.setEndPointId(pointId); newXpCruiseOrder.setEndPointName(point.getPointName()); newXpCruiseOrder.setEndLon(point.getPointLon()); newXpCruiseOrder.setEndLat(point.getPointLat()); newXpCruiseOrder.setMissionId(xpCruisePlanPoint.getCruisePlanId()); return R.ok(newXpCruiseOrder); } /** * 获取巡游订单数据 * @return */ @PostMapping("/inner/cruise/getNewCruiseOrder") public R<XpCruiseOrder> getNewCruiseOrder(@RequestBody NewCruiseOrderDto dto) { // 先找计划 XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, dto.getVehicleId())); // 找对应的多个点位 List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder)); XpCruisePlanPoint xpCruisePlanPoint = planPointList.get(0); Long pointId = xpCruisePlanPoint.getPointId(); XpPoint point = pointService.getById(pointId); XpCruiseOrder newXpCruiseOrder = new XpCruiseOrder(); newXpCruiseOrder.setId("XU"+ IdUtil.fastUUID()); newXpCruiseOrder.setFleetId(dto.getFleetId()); newXpCruiseOrder.setVehicleId(dto.getVehicleId()); newXpCruiseOrder.setVehicleVin(dto.getVehicleVin()); newXpCruiseOrder.setOrderType(1); newXpCruiseOrder.setMissionId(plan.getCruisePlanId()); newXpCruiseOrder.setStatus(1); newXpCruiseOrder.setOrderReverse(1); // 起点 newXpCruiseOrder.setStartLon(point.getPointLon()); newXpCruiseOrder.setStartLat(point.getPointLat()); newXpCruiseOrder.setStartPointId(pointId); newXpCruiseOrder.setStartPointName(point.getPointName()); // 终点 XpCruisePlanPoint endCruisePlanPoint = planPointList.get(1); Long endPointId = endCruisePlanPoint.getPointId(); XpPoint endPoint = pointService.getById(endPointId); newXpCruiseOrder.setEndPointId(endPointId); newXpCruiseOrder.setEndPointName(endPoint.getPointName()); newXpCruiseOrder.setEndLon(endPoint.getPointLon()); newXpCruiseOrder.setEndLat(endPoint.getPointLat()); return R.ok(newXpCruiseOrder); } /** * 获取车辆返回点位 * @param xpCruiseOrder * @return */ @PostMapping("/inner/cruise/findReturnCruisePoint") public R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder){ // 先找计划 XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, xpCruiseOrder.getVehicleId())); // 找对应的多个点位 List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder)); XpPoint xpPoint = pointService.list(new LambdaQueryWrapper<XpPoint>().eq(XpPoint::getParkingPoint, 1).in(XpPoint::getId, planPointList.stream().map(XpCruisePlanPoint::getPointId).collect(Collectors.toList()))).get(0); xpCruiseOrder.setEndPointId(xpPoint.getId()); xpCruiseOrder.setEndPointName(xpPoint.getPointName()); xpCruiseOrder.setEndLon(xpPoint.getPointLon()); xpCruiseOrder.setEndLat(xpPoint.getPointLat()); return R.ok(xpCruiseOrder); } } xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpNotificationController.java
@@ -41,7 +41,7 @@ } @PostMapping("/update") @ApiOperation(value = "修改设置") public R<List<XpNotification>> update(@RequestBody NotificationDto notificationDto) { public R update(@RequestBody NotificationDto notificationDto) { List<XpNotification> notifications = notificationDto.getNotifications(); xpNotificationService.updateBatchById(notifications); return R.ok(); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpPointManagementController.java
@@ -143,7 +143,7 @@ * 设置特殊点位 */ @PostMapping("/setSpecialPoint") @ApiOperation(value = "设置特殊点位") @ApiOperation(value = "设置特殊点位",tags = "后台管理-特殊点位") 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)); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/NotificationDto.java
@@ -6,11 +6,12 @@ import lombok.Data; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; @Data @ApiModel(value = "消息通知设置DTO") public class NotificationDto { public class NotificationDto implements Serializable { @ApiModelProperty(value = "消息通知列表") private List<XpNotification> notifications; xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/XpCruisePlanAddDTO.java
@@ -35,7 +35,7 @@ @Accessors(chain = true) public static class CruisePlanPointDTO{ @ApiModelProperty(value = "点位ID") private Integer pointId; private Long pointId; @ApiModelProperty(value = "排序") private Integer sortOrder; xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java
@@ -2,6 +2,7 @@ import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; @@ -22,7 +23,6 @@ import com.xiaopeng.operation.query.CruisePlanQuery; import com.xiaopeng.operation.service.IXpCruisePlanPointService; import com.xiaopeng.operation.service.IXpCruisePlanService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.operation.service.IXpCruisePlanVehicleService; import com.xiaopeng.operation.service.IXpPointService; import com.xiaopeng.operation.vo.XpCruisePlanDetailVO; @@ -173,7 +173,6 @@ List<Long> pointIds = planPoints.stream() .map(XpCruisePlanPoint::getPointId) .filter(Objects::nonNull) .map(Integer::longValue) .collect(Collectors.toList()); Map<Long, XpPoint> pointMap = CollUtil.isNotEmpty(pointIds) ? xpPointService.listByIds(pointIds).stream() @@ -285,7 +284,7 @@ if (CollUtil.isEmpty(pointList)) { throw new ServiceException("关联点位列表不能为空", I18nKeyConstant.CRUISE_PLAN_POINT_EMPTY); } Set<Integer> pointIdSet = new HashSet<>(); Set<Long> pointIdSet = new HashSet<>(); for (XpCruisePlanAddDTO.CruisePlanPointDTO pointDTO : pointList) { if (pointDTO.getPointId() == null || pointDTO.getSortOrder() == null || pointDTO.getStopFlag() == null) { throw new ServiceException("点位参数不完整", I18nKeyConstant.CRUISE_PLAN_POINT_INCOMPLETE); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/vo/XpCruisePlanPointVO.java
@@ -17,7 +17,7 @@ public class XpCruisePlanPointVO { @ApiModelProperty(value = "点位ID") private Integer pointId; private Long pointId; @ApiModelProperty(value = "点位名称") private String pointName; xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/query/XpCruiseOrderPageQuery.java
@@ -24,8 +24,8 @@ @NotNull(message = "巡游计划ID不能为空") private Long missionId; @ApiModelProperty(value = "订单号") private String orderNumber; @ApiModelProperty(value = "订单ID") private Long id; @ApiModelProperty(value = "车牌号") private String plateNumber; @@ -33,7 +33,7 @@ @ApiModelProperty(value = "车队ID") private Long fleetId; @ApiModelProperty(value = "状态 1进行中 2已停止 3已完成") @ApiModelProperty(value = "状态 1进行中 2已停止 3 已完成") private Integer status; @ApiModelProperty(value = "开始时间") xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/XpCruiseOrderPageVO.java
@@ -17,10 +17,7 @@ public class XpCruiseOrderPageVO { @ApiModelProperty(value = "订单ID") private String id; @ApiModelProperty(value = "订单号") private String orderNumber; private Long id; @ApiModelProperty(value = "车辆id") private Long vehicleId; xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpCruiseOrderServiceImpl.java
@@ -152,8 +152,9 @@ PageInfo<XpCruiseOrderPageVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); LambdaQueryWrapper<XpCruiseOrder> wrapper = new LambdaQueryWrapper<XpCruiseOrder>() .eq(XpCruiseOrder::getMissionId, String.valueOf(query.getMissionId())) .like(StringUtils.isNotBlank(query.getOrderNumber()), XpCruiseOrder::getOrderNumber, query.getOrderNumber()) .eq(query.getStatus() != null, XpCruiseOrder::getStatus, query.getStatus()); .like(Objects.nonNull(query.getId()), XpCruiseOrder::getId, query.getId()) .eq(query.getStatus() != null, XpCruiseOrder::getStatus, query.getStatus()) .eq(Objects.nonNull(query.getFleetId()), XpCruiseOrder::getFleetId, query.getFleetId()); if (query.getStartTime() != null) { wrapper.ge(BaseModel::getCreateTime, query.getStartTime().atStartOfDay()); @@ -161,15 +162,15 @@ if (query.getEndTime() != null) { wrapper.le(BaseModel::getCreateTime, query.getEndTime().plusDays(1).atStartOfDay()); } if (query.getFleetId() != null) { R<List<Long>> fleetVehicleResult = xpFleetVehicleClient.listVehicleIdsByFleetId(query.getFleetId()); if (fleetVehicleResult == null || CollectionUtils.isEmpty(fleetVehicleResult.getData())) { pageInfo.setRecords(Collections.emptyList()); return pageInfo; } wrapper.in(XpCruiseOrder::getVehicleId, fleetVehicleResult.getData()); } //使用订单中的车队ID进行查询 // if (query.getFleetId() != null) { // R<List<Long>> fleetVehicleResult = xpFleetVehicleClient.listVehicleIdsByFleetId(query.getFleetId()); // if (fleetVehicleResult == null || CollectionUtils.isEmpty(fleetVehicleResult.getData())) { // pageInfo.setRecords(Collections.emptyList()); // return pageInfo; // } // wrapper.in(XpCruiseOrder::getVehicleId, fleetVehicleResult.getData()); // } if (StringUtils.isNotBlank(query.getPlateNumber())) { R<List<XpVehicle>> vehicleResult = xpVehicleClient.listByPlateNumber(query.getPlateNumber()); @@ -181,7 +182,7 @@ wrapper.in(XpCruiseOrder::getVehicleId, vehicleIds); } wrapper.orderByDesc(BaseModel::getCreateTime); wrapper.orderByDesc(XpCruiseOrder::getCreateTime); Page<XpCruiseOrder> page = new Page<>(query.getPageNum(), query.getPageSize()); Page<XpCruiseOrder> pageResult = this.page(page, wrapper); if (CollectionUtils.isEmpty(pageResult.getRecords())) { @@ -204,19 +205,35 @@ } else { vehicleMap = Collections.emptyMap(); } Map<Long, Long> vehicleFleetIdMap = new HashMap<>(); if (!vehicleIds.isEmpty()) { for (Long vehicleId : vehicleIds) { R<Long> fleetIdResult = xpFleetVehicleClient.getFleetIdByVehicleId(vehicleId); if (fleetIdResult != null && fleetIdResult.getData() != null) { vehicleFleetIdMap.put(vehicleId, fleetIdResult.getData()); } } } // Map<Long, Long> vehicleFleetIdMap = new HashMap<>(); // if (!vehicleIds.isEmpty()) { // for (Long vehicleId : vehicleIds) { // R<Long> fleetIdResult = xpFleetVehicleClient.getFleetIdByVehicleId(vehicleId); // if (fleetIdResult != null && fleetIdResult.getData() != null) { // vehicleFleetIdMap.put(vehicleId, fleetIdResult.getData()); // } // } // } // Map<Long, String> fleetNameMap; // if (!vehicleFleetIdMap.isEmpty()) { // List<Long> fleetIds = vehicleFleetIdMap.values().stream().distinct().collect(Collectors.toList()); // R<List<XpFleet>> fleetResult = xpFleetClient.listByIds(fleetIds); // if (fleetResult != null && !CollectionUtils.isEmpty(fleetResult.getData())) { // fleetNameMap = fleetResult.getData().stream() // .collect(Collectors.toMap(XpFleet::getId, XpFleet::getFleetName, (a, b) -> a)); // } else { // fleetNameMap = Collections.emptyMap(); // } // } else { // fleetNameMap = Collections.emptyMap(); // } Map<Long, String> fleetNameMap; if (!vehicleFleetIdMap.isEmpty()) { List<Long> fleetIds = vehicleFleetIdMap.values().stream().distinct().collect(Collectors.toList()); R<List<XpFleet>> fleetResult = xpFleetClient.listByIds(fleetIds); Set<Long> fleetIds = pageResult.getRecords().stream() .map(XpCruiseOrder::getFleetId) .filter(Objects::nonNull) .collect(Collectors.toSet()); if (!fleetIds.isEmpty()) { R<List<XpFleet>> fleetResult = xpFleetClient.listByIds(new ArrayList<>(fleetIds)); if (fleetResult != null && !CollectionUtils.isEmpty(fleetResult.getData())) { fleetNameMap = fleetResult.getData().stream() .collect(Collectors.toMap(XpFleet::getId, XpFleet::getFleetName, (a, b) -> a)); @@ -233,7 +250,8 @@ if (vehicle != null) { vo.setPlateNumber(vehicle.getPlateNumber()); } Long fleetId = vehicleFleetIdMap.get(order.getVehicleId()); // Long fleetId = vehicleFleetIdMap.get(order.getVehicleId()); Long fleetId = order.getFleetId(); if (fleetId != null) { vo.setFleetName(fleetNameMap.get(fleetId)); } xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -1216,8 +1216,10 @@ // 结束后的车辆操作 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 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.setFleetId(vehicle.getFleetId()); xpCruiseOrder.setVehicleVin(vehicle.getVehicleVin()); xpCruiseOrder.setOrderType(2); // 返程起点是当前正常订单的终点 @@ -1682,6 +1684,7 @@ if (byVehicleVin.getCode() == 200) { vehicle = byVehicleVin.getData(); order.setVehicleId(vehicle.getId()); order.setFleetId(vehicle.getFleetId()); addTaxiPassengerVo.setVin(vehicle.getVehicleVin()); } order.setStatus(2); xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java
@@ -19,6 +19,7 @@ import com.xiaopeng.api.feignClient.order.XpOrderClient; import com.xiaopeng.api.model.maintenance.XpTask; import com.xiaopeng.api.model.maintenance.XpTaskRule; import com.xiaopeng.api.model.vehicleConvoy.XpFleetVehicle; import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; import com.xiaopeng.api.model.vehicleConvoy.XpVehicleAnnualRecord; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandCallbackVo; @@ -32,6 +33,7 @@ import com.xiaopeng.vehicleConvoy.model.importExcel.XpVehicleImportExcel; import com.xiaopeng.vehicleConvoy.model.query.*; import com.xiaopeng.vehicleConvoy.model.vo.XpVehicleVO; import com.xiaopeng.vehicleConvoy.service.IXpFleetVehicleService; import com.xiaopeng.vehicleConvoy.service.IXpVehicleAnnualRecordService; import com.xiaopeng.vehicleConvoy.service.IXpVehicleService; import io.swagger.annotations.*; @@ -73,7 +75,7 @@ public class XpVehicleController { private final IXpVehicleService xpVehicleService; private final XpOrderClient xpOrderClient; private final IXpFleetVehicleService vehicleService; private final IXpVehicleAnnualRecordService xpVehicleAnnualRecordService; private final XpVehiclePreparationClient xpVehiclePreparationClient; private final XpChargingRecordClient xpChargingRecordClient; @@ -111,7 +113,11 @@ */ @GetMapping("/inner/vehicle/queryById") public R<XpVehicle> queryById(@RequestParam Long id) { return R.ok(xpVehicleService.getById(id)); XpVehicle xpVehicle = xpVehicleService.getById(id); // 获取车队 XpFleetVehicle xpFleetVehicle = vehicleService.getOne(new LambdaQueryWrapper<XpFleetVehicle>().eq(XpFleetVehicle::getVehicleId, xpVehicle.getId())); xpVehicle.setFleetId(xpFleetVehicle.getFleetId()); return R.ok(xpVehicle); } /** * 修改车辆信息(内部接口) @@ -424,6 +430,10 @@ @GetMapping("/inner/vehicle/findByVehicleVin") public R<XpVehicle> findByVehicleVin(@RequestParam("vehicleVin") String vehicleVin){ XpVehicle xpVehicle = xpVehicleService.getOne(new LambdaQueryWrapper<XpVehicle>().eq(XpVehicle::getVehicleVin, vehicleVin)); // 获取车队 XpFleetVehicle xpFleetVehicle = vehicleService.getOne(new LambdaQueryWrapper<XpFleetVehicle>().eq(XpFleetVehicle::getVehicleId, xpVehicle.getId())); xpVehicle.setFleetId(xpFleetVehicle.getFleetId()); return R.ok(xpVehicle); } @@ -451,6 +461,18 @@ } /** * * 查询车辆所属车队ID * @param vehicleId * @return */ @GetMapping("/inner/vehicle/findFleetIdByVehicleId") public R<Long> findFleetIdByVehicleId(@RequestParam Long vehicleId){ XpFleetVehicle xpFleetVehicle = vehicleService.getOne(new LambdaQueryWrapper<XpFleetVehicle>().eq(XpFleetVehicle::getVehicleId, vehicleId)); return R.ok(xpFleetVehicle.getFleetId()); } /** * 查询可改派的车辆列表 * * @return 车辆列表