Bladeren bron

fix: EnterpriseHandler无PENDING兜底改log.error+return,不乱插入无tenantId数据

alphaH 1 dag geleden
bovenliggende
commit
173635bf7b

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

@@ -100,14 +100,9 @@ public class EnterpriseHandler extends BaseNotifyHandler {
             // 通知到达时本地尚未创建 → 先查预登记记录(applyInvite 创建的 PENDING 记录)
             entity = enterpriseMapper.selectByOutBizNoIgnoreTenant(outBizNo);
             if (entity == null) {
-                // PENDING 也不存在(历史数据),直接新建
-                entity = new EnterpriseEntity();
-                entity.setEnterpriseId(enterpriseId);
-                entity.setOutBizNo(outBizNo);
-                entity.setAccountId(accountId);
-                entity.setStatus(status);
-                entity.setRemark(remark);
-                enterpriseMapper.insert(entity);
+                // PENDING 也不存在,无法获取 tenantId,记录错误并跳过
+                log.error("通知找不到企业记录且无PENDING预登记: enterprise_id={}, out_biz_no={}", enterpriseId, outBizNo);
+                return;
             } else {
                 entity.setEnterpriseId(enterpriseId);
                 entity.setOutBizNo(outBizNo);