From ef5274864f066235b3b8c3258a0e093d3a618b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E8=BF=9B?= Date: Mon, 26 Oct 2026 03:33:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E6=9C=89=E6=95=88=E6=9C=9F?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=81=A2=E5=A4=8D=E8=BD=AE=E8=AF=A2=E8=AF=86?= =?UTF-8?q?=E5=88=AB=20card=20=E8=B5=84=E4=BA=A7=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 资产解析返回的卡类型为 card,恢复轮询按 iot_card 匹配,导致改有效期后关闭轮询的卡不恢复。 Co-Authored-By: Claude Opus 5.5 --- internal/service/asset/service.go | 4 ++++ internal/service/polling/polling_pause_service.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/internal/service/asset/service.go b/internal/service/asset/service.go index 97868db6..4ee02d73 100644 --- a/internal/service/asset/service.go +++ b/internal/service/asset/service.go @@ -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" diff --git a/internal/service/polling/polling_pause_service.go b/internal/service/polling/polling_pause_service.go index 17c8a8a9..fcd0f2f9 100644 --- a/internal/service/polling/polling_pause_service.go +++ b/internal/service/polling/polling_pause_service.go @@ -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: