fix: SGWC导出表格数据字段修改

This commit is contained in:
TsMask
2025-02-20 10:19:58 +08:00
parent 4451705e67
commit f61f546d55

View File

@@ -58,8 +58,8 @@ func (r CDREventSGWC) ExportXlsx(rows []model.CDREventSGWC, fileName string) (st
"H1": "GPRS Downlink", "H1": "GPRS Downlink",
"I1": "Duration", "I1": "Duration",
"J1": "Invocation Time", "J1": "Invocation Time",
"K1": "PGW Address Used", "K1": "GGSN Address",
"L1": "SGW Address", "L1": "SGSN Address",
"M1": "RAT Type", "M1": "RAT Type",
"N1": "PDPPDN Type", "N1": "PDPPDN Type",
"O1": "PDPPDN Address", "O1": "PDPPDN Address",
@@ -69,6 +69,8 @@ func (r CDREventSGWC) ExportXlsx(rows []model.CDREventSGWC, fileName string) (st
"S1": "Record Cause For Rec Closing", "S1": "Record Cause For Rec Closing",
"T1": "Record Sequence Number", "T1": "Record Sequence Number",
"U1": "Local Record Sequence Number", "U1": "Local Record Sequence Number",
"V1": "Record Type",
"W1": "Record Opening Time",
} }
// 从第二行开始的数据 // 从第二行开始的数据
dataCells := make([]map[string]any, 0) dataCells := make([]map[string]any, 0)
@@ -101,11 +103,22 @@ func (r CDREventSGWC) ExportXlsx(rows []model.CDREventSGWC, fileName string) (st
if v, ok := cdrJSON["pGWAddressUsed"]; ok && v != nil { if v, ok := cdrJSON["pGWAddressUsed"]; ok && v != nil {
pGWAddressUsed = fmt.Sprint(v) pGWAddressUsed = fmt.Sprint(v)
} }
if v, ok := cdrJSON["GGSNAddress"]; ok && v != nil {
pGWAddressUsed = fmt.Sprint(v)
}
// sGWAddress // sGWAddress
sGWAddress := "" sGWAddress := ""
if v, ok := cdrJSON["sGWAddress"]; ok && v != nil { if v, ok := cdrJSON["sGWAddress"]; ok && v != nil {
sGWAddress = fmt.Sprint(v) sGWAddress = fmt.Sprint(v)
} }
if v, ok := cdrJSON["SGSNAddress"]; ok && v != nil {
sGWAddress = fmt.Sprint(v)
}
// recordType
recordType := ""
if v, ok := cdrJSON["recordType"]; ok && v != nil {
recordType = fmt.Sprint(v)
}
// rATType // rATType
rATType := "" rATType := ""
if v, ok := cdrJSON["rATType"]; ok && v != nil { if v, ok := cdrJSON["rATType"]; ok && v != nil {
@@ -208,6 +221,8 @@ func (r CDREventSGWC) ExportXlsx(rows []model.CDREventSGWC, fileName string) (st
"S" + idx: causeForRecClosing, "S" + idx: causeForRecClosing,
"T" + idx: recordSequenceNumber, "T" + idx: recordSequenceNumber,
"U" + idx: localRecordSequenceNumber, "U" + idx: localRecordSequenceNumber,
"V" + idx: recordType,
"W" + idx: invocationTimestamp,
}) })
} }