|
@@ -671,8 +671,8 @@ 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 |
|
|
startDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local) |
|
|
|
|
|
endDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local) |
|
|
|
|
|
|
|
|
startDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) |
|
|
|
|
|
endDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) |
|
|
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " (" + k1 + ") "} |
|
|
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{"年级", "班级", "早餐", "午餐", "晚餐"} |
|
@@ -685,6 +685,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
xlsx.SetCellStyle("Sheet1", "A1", "E1", style) |
|
|
xlsx.SetCellStyle("Sheet1", "A1", "E1", style) |
|
|
|
|
|
style, err = xlsx.NewStyle(`{"alignment":{"horizontal":"center"}}`) |
|
|
|
|
|
xlsx.SetCellStyle("Sheet1", "A1", "E1", style) |
|
|
|
|
|
|
|
|
xlsx.SetColWidth("Sheet1", "A", "E", 20) |
|
|
xlsx.SetColWidth("Sheet1", "A", "E", 20) |
|
|
|
|
|
|
|
|
j := 3 //表头前两行用了,只能从第三行开始 |
|
|
j := 3 //表头前两行用了,只能从第三行开始 |
|
|