fix: export cdr msd issue

This commit is contained in:
zhangsz
2025-07-22 09:54:00 +08:00
parent 3e345e9e11
commit 6c8c17c4f4

View File

@@ -145,8 +145,17 @@ func (r CDREventMF) ExportXlsx(rows []model.CDREventMF, fileName, language strin
}
// MSD-最小数据集
msd := ""
if v, ok := cdrJSON["msd"]; ok && v != nil {
msd = v.(string)
if v, ok := cdrJSON["msdData"]; ok && v != nil && v != "" {
switch vv := v.(type) {
case string:
msd = vv
case json.RawMessage:
msd = string(vv)
case map[string]interface{}:
// 如果是对象序列化为json.RawMessage
b, _ := json.Marshal(vv)
msd = string(b)
}
}
dataCells = append(dataCells, map[string]any{
"A" + idx: row.ID,