Przeglądaj źródła

fix: 进件通知增加rows检查和outBizNo兜底查询,定位静默失败

alphaH 8 godzin temu
rodzic
commit
8adab022f0

BIN
frontend/dist.zip


+ 14 - 3
java/src/main/java/com/payment/platform/module/payment/notification/handler/AccountHandler.java

@@ -136,11 +136,22 @@ public class AccountHandler extends BaseNotifyHandler {
         var accounts = accountMapper.selectList(
                 new LambdaQueryWrapper<AccountEntity>()
                         .eq(AccountEntity::getOnboardOrderId, orderId));
+        if (accounts.isEmpty()) {
+            // fallback: 用 outBizNo 查
+            if (outBizNo != null) {
+                accounts = accountMapper.selectList(
+                        new LambdaQueryWrapper<AccountEntity>()
+                                .eq(AccountEntity::getOnboardOutBizNo, outBizNo));
+            }
+        }
         for (AccountEntity acc : accounts) {
             acc.setOnboardStatus(status != null ? status : "PENDING");
-            accountMapper.updateById(acc);
-            log.info("进件状态更新: enterpriseId={}, orderId={}, status={}",
-                    acc.getEnterpriseId(), orderId, status);
+            int rows = accountMapper.updateById(acc);
+            log.info("进件状态更新: enterpriseId={}, orderId={}, status={}, rows={}",
+                    acc.getEnterpriseId(), orderId, status, rows);
+        }
+        if (accounts.isEmpty()) {
+            log.warn("进件通知未匹配到账户: orderId={}, outBizNo={}", orderId, outBizNo);
         }
     }