机卡分离复机接口
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m1s

This commit is contained in:
2026-05-14 09:50:48 +08:00
parent 81aa3c2b11
commit d597a25c69
10 changed files with 190 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ package iot_card
import (
"context"
stderrors "errors"
"strings"
"time"
"github.com/break/junhong_cmp_fiber/internal/gateway"
@@ -1421,13 +1422,14 @@ func (s *Service) RefreshCardDataFromGateway(ctx context.Context, iccid string)
if err != nil {
s.logger.Warn("刷新卡数据:查询网络状态失败", zap.String("iccid", iccid), zap.Error(err))
} else {
updates["gateway_extend"] = statusResp.Extend
networkStatus, ok := gateway.ParseCardNetworkStatus(statusResp.CardStatus, statusResp.Extend)
gatewayExtend := strings.TrimSpace(statusResp.Extend)
updates["gateway_extend"] = gatewayExtend
networkStatus, ok := gateway.ParseCardNetworkStatus(statusResp.CardStatus, gatewayExtend)
if !ok {
s.logger.Warn("刷新卡数据:未知 Gateway 卡状态",
zap.String("iccid", iccid),
zap.String("card_status", statusResp.CardStatus),
zap.String("extend", statusResp.Extend))
zap.String("extend", gatewayExtend))
} else {
updates["network_status"] = networkStatus
}