导出问题,增加了打印3

This commit is contained in:
wucongxing8150 2024-12-06 09:30:06 +08:00
parent 0334f91251
commit 34600c4307

View File

@ -1,6 +1,7 @@
package service
import (
"encoding/json"
"fmt"
"github.com/shopspring/decimal"
"hospital-admin-api/api/dao"
@ -1656,7 +1657,14 @@ func (r *ExportService) OrderProduct(d []*model.OrderProduct) (string, error) {
dataSlice = append(dataSlice, data)
}
utils.LogJsonInfo("打印数据:", dataSlice)
// 转为 JSON
jsonData, err := json.Marshal(dataSlice)
if err != nil {
fmt.Println("Error converting to JSON:", err)
return "", err
}
utils.LogJsonInfo("打印数据:", string(jsonData))
file, err := utils.Export(header, dataSlice)
if err != nil {