ソースを参照

@
fix: AccountHandler.deductPoints 改用 selectByEnterpriseIdIgnoreTenant
@

alphaH 6 時間 前
コミット
55016b7e1c

+ 2 - 4
java/src/main/java/com/payment/platform/module/payment/notification/handler/AccountHandler.java

@@ -175,10 +175,8 @@ public class AccountHandler extends BaseNotifyHandler {
      * 对应 Python PointsService.deduct_points_service
      */
     private void deductPoints(String enterpriseId, String outBizNo, BigDecimal amount) {
-        // 通过 enterprise 反查 tenant_id
-        EnterpriseEntity enterprise = enterpriseMapper.selectOne(
-                new LambdaQueryWrapper<EnterpriseEntity>()
-                        .eq(EnterpriseEntity::getEnterpriseId, enterpriseId));
+        // 通过 enterprise 反查 tenant_id(跳过租户过滤,通知回调无认证上下文)
+        EnterpriseEntity enterprise = enterpriseMapper.selectByEnterpriseIdIgnoreTenant(enterpriseId);
         if (enterprise == null || enterprise.getTenantId() == null) {
             log.warn("扣除积分跳过: 企业无tenant_id, enterprise_id={}", enterpriseId);
             return;