package com.talentcard.server.business.merchant; import org.springframework.boot.context.properties.ConfigurationProperties; /** * 每日自动提现汇总与结果处理的开关。汇总按整数分计算,和库里的金额列一致。 * *
不设最低提现金额:斗拱主动取现没有最低金额,取现也不收手续费(手续费在支付时已经内扣), * 所以只要当天有已核销订单就出账,金额小也照提(CONTEXT.md「可提现订单」)。 */ @ConfigurationProperties(prefix = "app.merchant.auto-withdrawal") public class AutoWithdrawalProperties { /** 任务是否启用。凌晨的定时任务按北京时间触发,本地开发可以关掉。 */ private boolean enabled = true; /** 每天触发日汇总的时间(北京时间,cron 的 秒 分 时 日 月 周)。由 AutoWithdrawalScheduler 的 @Scheduled 从配置读取。 */ private String cron = "0 10 0 * * *"; /** * 同一订单最多进入几条提现记录:斗拱确认失败后订单解锁并顺延,累计尝试达到这个上限就不再自动 * 重试,金额留在失败记录里等人处理,避免无限重试。 */ private int maxAttempts = 3; /** * 提交后多久才允许查询结果(分钟)。刚提交时通道可能还没落库,过早查询会把「查不到」误判成失败 * 并解锁订单,所以处理中的记录至少等这么久再查一次。 */ private int queryAfterMinutes = 5; /** 一次任务最多提交/查询多少条记录,避免一次扫描过重的批次。 */ private int batchSize = 100; /** 结果处理任务(补交待提交记录 + 查询处理中记录)是否启用。 */ private boolean resultCheckEnabled = true; public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public String getCron() { return cron; } public void setCron(String cron) { this.cron = cron; } public int getMaxAttempts() { return maxAttempts; } public void setMaxAttempts(int maxAttempts) { this.maxAttempts = maxAttempts; } public int getQueryAfterMinutes() { return queryAfterMinutes; } public void setQueryAfterMinutes(int queryAfterMinutes) { this.queryAfterMinutes = queryAfterMinutes; } public int getBatchSize() { return batchSize; } public void setBatchSize(int batchSize) { this.batchSize = batchSize; } public boolean isResultCheckEnabled() { return resultCheckEnabled; } public void setResultCheckEnabled(boolean resultCheckEnabled) { this.resultCheckEnabled = resultCheckEnabled; } }