Bladeren bron

fix: 通知查PENDING记录跳过租户过滤,避免无认证上下文时查不到

alphaH 1 dag geleden
bovenliggende
commit
2322ad3235

+ 8 - 0
java/src/main/java/com/payment/platform/module/payment/enterprise/mapper/EnterpriseMapper.java

@@ -1,9 +1,17 @@
 package com.payment.platform.module.payment.enterprise.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.payment.platform.module.payment.enterprise.entity.EnterpriseEntity;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 @Mapper
 public interface EnterpriseMapper extends BaseMapper<EnterpriseEntity> {
+
+    /** 通知处理用 — 按 outBizNo 查 PENDING 记录,跳过租户过滤 */
+    @InterceptorIgnore(tenantLine = "true")
+    @Select("SELECT * FROM pay_enterprise WHERE out_biz_no = #{outBizNo}")
+    EnterpriseEntity selectByOutBizNoIgnoreTenant(@Param("outBizNo") String outBizNo);
 }

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

@@ -102,9 +102,7 @@ public class EnterpriseHandler extends BaseNotifyHandler {
             // 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
             EnterpriseEntity pending = null;
             if (StrUtil.isNotBlank(outBizNo)) {
-                pending = enterpriseMapper.selectOne(
-                        new LambdaQueryWrapper<EnterpriseEntity>()
-                                .eq(EnterpriseEntity::getOutBizNo, outBizNo));
+                pending = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
             }
             entity = new EnterpriseEntity();
             entity.setEnterpriseId(enterpriseId);