Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
13c9d68506
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      app/admin/svc/svc_data_statisstics.go

+ 5
- 2
app/admin/svc/svc_data_statisstics.go View File

@@ -671,18 +671,21 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
for k1, v1 := range list { for k1, v1 := range list {
tmpFileName := k1 + "学校预定统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" tmpFileName := k1 + "学校预定统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx"
tmpDownloadPath := "./static/export/central_kitchen_for_school/" + tmpFileName tmpDownloadPath := "./static/export/central_kitchen_for_school/" + tmpFileName
titleList = []string{req.StartDate + "~~" + req.EndDate + " " + k1}
startDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local)
endDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local)
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " (" + k1 + ") "}
xlsx.SetSheetRow("Sheet1", "A1", &titleList) xlsx.SetSheetRow("Sheet1", "A1", &titleList)
titleList = []string{"年级", "班级", "早餐", "午餐", "晚餐"} titleList = []string{"年级", "班级", "早餐", "午餐", "晚餐"}
xlsx.SetSheetRow("Sheet1", "A2", &titleList) xlsx.SetSheetRow("Sheet1", "A2", &titleList)
xlsx.MergeCell("Sheet1", "A1", "E1") //合并单元格 xlsx.MergeCell("Sheet1", "A1", "E1") //合并单元格
style, err := xlsx.NewStyle(`{"fill":{"type":"pattern","color":["FF0000"],"pattern":1}}`)
style, err := xlsx.NewStyle(`{"fill":{"type":"pattern","color":["000000"],"pattern":1}}`)
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
println("<<<<CentralKitchenForSchoolDataStatisticsExport3>>>>>Error:::", err.Error()) println("<<<<CentralKitchenForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
panic(err) panic(err)
} }
xlsx.SetCellStyle("Sheet1", "A1", "E1", style) xlsx.SetCellStyle("Sheet1", "A1", "E1", style)
xlsx.SetColWidth("Sheet1", "A", "E", 20)


j := 3 //表头前两行用了,只能从第三行开始 j := 3 //表头前两行用了,只能从第三行开始
for k2, v2 := range v1 { for k2, v2 := range v1 {


Loading…
Cancel
Save