3 Commits 84b87aee89 ... f1c9ae7557

Autore SHA1 Messaggio Data
  alphaH f1c9ae7557 fix: rsaCertCheckV1传文件路径而非证书内容—先写临时文件 14 ore fa
  alphaH 251b4e745c feat: 全部getClient(enterpriseId).execute更换为certificateExecute,统一证书调用 14 ore fa
  alphaH 9f72854d0b fix: toggle转账权限后同步更新store缓存,无需刷新或切换企业即生效 15 ore fa

BIN
frontend/dist.zip


+ 5 - 0
frontend/src/views/module_payment/enterprise/index.vue

@@ -362,6 +362,11 @@ async function handleToggleTransfer(row: any) {
   try {
     await EnterpriseAPI.update(row.enterprise_id, { transfer_enabled: !row.transfer_enabled });
     row.transfer_enabled = !row.transfer_enabled;
+    // 同步更新 store 中当前企业的缓存
+    const current = enterpriseStore.currentEnterprise;
+    if (current?.enterprise_id === row.enterprise_id) {
+      enterpriseStore.currentEnterprise = { ...current, transfer_enabled: row.transfer_enabled };
+    }
     ElMessage.success(row.transfer_enabled ? "已开通转账功能" : "已关闭转账功能");
   } catch {
     ElMessage.error("操作失败");

+ 3 - 3
java/src/main/java/com/payment/platform/module/payment/account/service/AccountService.java

@@ -241,7 +241,7 @@ public class AccountService {
             request.setBizModel(model);
 
             AlipayCommerceEcConsumeDetailQueryResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (response == null) throw new BusinessException(400, "账单详情查询失败: 无响应");
             if (!response.isSuccess()) {
                 log.error("支付宝账单详情查询失败: code={}, msg={}, subMsg={}",
@@ -407,7 +407,7 @@ public class AccountService {
             var request = new com.alipay.api.request.AlipayCommerceEcTransReceiptApplyRequest();
             request.setBizModel(model);
 
-            var response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            var response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (response == null) throw new BusinessException(400, "申请回单失败: 无响应");
             if (!response.isSuccess()) {
                 redisTemplate.delete(cacheKey);
@@ -439,7 +439,7 @@ public class AccountService {
             var request = new com.alipay.api.request.AlipayCommerceEcTransReceiptQueryRequest();
             request.setBizModel(model);
 
-            var response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            var response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (response == null) throw new BusinessException(400, "查询回单失败: 无响应");
             if (!response.isSuccess())
                 throw new BusinessException(400, "查询回单失败: " +

+ 8 - 8
java/src/main/java/com/payment/platform/module/payment/account/service/AlipayTransferService.java

@@ -184,7 +184,7 @@ public class AlipayTransferService {
             request.setBizModel(model);
 
             AlipayUserAgreementQueryResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "查询签约状态失败: " + response.getMsg());
@@ -236,7 +236,7 @@ public class AlipayTransferService {
             FileItem fileItem = new FileItem(fileName, fileBytes, mimeType);
             request.setImageContent(fileItem);
             AlipayFundExpandindirectImageUploadResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess())
                 throw new BusinessException(400, "上传进件图片失败: " + response.getMsg());
             return response.getImageId();
@@ -275,7 +275,7 @@ public class AlipayTransferService {
             AlipayFundExpandindirectCreateRequest request = new AlipayFundExpandindirectCreateRequest();
             request.setBizModel(model);
             AlipayFundExpandindirectCreateResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess())
                 throw new BusinessException(400, "创建进件单失败: " + response.getMsg());
 
@@ -305,7 +305,7 @@ public class AlipayTransferService {
             AlipayFundExpandindirectOrderQueryRequest request = new AlipayFundExpandindirectOrderQueryRequest();
             request.setBizModel(model);
             AlipayFundExpandindirectOrderQueryResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess())
                 throw new BusinessException(400, "查询进件状态失败: " + response.getMsg());
             return Map.of("order_id", orderId,
@@ -325,7 +325,7 @@ public class AlipayTransferService {
             AlipayFundExpandindirectOrderCancelRequest request = new AlipayFundExpandindirectOrderCancelRequest();
             request.setBizModel(model);
             AlipayFundExpandindirectOrderCancelResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess())
                 throw new BusinessException(400, "取消进件单失败: " + response.getMsg());
         } catch (AlipayApiException e) {
@@ -378,7 +378,7 @@ public class AlipayTransferService {
             request.setBizModel(model);
 
             AlipayFundAccountbookCreateResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "开通资金记账本失败: " + response.getMsg());
@@ -572,7 +572,7 @@ public class AlipayTransferService {
             request.setBizModel(model);
 
             AlipayFundTransUniTransferResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             String subCode = response.getSubCode() != null ? response.getSubCode() : "";
             String subMsg = response.getSubMsg() != null ? response.getSubMsg() : "";
@@ -657,7 +657,7 @@ public class AlipayTransferService {
                 request.setBizModel(model);
 
                 AlipayFundAccountbookQueryResponse response =
-                        alipayClientFactory.getClient(enterpriseId).execute(request);
+                        alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
                 if (response.isSuccess()) {
                     Map<String, Object> m = new LinkedHashMap<>();

+ 3 - 3
java/src/main/java/com/payment/platform/module/payment/department/service/AlipayDepartmentService.java

@@ -41,7 +41,7 @@ public class AlipayDepartmentService {
             AlipayCommerceEcDepartmentCreateRequest request = new AlipayCommerceEcDepartmentCreateRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcDepartmentCreateResponse response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            AlipayCommerceEcDepartmentCreateResponse response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 throw new BusinessException(400,
@@ -76,7 +76,7 @@ public class AlipayDepartmentService {
             AlipayCommerceEcDepartmentInfoModifyRequest request = new AlipayCommerceEcDepartmentInfoModifyRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcDepartmentInfoModifyResponse response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            AlipayCommerceEcDepartmentInfoModifyResponse response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 throw new BusinessException(400,
@@ -99,7 +99,7 @@ public class AlipayDepartmentService {
             AlipayCommerceEcDepartmentDeleteRequest request = new AlipayCommerceEcDepartmentDeleteRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcDepartmentDeleteResponse response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            AlipayCommerceEcDepartmentDeleteResponse response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 throw new BusinessException(400,

+ 5 - 5
java/src/main/java/com/payment/platform/module/payment/employee/service/AlipayEmployeeService.java

@@ -68,7 +68,7 @@ public class AlipayEmployeeService {
             AlipayCommerceEcEmployeeAddRequest request = new AlipayCommerceEcEmployeeAddRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcEmployeeAddResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+            AlipayCommerceEcEmployeeAddResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "添加员工失败: " + (response.getSubMsg() != null ? response.getSubMsg() : response.getMsg()));
@@ -165,7 +165,7 @@ public class AlipayEmployeeService {
             AlipayCommerceEcEmployeeInfoQueryRequest request = new AlipayCommerceEcEmployeeInfoQueryRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcEmployeeInfoQueryResponse response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            AlipayCommerceEcEmployeeInfoQueryResponse response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "查询员工详情失败: " + response.getMsg());
@@ -231,7 +231,7 @@ public class AlipayEmployeeService {
             AlipayCommerceEcEmployeeInviteQueryRequest request = new AlipayCommerceEcEmployeeInviteQueryRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcEmployeeInviteQueryResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+            AlipayCommerceEcEmployeeInviteQueryResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "获取签约链接失败: " + response.getSubMsg());
@@ -261,7 +261,7 @@ public class AlipayEmployeeService {
             AlipayCommerceEcEmployeeInfoModifyRequest request = new AlipayCommerceEcEmployeeInfoModifyRequest();
             request.setBizModel(model);
             AlipayCommerceEcEmployeeInfoModifyResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "修改员工信息失败: " + response.getMsg());
             }
@@ -282,7 +282,7 @@ public class AlipayEmployeeService {
             AlipayCommerceEcEmployeeDeleteRequest request = new AlipayCommerceEcEmployeeDeleteRequest();
             request.setBizModel(model);
 
-            AlipayCommerceEcEmployeeDeleteResponse response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            AlipayCommerceEcEmployeeDeleteResponse response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess())
                 throw new BusinessException(400, "删除员工失败: " + (response.getSubMsg() != null ? response.getSubMsg() : response.getMsg()));

+ 4 - 4
java/src/main/java/com/payment/platform/module/payment/enterprise/service/AlipayEnterpriseService.java

@@ -42,7 +42,7 @@ public class AlipayEnterpriseService {
             request.setBizModel(model);
 
             AlipayCommerceEcEnterpriseRegisterinviteCreateResponse response =
-                    alipayClientFactory.getClientByProvider(Long.valueOf(data.get("service_provider_id").toString())).execute(request);
+                    alipayClientFactory.getClientByProvider(Long.valueOf(data.get("service_provider_id").toString())).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 log.error("支付宝邀请码申请失败: {}", JSONObject.toJSONString(response));
@@ -95,7 +95,7 @@ public class AlipayEnterpriseService {
             request.setBizModel(model);
 
             AlipayCommerceEcEnterpriseInfoQueryResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 log.error("支付宝企业信息查询失败: {} - {}", response.getCode(), response.getMsg());
@@ -134,7 +134,7 @@ public class AlipayEnterpriseService {
             request.setBizModel(model);
 
             AlipayCommerceEcEnterpriseUnsignResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 log.error("支付宝企业解约失败: {} - {}", response.getCode(), response.getMsg());
@@ -167,7 +167,7 @@ public class AlipayEnterpriseService {
             request.setBizModel(model);
 
             AlipayCommerceEcEnterpriseDeleteResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 log.error("支付宝企业注销失败: {} - {}", response.getCode(), response.getMsg());

+ 11 - 11
java/src/main/java/com/payment/platform/module/payment/expense/institution/service/InstitutionService.java

@@ -216,7 +216,7 @@ public class InstitutionService {
      *   // ... set other fields
      *   AlipayEbppInvoiceInstitutionCreateRequest request = new AlipayEbppInvoiceInstitutionCreateRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceInstitutionCreateResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceInstitutionCreateResponse response = alipayClientFactory.getClient().certificateExecute(request);
      *   if (!response.isSuccess()) throw new BusinessException(400, "创建费控制度失败: " + response.getSubMsg());
      *   String institutionId = response.getInstitutionId(); // 支付宝返回的 institution_id
      * </pre>
@@ -674,7 +674,7 @@ public class InstitutionService {
      *     // ... set other fields
      *     AlipayEbppInvoiceInstitutionModifyRequest request = new AlipayEbppInvoiceInstitutionModifyRequest();
      *     request.setBizModel(model);
-     *     AlipayEbppInvoiceInstitutionModifyResponse response = alipayClientFactory.getClient().execute(request);
+     *     AlipayEbppInvoiceInstitutionModifyResponse response = alipayClientFactory.getClient().certificateExecute(request);
      *     if (!response.isSuccess()) throw new BusinessException(400, "修改费控制度失败: " + response.getSubMsg());
      *     // 同步更新本地 DB
      * </pre>
@@ -953,7 +953,7 @@ public class InstitutionService {
      * 调用支付宝 alipay.ebpp.invoice.institution.delete (已实现):
      *   AlipayEbppInvoiceInstitutionDeleteRequest request = new AlipayEbppInvoiceInstitutionDeleteRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceInstitutionDeleteResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceInstitutionDeleteResponse response = alipayClientFactory.getClient().certificateExecute(request);
      *   // 支付宝侧已删除时忽略错误, 始终清理本地关联表
      * </pre>
      */
@@ -1036,7 +1036,7 @@ public class InstitutionService {
      *   model.setPageSize(pageSize);
      *   AlipayEbppInvoiceInstitutionScopepageinfoQueryRequest request = new AlipayEbppInvoiceInstitutionScopepageinfoQueryRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceInstitutionScopepageinfoQueryResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceInstitutionScopepageinfoQueryResponse response = alipayClientFactory.getClient().certificateExecute(request);
      * </pre>
      */
     public Map<String, Object> listScope(String institutionId, String enterpriseId,
@@ -1123,7 +1123,7 @@ public class InstitutionService {
      *   // add_owner_id_list / delete_owner_id_list ...
      *   AlipayEbppInvoiceInstitutionScopeModifyRequest request = new AlipayEbppInvoiceInstitutionScopeModifyRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceInstitutionScopeModifyResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceInstitutionScopeModifyResponse response = alipayClientFactory.getClient().certificateExecute(request);
      * </pre>
      */
     /**
@@ -1309,7 +1309,7 @@ public class InstitutionService {
      *   model.setEnterpriseId((String) data.get("enterprise_id"));
      *   AlipayEbppInvoiceIssueruleCreateRequest request = new AlipayEbppInvoiceIssueruleCreateRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceIssueruleCreateResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceIssueruleCreateResponse response = alipayClientFactory.getClient().certificateExecute(request);
      * </pre>
      */
     @Transactional
@@ -1353,7 +1353,7 @@ public class InstitutionService {
                     new AlipayEbppInvoiceIssueruleCreateRequest();
             request.setBizModel(model);
             AlipayEbppInvoiceIssueruleCreateResponse response =
-                    alipayClientFactory.getClient((String) data.get("enterprise_id")).execute(request);
+                    alipayClientFactory.getClient((String) data.get("enterprise_id")).certificateExecute(request);
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "创建发放规则失败: " +
                         (response.getSubMsg() != null ? response.getSubMsg() : response.getMsg()));
@@ -1380,7 +1380,7 @@ public class InstitutionService {
      *   model.setEnterpriseId((String) body.get("enterprise_id"));
      *   AlipayEbppInvoiceIssueruleDeleteRequest request = new AlipayEbppInvoiceIssueruleDeleteRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceIssueruleDeleteResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceIssueruleDeleteResponse response = alipayClientFactory.getClient().certificateExecute(request);
      * </pre>
      */
     @Transactional
@@ -1400,7 +1400,7 @@ public class InstitutionService {
                     new AlipayEbppInvoiceIssueruleDeleteRequest();
             request.setBizModel(model);
             AlipayEbppInvoiceIssueruleDeleteResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "删除发放规则失败: " +
                         (response.getSubMsg() != null ? response.getSubMsg() : response.getMsg()));
@@ -1432,7 +1432,7 @@ public class InstitutionService {
      *   model.setEnterpriseId((String) data.get("enterprise_id"));
      *   AlipayEbppInvoiceIssueruleModifyRequest request = new AlipayEbppInvoiceIssueruleModifyRequest();
      *   request.setBizModel(model);
-     *   AlipayEbppInvoiceIssueruleModifyResponse response = alipayClientFactory.getClient().execute(request);
+     *   AlipayEbppInvoiceIssueruleModifyResponse response = alipayClientFactory.getClient().certificateExecute(request);
      * </pre>
      */
     @Transactional
@@ -1474,7 +1474,7 @@ public class InstitutionService {
                     new AlipayEbppInvoiceIssueruleModifyRequest();
             request.setBizModel(model);
             AlipayEbppInvoiceIssueruleModifyResponse response =
-                    alipayClientFactory.getClient((String) data.get("enterprise_id")).execute(request);
+                    alipayClientFactory.getClient((String) data.get("enterprise_id")).certificateExecute(request);
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "修改发放规则失败: " +
                         (response.getSubMsg() != null ? response.getSubMsg() : response.getMsg()));

+ 5 - 5
java/src/main/java/com/payment/platform/module/payment/expense/quota/service/QuotaService.java

@@ -140,7 +140,7 @@ public class QuotaService {
                 request.setBizModel(model);
 
                 AlipayEbppInvoiceExpensecontrolQuotaModifyResponse response =
-                        alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+                        alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
                 if (response == null) {
                     throw new BusinessException(400, "支付宝更新额度失败: 无响应");
@@ -338,7 +338,7 @@ public class QuotaService {
             AlipayEbppInvoiceExpensecontrolQuotaCreateRequest request = new AlipayEbppInvoiceExpensecontrolQuotaCreateRequest();
             request.setBizModel(model);
 
-            AlipayEbppInvoiceExpensecontrolQuotaCreateResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+            AlipayEbppInvoiceExpensecontrolQuotaCreateResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "支付宝创建费用报销失败: "
@@ -370,7 +370,7 @@ public class QuotaService {
             AlipayEbppInvoiceExpensecontrolQuotaQueryRequest request = new AlipayEbppInvoiceExpensecontrolQuotaQueryRequest();
             request.setBizModel(model);
 
-            AlipayEbppInvoiceExpensecontrolQuotaQueryResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+            AlipayEbppInvoiceExpensecontrolQuotaQueryResponse response = alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 throw new BusinessException(400, "支付宝查询费用报销失败: "
@@ -451,7 +451,7 @@ public class QuotaService {
             request.setBizModel(model);
 
             AlipayEbppInvoiceExpensecontrolQuotaModifyResponse response =
-                    alipayClientFactory.getClient(model.getEnterpriseId()).execute(request);
+                    alipayClientFactory.getClient(model.getEnterpriseId()).certificateExecute(request);
 
             if (response == null) {
                 throw new BusinessException(400, "修改额度失败: 支付宝无响应");
@@ -603,7 +603,7 @@ public class QuotaService {
             request.setBizModel(model);
 
             AlipayEbppInvoiceExpensecomsueOutsourceNotifyResponse response =
-                    alipayClientFactory.getClient(enterpriseId).execute(request);
+                    alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
 
             if (!response.isSuccess()) {
                 log.error("外部消费额度同步失败: code={}, msg={}, subCode={}, subMsg={}",

+ 1 - 1
java/src/main/java/com/payment/platform/module/payment/notification/handler/BillHandler.java

@@ -259,7 +259,7 @@ public class BillHandler extends BaseNotifyHandler {
 
         AlipayCommerceEcConsumeDetailQueryResponse response;
         try {
-            response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
         } catch (AlipayApiException e) {
             throw new RuntimeException("账单详情查询异常: " + e.getMessage(), e);
         }

+ 1 - 1
java/src/main/java/com/payment/platform/module/payment/notification/handler/VoucherHandler.java

@@ -136,7 +136,7 @@ public class VoucherHandler extends BaseNotifyHandler {
 
         AlipayCommerceEcConsumeDetailQueryResponse response;
         try {
-            response = alipayClientFactory.getClient(enterpriseId).execute(request);
+            response = alipayClientFactory.getClient(enterpriseId).certificateExecute(request);
         } catch (AlipayApiException e) {
             log.warn("查询账单详情失败(不影响凭证处理): pay_no={}, error={}", payNo, e.getMessage());
             return;

+ 14 - 3
java/src/main/java/com/payment/platform/module/payment/notification/service/NotificationService.java

@@ -111,9 +111,20 @@ public class NotificationService {
                 }
             }
             // 服务商配置了证书则用证书验签,否则回退普通公钥
-            boolean verified = StrUtil.isNotBlank(alipayPublicCert)
-                    ? AlipaySignature.rsaCertCheckV1(params, alipayPublicCert, charset, signType)
-                    : AlipaySignature.rsaCheckV1(params, alipayPublicKey, charset, signType);
+            boolean verified;
+            if (StrUtil.isNotBlank(alipayPublicCert)) {
+                // rsaCertCheckV1 第二个参数是文件路径,证书内容需先写临时文件
+                java.nio.file.Path certPath = java.nio.file.Files.createTempFile("alipay_cert_", ".crt");
+                java.nio.file.Files.writeString(certPath, alipayPublicCert);
+                try {
+                    verified = AlipaySignature.rsaCertCheckV1(params,
+                            certPath.toAbsolutePath().toString(), charset, signType);
+                } finally {
+                    java.nio.file.Files.deleteIfExists(certPath);
+                }
+            } else {
+                verified = AlipaySignature.rsaCheckV1(params, alipayPublicKey, charset, signType);
+            }
             entry.setVerifyResult(verified);
             if (!verified) {
                 log.warn("支付宝通知验签失败: notify_id={}", notifyId);