新增上游的停机原因
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m5s

This commit is contained in:
2026-05-12 11:13:04 +08:00
parent 95fc0b0a1b
commit 8f3a68a673
22 changed files with 83 additions and 3 deletions

View File

@@ -121,6 +121,7 @@ func (s *Service) GetCardStatus(ctx context.Context, req *dto.AgentOpenAPICardQu
CardNo: req.CardNo,
CardStatus: cardStatus,
CardStatusName: constants.AgentOpenAPICardStatusName(cardStatus),
GatewayExtend: card.GatewayExtend,
StopReason: stopReason,
StopReasonName: constants.AgentOpenAPIStopReasonName(stopReason),
}, nil

View File

@@ -200,6 +200,7 @@ func (s *Service) buildDeviceResolveResponse(ctx context.Context, device *model.
CarrierType: c.CarrierType,
CarrierName: c.CarrierName,
RealnamePolicy: c.RealnamePolicy,
GatewayExtend: c.GatewayExtend,
})
}
@@ -255,6 +256,7 @@ func (s *Service) buildCardResolveResponse(ctx context.Context, card *model.IotC
RealNameAt: card.FirstRealnameAt,
RealnamePolicy: card.RealnamePolicy,
NetworkStatus: card.NetworkStatus,
GatewayExtend: card.GatewayExtend,
ICCID: card.ICCID,
CarrierID: card.CarrierID,
CarrierType: card.CarrierType,
@@ -353,6 +355,7 @@ func (s *Service) GetRealtimeStatus(ctx context.Context, assetType string, id ui
return nil, errors.Wrap(errors.CodeNotFound, err, "卡不存在")
}
resp.NetworkStatus = card.NetworkStatus
resp.GatewayExtend = card.GatewayExtend
resp.RealNameStatus = card.RealNameStatus
resp.CurrentMonthUsageMB = card.CurrentMonthUsageMB
resp.LastGatewayReadingMB = card.LastGatewayReadingMB
@@ -389,6 +392,7 @@ func (s *Service) GetRealtimeStatus(ctx context.Context, assetType string, id ui
CarrierType: c.CarrierType,
CarrierName: c.CarrierName,
RealnamePolicy: c.RealnamePolicy,
GatewayExtend: c.GatewayExtend,
})
}
}

View File

@@ -66,6 +66,7 @@ func (s *Service) ListBindings(ctx context.Context, deviceID uint) (*dto.ListDev
IsCurrent: binding.IsCurrent,
RealnamePolicy: card.RealnamePolicy,
NetworkStatus: card.NetworkStatus,
GatewayExtend: card.GatewayExtend,
}
responses = append(responses, resp)
}

View File

@@ -308,6 +308,7 @@ func (s *Service) ListCards(ctx context.Context, enterpriseID uint, req *dto.Ent
StatusName: constants.GetIotCardStatusName(card.Status),
NetworkStatus: card.NetworkStatus,
NetworkStatusName: constants.GetNetworkStatusName(card.NetworkStatus),
GatewayExtend: card.GatewayExtend,
})
}

View File

@@ -369,6 +369,7 @@ func (s *Service) toStandaloneResponse(card *model.IotCard, shopMap map[uint]str
RealNameStatusName: constants.GetRealNameStatusName(card.RealNameStatus),
NetworkStatus: card.NetworkStatus,
NetworkStatusName: constants.GetNetworkStatusName(card.NetworkStatus),
GatewayExtend: card.GatewayExtend,
DataUsageMB: card.DataUsageMB,
CurrentMonthUsageMB: card.CurrentMonthUsageMB,
LastGatewayReadingMB: card.LastGatewayReadingMB,
@@ -1420,6 +1421,7 @@ 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)
if !ok {
s.logger.Warn("刷新卡数据:未知 Gateway 卡状态",