mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-08-13 01:33:42 +08:00
update
This commit is contained in:
@@ -0,0 +1,163 @@
|
|||||||
|
package com.jsowell.common.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无交易记录自动结算配置
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "auto-settle")
|
||||||
|
public class AutoSettleConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总开关,默认关闭
|
||||||
|
*/
|
||||||
|
private boolean enabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止充电超时阈值(分钟),超过此时间未收到交易记录则触发自动结算
|
||||||
|
*/
|
||||||
|
private int timeoutMinutes = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务扫描周期(Cron表达式),每10分钟扫描一次
|
||||||
|
*/
|
||||||
|
private String interval = "0 */10 * * * ?";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 灰度站点白名单(站点ID列表),仅对这些站点启用自动结算
|
||||||
|
*/
|
||||||
|
private List<Long> grayscaleStationIds = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额异常阈值倍数,chargingAmount > payAmount * 此值时告警跳过
|
||||||
|
*/
|
||||||
|
private double amountThresholdRatio = 1.5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单次扫描订单数量上限,防止一次查询过多订单
|
||||||
|
*/
|
||||||
|
private int batchSize = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实时数据新鲜度阈值(分钟),数据超过此时间未更新视为桩假在线
|
||||||
|
*/
|
||||||
|
private int dataFreshnessMinutes = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警开关
|
||||||
|
*/
|
||||||
|
private boolean alertEnabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redis分布式锁超时时间(秒)
|
||||||
|
*/
|
||||||
|
private int lockTimeoutSeconds = 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败是否重试,建议false等待下一轮扫描
|
||||||
|
*/
|
||||||
|
private boolean retryOnFailure = false;
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(boolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimeoutMinutes() {
|
||||||
|
return timeoutMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeoutMinutes(int timeoutMinutes) {
|
||||||
|
this.timeoutMinutes = timeoutMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterval() {
|
||||||
|
return interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterval(String interval) {
|
||||||
|
this.interval = interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Long> getGrayscaleStationIds() {
|
||||||
|
return grayscaleStationIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrayscaleStationIds(List<Long> grayscaleStationIds) {
|
||||||
|
this.grayscaleStationIds = grayscaleStationIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAmountThresholdRatio() {
|
||||||
|
return amountThresholdRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmountThresholdRatio(double amountThresholdRatio) {
|
||||||
|
this.amountThresholdRatio = amountThresholdRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBatchSize() {
|
||||||
|
return batchSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatchSize(int batchSize) {
|
||||||
|
this.batchSize = batchSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDataFreshnessMinutes() {
|
||||||
|
return dataFreshnessMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataFreshnessMinutes(int dataFreshnessMinutes) {
|
||||||
|
this.dataFreshnessMinutes = dataFreshnessMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAlertEnabled() {
|
||||||
|
return alertEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlertEnabled(boolean alertEnabled) {
|
||||||
|
this.alertEnabled = alertEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLockTimeoutSeconds() {
|
||||||
|
return lockTimeoutSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLockTimeoutSeconds(int lockTimeoutSeconds) {
|
||||||
|
this.lockTimeoutSeconds = lockTimeoutSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRetryOnFailure() {
|
||||||
|
return retryOnFailure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRetryOnFailure(boolean retryOnFailure) {
|
||||||
|
this.retryOnFailure = retryOnFailure;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AutoSettleConfig{" +
|
||||||
|
"enabled=" + enabled +
|
||||||
|
", timeoutMinutes=" + timeoutMinutes +
|
||||||
|
", interval='" + interval + '\'' +
|
||||||
|
", grayscaleStationIds=" + grayscaleStationIds +
|
||||||
|
", amountThresholdRatio=" + amountThresholdRatio +
|
||||||
|
", batchSize=" + batchSize +
|
||||||
|
", dataFreshnessMinutes=" + dataFreshnessMinutes +
|
||||||
|
", alertEnabled=" + alertEnabled +
|
||||||
|
", lockTimeoutSeconds=" + lockTimeoutSeconds +
|
||||||
|
", retryOnFailure=" + retryOnFailure +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user