This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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 卡状态",
|
||||
|
||||
Reference in New Issue
Block a user