fix: 改有效期自动恢复轮询识别 card 资产类型
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m24s

资产解析返回的卡类型为 card,恢复轮询按 iot_card 匹配,导致改有效期后关闭轮询的卡不恢复。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-10-26 03:33:01 +09:00
parent 4139732719
commit ef5274864f
2 changed files with 7 additions and 0 deletions

View File

@@ -1504,6 +1504,10 @@ func (s *Service) restorePollingAfterExpiryChange(ctx context.Context, assetType
if s.pollingRestorer == nil || assetID == 0 {
return
}
// 资产解析返回的卡类型为 card,统一为 iot_card。
if assetType == constants.AssetResolveTypeCard {
assetType = constants.AssetTypeIotCard
}
column := "iot_card_id"
if assetType == constants.AssetTypeDevice {
column = "device_id"

View File

@@ -264,6 +264,9 @@ func (s *AssetPollingService) RestoreAssetPolling(ctx context.Context, assetType
ctx = auditcontext.With(ctx, auditcontext.Context{ActorKind: constants.AuditActorSystemTask, ActorID: "polling_auto_restore",
ActorName: "套餐生效自动恢复轮询", Source: constants.AuditSourceWorker})
}
if assetType == constants.AssetResolveTypeCard {
assetType = constants.AssetTypeIotCard
}
restored := false
switch assetType {
case constants.AssetTypeIotCard: