|
@@ -42,7 +42,8 @@ public class AccountHandler extends BaseNotifyHandler {
|
|
|
"alipay.commerce.ec.fund.change.notify",
|
|
"alipay.commerce.ec.fund.change.notify",
|
|
|
"alipay.commerce.ec.trans.authorize.notify",
|
|
"alipay.commerce.ec.trans.authorize.notify",
|
|
|
"dut_user_sign", // 安全发签约结果通知(notify_type,无 msg_method)
|
|
"dut_user_sign", // 安全发签约结果通知(notify_type,无 msg_method)
|
|
|
- "alipay.fund.expandindirect.order.changed" // 进件状态通知
|
|
|
|
|
|
|
+ "alipay.fund.expandindirect.order.changed", // 进件状态通知
|
|
|
|
|
+ "alipay.fund.trans.order.changed" // 转账/充值结果通知
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -55,6 +56,8 @@ public class AccountHandler extends BaseNotifyHandler {
|
|
|
handleAgreementSign(params);
|
|
handleAgreementSign(params);
|
|
|
} else if ("alipay.fund.expandindirect.order.changed".equals(msgMethod)) {
|
|
} else if ("alipay.fund.expandindirect.order.changed".equals(msgMethod)) {
|
|
|
handleOnboardChanged(params);
|
|
handleOnboardChanged(params);
|
|
|
|
|
+ } else if ("alipay.fund.trans.order.changed".equals(msgMethod)) {
|
|
|
|
|
+ handleTransOrderChanged(params);
|
|
|
} else if ("alipay.commerce.ec.fund.change.notify".equals(msgMethod)) {
|
|
} else if ("alipay.commerce.ec.fund.change.notify".equals(msgMethod)) {
|
|
|
handleFundChange(params);
|
|
handleFundChange(params);
|
|
|
} else if ("alipay.commerce.ec.trans.authorize.notify".equals(msgMethod)) {
|
|
} else if ("alipay.commerce.ec.trans.authorize.notify".equals(msgMethod)) {
|
|
@@ -139,6 +142,37 @@ public class AccountHandler extends BaseNotifyHandler {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 转账/充值结果通知 — alipay.fund.trans.order.changed
|
|
|
|
|
+ * 新API字段: order_id(替代order_no), pay_fund_order_id, trans_amount
|
|
|
|
|
+ */
|
|
|
|
|
+ private void handleTransOrderChanged(Map<String, String> params) {
|
|
|
|
|
+ String outBizNo = params.get("out_biz_no");
|
|
|
|
|
+ String orderId = params.get("order_id");
|
|
|
|
|
+ String status = params.get("status");
|
|
|
|
|
+ String payFundOrderId = params.get("pay_fund_order_id");
|
|
|
|
|
+ String transAmount = params.get("trans_amount");
|
|
|
|
|
+ log.info("转账通知: out_biz_no={}, order_id={}, status={}", outBizNo, orderId, status);
|
|
|
|
|
+
|
|
|
|
|
+ if (StrUtil.isBlank(outBizNo)) return;
|
|
|
|
|
+ TransferEntity transfer = transferMapper.selectOne(
|
|
|
|
|
+ new LambdaQueryWrapper<TransferEntity>()
|
|
|
|
|
+ .eq(TransferEntity::getOutBizNo, outBizNo));
|
|
|
|
|
+ if (transfer == null) return;
|
|
|
|
|
+ if (!"DEALING".equals(transfer.getStatus())) return;
|
|
|
|
|
+
|
|
|
|
|
+ if (StrUtil.isNotBlank(status)) transfer.setStatus(status);
|
|
|
|
|
+ if (StrUtil.isNotBlank(orderId)) transfer.setOrderNo(orderId);
|
|
|
|
|
+ if (StrUtil.isNotBlank(payFundOrderId)) transfer.setFundOrderId(payFundOrderId);
|
|
|
|
|
+ if (StrUtil.isNotBlank(transAmount)) {
|
|
|
|
|
+ try { transfer.setAmount(new BigDecimal(transAmount)); } catch (Exception ignored) {}
|
|
|
|
|
+ }
|
|
|
|
|
+ transfer.setNextRetryAt(null);
|
|
|
|
|
+ transfer.setRetryCount(4);
|
|
|
|
|
+ transferMapper.updateById(transfer);
|
|
|
|
|
+ log.info("转账状态更新: out_biz_no={}, status={}", outBizNo, status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 资金变更通知 -- 对应 Python _handle_fund_change
|
|
* 资金变更通知 -- 对应 Python _handle_fund_change
|
|
|
*
|
|
*
|