diff --git a/internal/service/iot_card/stop_resume_service.go b/internal/service/iot_card/stop_resume_service.go index 4e7f7e1..a0b9f3d 100644 --- a/internal/service/iot_card/stop_resume_service.go +++ b/internal/service/iot_card/stop_resume_service.go @@ -659,9 +659,11 @@ func (s *StopResumeService) resumeCardWithRetry(ctx context.Context, card *model time.Sleep(s.retryInterval) } - err := s.gatewayClient.StartCard(ctx, &gateway.CardOperationReq{ - CardNo: card.ICCID, - }) + req := &gateway.CardOperationReq{CardNo: card.ICCID} + if strings.TrimSpace(card.GatewayExtend) == constants.GatewayCardExtendMachineSeparated { + req.Extend = constants.GatewayCardStartExtendMachineSeparated + } + err := s.gatewayClient.StartCard(ctx, req) if err == nil { s.logger.Info("网关复机成功", zap.Uint("card_id", card.ID), diff --git a/pkg/constants/iot.go b/pkg/constants/iot.go index b24c2bf..0671fab 100644 --- a/pkg/constants/iot.go +++ b/pkg/constants/iot.go @@ -62,6 +62,7 @@ const ( GatewayCardStatusStopped = "停机" // 网关卡状态:停机 GatewayCardExtendPendingActivation = "待激活" // 网关扩展状态:待激活 GatewayCardExtendMachineSeparated = "机卡分离停机" // 网关扩展状态:机卡分离停机 + GatewayCardStartExtendMachineSeparated = "2" // 机卡分离复机时上传给运营商的 extend 值 ) // IoT 卡停机原因