卡新增imei字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m10s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m10s
This commit is contained in:
@@ -67,6 +67,7 @@ func (h *PollingCardStatusHandler) Handle(ctx context.Context, t *asynq.Task) er
|
||||
newNetworkStatus := card.NetworkStatus
|
||||
gatewayCardStatus := ""
|
||||
gatewayExtend := card.GatewayExtend
|
||||
gatewayCardIMEI := ""
|
||||
statusQueried := false
|
||||
if h.gateway != nil {
|
||||
result, gwErr := h.gateway.QueryCardStatus(ctx, &gateway.CardStatusReq{CardNo: card.ICCID})
|
||||
@@ -78,6 +79,7 @@ func (h *PollingCardStatusHandler) Handle(ctx context.Context, t *asynq.Task) er
|
||||
}
|
||||
gatewayCardStatus = result.CardStatus
|
||||
gatewayExtend = strings.TrimSpace(result.Extend)
|
||||
gatewayCardIMEI = strings.TrimSpace(result.IMEI)
|
||||
statusQueried = true
|
||||
parsedStatus, ok := gateway.ParseCardNetworkStatus(result.CardStatus, gatewayExtend)
|
||||
if !ok {
|
||||
@@ -108,6 +110,9 @@ func (h *PollingCardStatusHandler) Handle(ctx context.Context, t *asynq.Task) er
|
||||
if statusQueried {
|
||||
fields["gateway_extend"] = gatewayExtend
|
||||
fields["last_sync_time"] = now
|
||||
if gatewayCardIMEI != "" {
|
||||
fields["gateway_card_imei"] = gatewayCardIMEI
|
||||
}
|
||||
}
|
||||
if statusChanged {
|
||||
fields["network_status"] = newNetworkStatus
|
||||
|
||||
Reference in New Issue
Block a user