Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
# Conflicts:
# xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
| | |
| | | |
| | | // 角色名称匹配 |
| | | for (XpQualificationAuditVO xpQualificationAuditVO : list) { |
| | | map.get(xpQualificationAuditVO.getOperationsUserId()).forEach(sysRole -> { |
| | | xpQualificationAuditVO.getRoleNames().add(sysRole.getRoleName()); |
| | | }); |
| | | List<SysRole> roleList = map.get(xpQualificationAuditVO.getOperationsUserId()); |
| | | xpQualificationAuditVO.setRoleNames(roleList.stream().map(SysRole::getRoleName).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.geo.Point; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | //构建推送消息 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", orderId); |
| | | content.put("orderId", orderId.toString()); |
| | | content.put("status", 3); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | |
| | | Double longitude = lonLatDto.getLongitude(); |
| | | |
| | | //保存车辆实时位置到redis |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new GeoJsonPoint(longitude, latitude), vin); |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new Point(longitude, latitude), vin); |
| | | |
| | | //保存车辆实时信息到mongodb |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | |
| | | dto.setLatitude(latitude); |
| | | dto.setDuration(10); |
| | | dto.setDistance(2); |
| | | dto.setDirection(60); |
| | | xpPushMessageClient.pushOrderRoute(dto); |
| | | } |
| | | |
| | | //5秒钟循环一次 |
| | | //2秒钟循环一次 |
| | | try { |
| | | Thread.sleep(2000); |
| | | } catch (InterruptedException e) { |
| | |
| | | //构建推送消息 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", orderId); |
| | | content.put("orderId", orderId.toString()); |
| | | content.put("status", 4); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | |
| | | //构建推送消息 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", orderId); |
| | | content.put("orderId", orderId.toString()); |
| | | content.put("status", status); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | |
| | | Double longitude = lonLatDto.getLongitude(); |
| | | |
| | | //保存车辆实时位置到redis |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new GeoJsonPoint(longitude, latitude), vin); |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new Point(longitude, latitude), vin); |
| | | |
| | | //保存车辆实时信息到mongodb |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | |
| | | dto.setLatitude(latitude); |
| | | dto.setDuration(20); |
| | | dto.setDistance(10); |
| | | dto.setDirection(60); |
| | | xpPushMessageClient.pushOrderRoute(dto); |
| | | } |
| | | |
| | |
| | | //构建推送消息 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", orderId); |
| | | content.put("orderId", orderId.toString()); |
| | | content.put("status", 4); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.geo.Point;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; |
| | |
| | | long sequence = msgContent.getHeader().getSequence(); |
| | | responseMessage(sequence, vin); |
| | | //保存车辆实时位置到redis |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new GeoJsonPoint(longitude, latitude), vin); |
| | | redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new Point(longitude, latitude), vin); |
| | | |
| | | //保存车辆实时信息到mongodb |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | |
| | | //构建推送消息 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", orderId); |
| | | content.put("orderId", orderId.toString()); |
| | | content.put("status", status.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", JSONObject.toJSONString(content)); |
| | |
| | | } |
| | | |
| | | // 设置任务状态为待到达 |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING_ARRIVE); |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING); |
| | | |
| | | // 设置任务接收人(配置角色下的所有运维人员都可以看到) |
| | | task.setHandleUserId(belongUserIds); |
| | |
| | | } |
| | | |
| | | // 设置任务状态为待到达 |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING_ARRIVE); |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING); |
| | | |
| | | // 设置任务接收人(配置角色下的所有运维人员都可以看到) |
| | | task.setHandleUserId(belongUserIds); |
| | |
| | | } |
| | | |
| | | // 设置任务状态为待到达 |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING_ARRIVE); |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING); |
| | | |
| | | // 设置任务接收人(配置角色下的所有运维人员都可以看到) |
| | | task.setHandleUserId(belongUserIds); |
| | |
| | | } |
| | | |
| | | // 设置任务状态为待到达 |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING_ARRIVE); |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING); |
| | | |
| | | // 设置任务接收人(配置角色下的所有运维人员都可以看到) |
| | | task.setHandleUserId(belongUserIds); |
| | |
| | | } |
| | | |
| | | // 设置任务状态为待到达 |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING_ARRIVE); |
| | | task.setStatus(TaskScheduleConstants.TASK_STATUS_PENDING); |
| | | |
| | | // 设置任务接收人(配置角色下的所有运维人员都可以看到) |
| | | task.setHandleUserId(belongUserIds); |
| | |
| | | String endTime = ""; |
| | | if(StringUtils.isNotEmpty(query.getStatisticDate())){ |
| | | String statisticDate = query.getStatisticDate(); |
| | | startTime = statisticDate.split(" - ")[0]; |
| | | endTime = statisticDate.split(" - ")[1]; |
| | | startTime = statisticDate.split(" - ")[0].split(" ")[0]; |
| | | endTime = statisticDate.split(" - ")[1].split(" ")[0]; |
| | | } |
| | | //查询数据 |
| | | List<ClockInStatisticsDto> clockInStatistics = this.baseMapper.getClockInStatistics(pageInfo, appUserIds, startTime, endTime); |
| | |
| | | String endTime = ""; |
| | | if(StringUtils.isNotEmpty(query.getStatisticDate())){ |
| | | String statisticDate = query.getStatisticDate(); |
| | | startTime = statisticDate.split(" - ")[0]; |
| | | endTime = statisticDate.split(" - ")[1]; |
| | | startTime = statisticDate.split(" - ")[0].split(" ")[0]; |
| | | endTime = statisticDate.split(" - ")[1].split(" ")[0]; |
| | | } |
| | | //查询数据 |
| | | List<ClockInStatisticsDto> clockInStatistics = this.baseMapper.getClockInStatistics(pageInfo, appUserIds, startTime, endTime); |
| | |
| | | String endTime = ""; |
| | | if(StringUtils.isNotEmpty(query.getStatisticDate())){ |
| | | String statisticDate = query.getStatisticDate(); |
| | | startTime = statisticDate.split(" - ")[0]; |
| | | endTime = statisticDate.split(" - ")[1]; |
| | | startTime = statisticDate.split(" - ")[0].split(" ")[0]; |
| | | endTime = statisticDate.split(" - ")[1].split(" ")[0]; |
| | | } |
| | | List<ClockInStatisticsDetailsDto> clockInStatisticsDetails = this.baseMapper.getClockInStatisticsDetails(pageInfo, query.getAppUserId(), startTime, endTime); |
| | | List<XpOperationsUserWithRoleVO> data = xpOperationUserClient.listByIdsWithRole(Arrays.asList(query.getAppUserId())).getData(); |
| | |
| | | String endTime = ""; |
| | | if(StringUtils.isNotEmpty(query.getStatisticDate())){ |
| | | String statisticDate = query.getStatisticDate(); |
| | | startTime = statisticDate.split(" - ")[0]; |
| | | endTime = statisticDate.split(" - ")[1]; |
| | | startTime = statisticDate.split(" - ")[0].split(" ")[0]; |
| | | endTime = statisticDate.split(" - ")[1].split(" ")[0]; |
| | | } |
| | | List<ClockInStatisticsDetailsDto> clockInStatisticsDetails = this.baseMapper.getClockInStatisticsDetails(pageInfo, query.getAppUserId(), startTime, endTime); |
| | | List<XpOperationsUserWithRoleVO> data = xpOperationUserClient.listByIdsWithRole(Arrays.asList(query.getAppUserId())).getData(); |
| | |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | import com.xiaopeng.operation.vo.OrderDistanceVo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Override |
| | | public List<XpPoint> listAll(PointListQuery query) { |
| | | if(StringUtils.hasLength(query.getOperationStatus())){ |
| | | String[] split = query.getOperationStatus().split(","); |
| | | List<Integer> statusIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | statusIds.add(Integer.valueOf(s)); |
| | | } |
| | | query.setOperationStatusIds(statusIds); |
| | | } |
| | | List<XpPoint> list = this.baseMapper.listAll(query); |
| | | return list; |
| | | } |
| | |
| | | import com.xiaopeng.api.vo.OrderType; |
| | | import com.xiaopeng.api.vo.account.GetUserListByUidsVo; |
| | | import com.xiaopeng.api.vo.account.UserCouponVo; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.api.vo.order.*; |
| | |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", order.getId()); |
| | | content.put("orderId", order.getId().toString()); |
| | | content.put("status", OrderStatusEnum.CANCELED.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content)); |
| | |
| | | userVehicleClient.addTaxiPassenger(addTaxiPassengerVo); |
| | | //推送乘客车辆到达预约点的导航数据 |
| | | sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA"); |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin()); |
| | | }else{ |
| | | //推送行起点到终点的驶轨迹给乘客端 |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_END_DATA"); |
| | | sendRoute(order.getAppUserId().toString(), orderId, "ORDER_NAVIGATION_END_DATA", dto.getXpVehicleVin()); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param appUserId |
| | | * @param keyStr |
| | | */ |
| | | public void sendRoute(String appUserId, Long orderId, String keyStr){ |
| | | public void sendRoute(String appUserId, Long orderId, String keyStr, String vin){ |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | | Object cacheObject = redisService.getCacheObject(keyStr + ":" + appUserId); |
| | | if(null != cacheObject){ |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | |
| | | JSONObject content = new JSONObject(); |
| | | content.put("orderId", orderId); |
| | | content.put("routeType", "ORDER_NAVIGATION_START_DATA".equals(keyStr) ? 1 : 2); |
| | | content.put("direction", null != vehiclePosition ? vehiclePosition.getCourse() : 0); |
| | | JSONObject route = new JSONObject(); |
| | | route.put("distance", routeVo.getDistance()); |
| | | route.put("duration", routeVo.getDuration()); |
| | |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.pushMessage.utils.MapMatchingUtil; |
| | | import io.swagger.annotations.Api; |
| | | import org.powermock.core.ListMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | redisService.setCacheObject(CacheConstants.ORDER_ROUTE_CAPTURE + "_" + dto.getOrderId() + "_" +routeType, routeVo); |
| | | |
| | | // 封装轨迹点位集合 |
| | | Map<String, Object> polyline = new HashMap<>(); |
| | | List<Map<String, Object>> polyline = new ArrayList<>(); |
| | | for (LonLatDto lonLatDto : lonLatDtos) { |
| | | polyline.put("longitude",lonLatDto.getLongitude()); |
| | | polyline.put("latitude",lonLatDto.getLatitude()); |
| | | Map<String, Object> polylineMap = new HashMap<>(); |
| | | polylineMap.put("longitude",lonLatDto.getLongitude()); |
| | | polylineMap.put("latitude",lonLatDto.getLatitude()); |
| | | polyline.add(polylineMap); |
| | | } |
| | | // 封装路由详情 |
| | | Map<String, Object> route = new HashMap<>(); |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.i18n.LocaleContextHolder; |
| | | import org.springframework.data.geo.Point; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | } |
| | | |
| | | for (XpVehicleVO xpVehicleVO : list) { |
| | | GeoJsonPoint geoJsonPoint = redisService.getCacheObject("vehiclePosition:" + xpVehicleVO.getVehicleVin()); |
| | | if (Objects.nonNull(geoJsonPoint)){ |
| | | Point point = redisService.getCacheObject("vehiclePosition:" + xpVehicleVO.getVehicleVin()); |
| | | if (Objects.nonNull(point)){ |
| | | // 获取经纬度 |
| | | xpVehicleVO.setLongitude(geoJsonPoint.getX()); |
| | | xpVehicleVO.setLatitude(geoJsonPoint.getY()); |
| | | xpVehicleVO.setLongitude(point.getX()); |
| | | xpVehicleVO.setLatitude(point.getY()); |
| | | } |
| | | // 查询车辆的续航里程 |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicleVO.getVehicleVin())), VehiclePosition.class); |