导出问题,增加了打印4
This commit is contained in:
parent
34600c4307
commit
355706b83d
@ -1,6 +1,7 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"hospital-admin-api/api/dao"
|
"hospital-admin-api/api/dao"
|
||||||
"hospital-admin-api/api/model"
|
"hospital-admin-api/api/model"
|
||||||
@ -474,6 +475,9 @@ func (r *Export) OrderProduct(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jsonStr, err := json.Marshal(orderProducts)
|
||||||
|
utils.LogJsonInfo("打印", string(jsonStr))
|
||||||
|
|
||||||
// 业务处理
|
// 业务处理
|
||||||
exportService := service.ExportService{}
|
exportService := service.ExportService{}
|
||||||
ossAddress, err := exportService.OrderProduct(orderProducts)
|
ossAddress, err := exportService.OrderProduct(orderProducts)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/shopspring/decimal"
|
"github.com/shopspring/decimal"
|
||||||
"hospital-admin-api/api/dao"
|
"hospital-admin-api/api/dao"
|
||||||
@ -1657,15 +1656,6 @@ func (r *ExportService) OrderProduct(d []*model.OrderProduct) (string, error) {
|
|||||||
dataSlice = append(dataSlice, data)
|
dataSlice = append(dataSlice, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转为 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)
|
file, err := utils.Export(header, dataSlice)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user