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

@@ -1372,22 +1372,6 @@ func (s *IotCardStore) ListByDeviceIDAndNetworkStatus(ctx context.Context, devic
return cards, err
}
// ListByDeviceIDAndPollingStopReasons 查询设备下因轮询原因停机的所有卡
// 用于 resumeDeviceCards:只复机由轮询系统停机的卡(不干预手动停机)
func (s *IotCardStore) ListByDeviceIDAndPollingStopReasons(ctx context.Context, deviceID uint) ([]*model.IotCard, error) {
pollingReasons := []string{
constants.StopReasonTrafficExhausted,
constants.StopReasonNoPackage,
constants.StopReasonNotRealname,
}
var cards []*model.IotCard
err := s.db.WithContext(ctx).
Where("id IN (SELECT iot_card_id FROM tb_device_sim_binding WHERE device_id = ? AND bind_status = 1 AND deleted_at IS NULL)", deviceID).
Where("network_status = 0 AND stop_reason IN ? AND deleted_at IS NULL", pollingReasons).
Find(&cards).Error
return cards, err
}
// UpdateStopReason 更新卡的停机原因字段
func (s *IotCardStore) UpdateStopReason(ctx context.Context, cardID uint, reason string) error {
return s.db.WithContext(ctx).