|
@@ -989,12 +989,15 @@ public class PayScoreServiceImpl implements PayScoreService {
|
|
|
*/
|
|
*/
|
|
|
public void applyPreAuthPayScore(Order order) {
|
|
public void applyPreAuthPayScore(Order order) {
|
|
|
if (stringRedisTemplate == null || order == null) {
|
|
if (stringRedisTemplate == null || order == null) {
|
|
|
|
|
+ log.warn("[支付分服务] 无法关联预授权 - stringRedisTemplate={}, order={}",
|
|
|
|
|
+ stringRedisTemplate != null, order != null);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String redisKey = REDIS_KEY_PREFIX + order.getDeviceId() + ":" + order.getUserId();
|
|
String redisKey = REDIS_KEY_PREFIX + order.getDeviceId() + ":" + order.getUserId();
|
|
|
String jsonStr = stringRedisTemplate.opsForValue().get(redisKey);
|
|
String jsonStr = stringRedisTemplate.opsForValue().get(redisKey);
|
|
|
if (jsonStr == null) {
|
|
if (jsonStr == null) {
|
|
|
|
|
+ log.warn("[支付分服务] Redis中未找到预授权信息 - key: {}", redisKey);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1017,6 +1020,8 @@ public class PayScoreServiceImpl implements PayScoreService {
|
|
|
// 从追踪 SET 中移除,订单已正常关联不再需要清理
|
|
// 从追踪 SET 中移除,订单已正常关联不再需要清理
|
|
|
stringRedisTemplate.opsForSet().remove(REDIS_TRACKING_KEY + order.getUserId(), payScoreOrderId);
|
|
stringRedisTemplate.opsForSet().remove(REDIS_TRACKING_KEY + order.getUserId(), payScoreOrderId);
|
|
|
log.info("[支付分服务] 预授权信息已关联到订单 - orderId: {}, payScoreOrderId: {}", order.getId(), payScoreOrderId);
|
|
log.info("[支付分服务] 预授权信息已关联到订单 - orderId: {}, payScoreOrderId: {}", order.getId(), payScoreOrderId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("[支付分服务] 预授权JSON中payScoreOrderId为null - key: {}, json: {}", redisKey, jsonStr);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("[支付分服务] 关联预授权信息失败 - orderId: {}", order.getId(), e);
|
|
log.error("[支付分服务] 关联预授权信息失败 - orderId: {}", order.getId(), e);
|