feat: 停复机新规则转正,删除总开关与旧口径
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m35s

- 删除总开关 stop_resume.unified_rule_enabled(配置、加载、部署工作流与 docker-compose.prod.yml 环境变量)
- 复机不看停机原因:删除只对轮询停因复机的旧分支与 ListByDeviceIDAndPollingStopReasons;设备复机取全部停机卡
- 实名门槛只按卡所属通道实名管控判断,删除行业卡与卡/设备实名策略放行;暂停轮询的卡不自动停复机无条件生效
- 通道阈值新周期解锁后的复机条件固定为新规则复机条件
- 资产自动续费复机同步新规则:不看停因、暂停轮询不复机、设备取全部停机卡、复机成功清除停因
- 实名轮询不再按行业卡跳过;所属运营商账户未开启实名管控时跳过查询,但卡未实名且所在资产有等待实名激活的套餐时照常查询,避免囤货套餐无法激活
This commit is contained in:
邹进
2026-10-25 18:13:51 +09:00
parent 457abaabd7
commit f49baff7c2
15 changed files with 155 additions and 159 deletions

View File

@@ -33,7 +33,6 @@ type Config struct {
WeCom WeComConfig `mapstructure:"wecom"`
Approval ApprovalConfig `mapstructure:"approval"`
TrafficCalc TrafficCalcConfig `mapstructure:"traffic_calc"`
StopResume StopResumeConfig `mapstructure:"stop_resume"`
}
// 卡流量计量模式取值。
@@ -57,14 +56,6 @@ type TrafficCalcConfig struct {
FlowSnapshotEnabled bool `mapstructure:"flow_snapshot_enabled"`
}
// StopResumeConfig 停复机规则配置。
type StopResumeConfig struct {
// UnifiedRuleEnabled 停复机新规则总开关:开启后复机不看停机原因、实名按通道实名管控判断、
// 暂停轮询的卡不自动停复机;关闭时与原有行为完全一致。
// 环境变量:JUNHONG_STOP_RESUME_UNIFIED_RULE_ENABLED
UnifiedRuleEnabled bool `mapstructure:"unified_rule_enabled"`
}
// ServerConfig HTTP 服务器配置
type ServerConfig struct {
Address string `mapstructure:"address"` // 例如 ":3000"

View File

@@ -161,10 +161,6 @@ traffic_calc:
cards: "" # 灰度名单,如 device:15276,iot_card:103154(环境变量:JUNHONG_TRAFFIC_CALC_CARDS)
flow_snapshot_enabled: true # 未切换卡写日快照(环境变量:JUNHONG_TRAFFIC_FLOW_SNAPSHOT_ENABLED)
# 停复机规则配置
stop_resume:
unified_rule_enabled: false # 停复机新规则总开关(环境变量:JUNHONG_STOP_RESUME_UNIFIED_RULE_ENABLED)
# 企业微信 Adapter 配置
wecom:
base_url: "https://qyapi.weixin.qq.com"

View File

@@ -159,7 +159,6 @@ func bindEnvVariables(v *viper.Viper) {
"wechat.payment.timeout",
"traffic_calc.mode",
"traffic_calc.cards",
"stop_resume.unified_rule_enabled",
}
for _, key := range bindings {

View File

@@ -74,11 +74,10 @@ const (
StopReasonArrears = "arrears" // 欠费
StopReasonProtectPeriod = "protect_period" // 保护期一致性检查自动停机(保护期已下线,不再产生新值;保留供历史数据与开放接口映射)
StopReasonNoPackage = "no_package" // 停机原因:无有效套餐
StopReasonNotRealname = "not_realname" // 停机原因:非行业卡且未完成实名认证
StopReasonNotRealname = "not_realname" // 停机原因:卡所属通道开启实名管控且卡未完成实名认证
StopReasonCarrierStopped = "carrier_stopped" // 停机原因:运营商/Gateway 侧主动停机
// StopReasonChannelThreshold 是运营商通道流量阈值达量停机的停因。
// 它既不属于轮询停因(isPollingStopReason),也不参与设备维度扩散(isDeviceScopeReason):
// 周期内必须拒绝一切复机,复机只由通道阈值的周期处理发起。
// 它不参与设备维度扩散(isDeviceScopeReason):周期内持锁拒绝一切复机,新周期解锁后按停复机规则复机。
StopReasonChannelThreshold = "channel_threshold"
)