From 43d605c9eb708326cf229942bc0117cb8accd1c7 Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期日, 12 四月 2026 16:19:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/1.0' into 1.0
---
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java | 65 ++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java
index b3e8b42..a13992d 100644
--- a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java
+++ b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java
@@ -5,10 +5,13 @@
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaopeng.api.dto.operation.PointMapQuery;
import com.xiaopeng.api.dto.order.HistoryEndPointsDto;
import com.xiaopeng.api.dto.order.HistoryStartPointsDto;
+import com.xiaopeng.api.feignClient.account.XpAppUserCollectAddrClient;
+import com.xiaopeng.api.model.account.XpAppUserCollectAddr;
import com.xiaopeng.api.model.operation.*;
import com.xiaopeng.api.query.operation.PointListQuery;
import com.xiaopeng.api.query.operation.PointPageListListQuery;
@@ -17,6 +20,7 @@
import com.xiaopeng.api.vo.order.XpPointsListVo;
import com.xiaopeng.api.vo.order.XpPointsSearchVo;
import com.xiaopeng.common.core.constant.CacheConstants;
+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.evi.oss.service.AliOssService;
@@ -73,11 +77,17 @@
private IXpElectronicFenceService xpElectronicFenceService;
@Resource
+ private XpPointMapper baseMapper;
+
+ @Resource
+ private XpAppUserCollectAddrClient xpAppUserCollectAddrClient;
+
+ @Resource
private AliOssService aliOssService;
@Override
- public NearestVo nearest(NearestDto dto) {
+ public NearestVo nearest(NearestDto dto,String uid) {
// 走缓存
Object orderDistanceObj = redisService.getCacheObject(CacheConstants.NEAR_POINT_DISTANCE);
Integer orderDistance;
@@ -117,6 +127,12 @@
if (CollUtil.isNotEmpty(fenceIds)) {
xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds);
}
+ R<List<Long>> pointIdsByUserId = null;
+ // 获取用户收藏的地址
+ if(uid!=null){
+ pointIdsByUserId = xpAppUserCollectAddrClient.getPointIdsByUserId(Long.valueOf(uid));
+ }
+
//判断当前点位是否在运营时间范围内
for (XpPoint xpPoint : list) {
@@ -164,6 +180,12 @@
nearestNextVo.setTime(xpPoint.getParkingTimeLimit());
nearestNextVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
+ // 判断是否收藏
+ if(pointIdsByUserId!=null && !pointIdsByUserId.getData().isEmpty()){
+ if(pointIdsByUserId.getData().contains(xpPoint.getId())){
+ nearestNextVo.setIsCollect(1);
+ }
+ }
nearestNextVos.add(nearestNextVo);
}
@@ -297,9 +319,11 @@
xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds);
}
-
+ // 获取用户收藏的地址
+ R<List<Long>> pointIdsByUserId = xpAppUserCollectAddrClient.getPointIdsByUserId(historyStartPointsDto.getUserId());
for (XpPoint xpPoint : xpPoints) {
+
if(xpPoint.getOperationStatus()!=2){
continue;
}
@@ -348,8 +372,14 @@
xpHistoryStartPointsVo.setDistance(distanced);
xpHistoryStartPointsVo.setTime(xpPoint.getParkingTimeLimit());
xpHistoryStartPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
- resultList.add(xpHistoryStartPointsVo);
+ // 判断是否收藏
+ if(pointIdsByUserId!=null && !pointIdsByUserId.getData().isEmpty()){
+ if(pointIdsByUserId.getData().contains(xpPoint.getId())){
+ xpHistoryStartPointsVo.setIsCollect(1);
+ }
+ }
+ resultList.add(xpHistoryStartPointsVo);
}
return resultList;
@@ -371,6 +401,9 @@
}
+
+ // 获取用户收藏的地址
+ R<List<Long>> pointIdsByUserId = xpAppUserCollectAddrClient.getPointIdsByUserId(historyEndPointsDto.getUserId());
for (XpPoint xpPoint : xpPoints) {
@@ -421,6 +454,13 @@
xpHistoryEndPointsVo.setDistance(distanced);
xpHistoryEndPointsVo.setTime(xpPoint.getParkingTimeLimit());
xpHistoryEndPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
+
+ // 判断是否收藏
+ if(pointIdsByUserId!=null && !pointIdsByUserId.getData().isEmpty()){
+ if(pointIdsByUserId.getData().contains(xpPoint.getId())){
+ xpHistoryEndPointsVo.setIsCollect(1);
+ }
+ }
resultList.add(xpHistoryEndPointsVo);
}
@@ -428,7 +468,7 @@
}
@Override
- public XpPointsSearchVo queryPointByName(PointByNameQuery query) {
+ public XpPointsSearchVo queryPointByName(PointByNameQuery query,String uid) {
XpPointsSearchVo searchVo = new XpPointsSearchVo();
List<XpPointsListVo> list = this.baseMapper.queryPointByName(query);
if (list.isEmpty()) {
@@ -444,7 +484,24 @@
if (CollUtil.isNotEmpty(fenceIds)) {
xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds);
}
+
+
+ R<List<Long>> pointIdsByUserId =null;
+ // 获取用户收藏的地址
+ if(uid!=null){
+ pointIdsByUserId = xpAppUserCollectAddrClient.getPointIdsByUserId(Long.valueOf(uid));
+ }
+
for (XpPointsListVo xpPointsListVo : list) {
+
+ // 判断是否收藏
+ if(pointIdsByUserId!=null && !pointIdsByUserId.getData().isEmpty()){
+ if(pointIdsByUserId.getData().contains(xpPointsListVo.getId())){
+ xpPointsListVo.setIsCollect(1);
+ }
+ }
+
+
Integer operationType = xpPointsListVo.getOperationType();
if(1 == operationType){
//与运营区同步
--
Gitblit v1.7.1