yeg
2026-09-14 7217e095eda8326e24aaef7b72c11d16f88e8742
feat(payment): 进件时自动开启结算并配置好资金能力

- 企业与个人进件的 settle_config 默认 settle_status=1、settle_cycle=D1、批次结算,
且不设起结金额与留存金额,1 分钱也结得出去
- 商户进件完成后无需再去控台配置结算,核销确认的钱由斗拱按周期自动划到结算卡
2个文件已修改
22 ■■■■■ 已修改文件
talent-card-server/src/main/java/com/talentcard/server/business/payment/huifu/HuifuEnterpriseOnboardingGateway.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/payment/huifu/HuifuIndividualOnboardingGateway.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/payment/huifu/HuifuEnterpriseOnboardingGateway.java
@@ -94,6 +94,7 @@
        putIfPresent(request, "settle_cert_front_pic", command.settlementCertificateFrontPictureId());
        putIfPresent(request, "settle_cert_back_pic", command.settlementCertificateBackPictureId());
        request.put("cash_config", JSON.toJSONString(List.of(cash)));
        request.put("settle_config", JSON.toJSONString(settleConfig()));
        putIfPresent(request, "async_return_url", properties.getMerchantOnboardingNotifyUrl());
        try {
            synchronized (SDK_LOCK) {
@@ -110,6 +111,25 @@
        }
    }
    /**
     * 结算配置:进件即打开自动结算,让核销确认后的钱由斗拱按结算周期自动划到结算卡,
     * 商户和平台都不需要再手工发起出款。
     *
     * <p>不设起结金额与留存金额:一笔 1 分钱也要能结出去。结算周期由渠道商开通的业务类型决定,
     * 当前可用的是 D1(次自然日到账)。
     */
    static Map<String, Object> settleConfig() {
        Map<String, Object> settle = new LinkedHashMap<>();
        settle.put("settle_status", "1");
        settle.put("settle_cycle", "D1");
        settle.put("settle_pattern", "P0");
        settle.put("min_amt", "0.00");
        settle.put("remained_amt", "0.00");
        settle.put("out_settle_flag", "2");
        settle.put("fee_rate", "0.00");
        return settle;
    }
    private void ensureConfigured() {
        if (!properties.isEnabled()) throw new BusinessException(ErrorCode.CONFLICT, "Huifu payment is disabled");
        if (blank(properties.getSystemId()) || blank(properties.getProductId()) || blank(properties.getOnboardingUpperHuifuId()) || blank(properties.getPrivateKey()) || blank(properties.getPlatformPublicKey())) throw new BusinessException(ErrorCode.CONFLICT, "Huifu merchant onboarding configuration is incomplete");
talent-card-server/src/main/java/com/talentcard/server/business/payment/huifu/HuifuIndividualOnboardingGateway.java
@@ -71,6 +71,8 @@
        request.put("card_info", JSON.toJSONString(card));
        request.put("settle_card_front_pic", command.settlementCardFrontPictureId());
        request.put("cash_config", JSON.toJSONString(List.of(cash)));
        // 与商户主体一致:进件即打开自动结算,核销确认后的钱由斗拱按结算周期自动划到结算卡。
        request.put("settle_config", JSON.toJSONString(HuifuEnterpriseOnboardingGateway.settleConfig()));
        putIfPresent(request, "async_return_url", properties.getMerchantOnboardingNotifyUrl());
        try {
            synchronized (SDK_LOCK) {