From c7bf4639bbd8b0667c3f57823ebde741295c3189 Mon Sep 17 00:00:00 2001 From: duzhichao <1098974448@qq.com> Date: Wed, 24 Jun 2026 19:28:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98=E5=AE=9D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/central/order/controller/AliPayController.java | 8 ++++---- .../order/service/impl/AlipayConfigServiceImpl.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/zlt-business/order-center/src/main/java/com/central/order/controller/AliPayController.java b/zlt-business/order-center/src/main/java/com/central/order/controller/AliPayController.java index 0714d1ca..a6dff432 100644 --- a/zlt-business/order-center/src/main/java/com/central/order/controller/AliPayController.java +++ b/zlt-business/order-center/src/main/java/com/central/order/controller/AliPayController.java @@ -169,9 +169,9 @@ public class AliPayController { // ISV(服务商)模式下应优先使用 auth_app_id 定位商家应用 String authAppId = params.get("auth_app_id"); String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId; - AlipayConfig config = alipayConfigService.getConfigByAppId(lookupAppId); + AlipayConfig config = alipayConfigService.getConfigByAppIdAndType(lookupAppId, "PAY"); if (config == null) { - log.error("支付宝配置不存在,appId: {}, authAppId: {}", appId, authAppId); + log.error("支付宝支付配置不存在,appId: {}, authAppId: {}", appId, authAppId); return "failure"; } TenantContextHolder.setTenant(config.getTenantId()); @@ -300,9 +300,9 @@ public class AliPayController { // ISV 模式下应使用 auth_app_id 定位商家应用 String authAppId = params.get("auth_app_id"); String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId; - AlipayConfig config = alipayConfigService.getConfigByAppId(lookupAppId); + AlipayConfig config = alipayConfigService.getConfigByAppIdAndType(lookupAppId, "PAY"); if (config == null) { - log.error("支付宝配置不存在,appId: {}, authAppId: {}", appId, authAppId); + log.error("支付宝支付配置不存在,appId: {}, authAppId: {}", appId, authAppId); return "failure"; } TenantContextHolder.setTenant(config.getTenantId()); diff --git a/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java b/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java index 4c915281..7ecb4987 100644 --- a/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java +++ b/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java @@ -59,7 +59,8 @@ public class AlipayConfigServiceImpl public AlipayConfig getConfigByAppId(String appId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(AlipayConfig::getAppId, appId) - .eq(AlipayConfig::getStatus, 1); + .eq(AlipayConfig::getStatus, 1) + .last("LIMIT 1"); return baseMapper.selectOne(wrapper); }