From 43e9944347e51d5628166f8c1b78d98cfd2013ea Mon Sep 17 00:00:00 2001
From: yyy <1083599556@qq.com>
Date: 星期三, 22 四月 2026 22:12:22 +0800
Subject: [PATCH] 1.调试接口修改问题 2.修改定向服务的播单和 改派
---
xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java b/xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java
index 96df056..462bc7d 100644
--- a/xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java
+++ b/xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java
@@ -5,6 +5,8 @@
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
+
+import com.xiaopeng.common.core.constant.CacheConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.script.DefaultRedisScript;
@@ -412,4 +414,46 @@
Set<String> keys = redisTemplate.keys(name + "*");
return keys;
}
+
+ public void setCacheCancelOrder(String key) {
+ // 获取缓存中的值
+ Object value = redisTemplate.opsForValue().get(key);
+ if (value != null) {
+ // 缓存中的值减1
+ int newValue = Integer.parseInt(value.toString()) - 1;
+ // 更新缓存中的值
+ redisTemplate.opsForValue().set(key, newValue);
+ }
+ }
+
+ /**
+ * 添加 KEY
+ * @param xpPointId 点位id
+ * @param pointLon 经度
+ * @param pointLat 纬度
+ * @return
+ */
+ public String redisKey_QUEUE_POINT_ID(Long xpPointId,Double pointLon,Double pointLat){
+ String key = CacheConstants.QUEUE_POINT_ID + "-" + xpPointId + "-" + pointLon + "," + pointLat;
+ return key;
+ }
+
+ /**
+ *
+ * @param orderId 订单id
+ * @param pointLon 经度
+ * @param pointLat 纬度
+ * @param uid 用户id
+ * @param orderNumber 订单编码
+ * @param distance 距离 米
+ * @param duration 时间
+ * @param planRuleForQueue 选中路线对应的高德
+ * @param targetedVal 是否定向 0 不定向 ,1-100 定向
+ * @return
+ */
+ public String redisValue_QUEUE_POINT_ID(String orderId,String pointLon,String pointLat,String uid,String orderNumber ,String distance,String duration,String planRuleForQueue,Integer targetedVal){
+ return orderId + "_" + pointLon + "," + pointLat + "_0" + "_" + uid + "_" + orderNumber + "_" + distance + "_" + duration + "_" + planRuleForQueue+"_" + targetedVal;
+ }
+
+
}
--
Gitblit v1.7.1