|
|
@@ -1828,16 +1828,16 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
xls.SetSheetRow("", "A1", &titleList) |
|
|
|
sheetIndex := 2 //第一个表是模板表 |
|
|
|
xls.NewSheet("sheet1") //1、新建表格 |
|
|
|
xls.CopySheet(1, sheetIndex) |
|
|
|
//xls.SetSheetRow("", "A1", &titleList) |
|
|
|
//sheetIndex := 2 //第一个表是模板表 |
|
|
|
//xls.NewSheet("sheet1") //1、新建表格 |
|
|
|
//xls.CopySheet(1, sheetIndex) |
|
|
|
j := 4 //表头前三行被占用了,只能从第四行开始 |
|
|
|
|
|
|
|
for _, date := range dates { |
|
|
|
for kk, v := range list { |
|
|
|
if date == kk { |
|
|
|
xls.SetSheetRow("sheet1", "A"+strconv.Itoa(j), &[]interface{}{kk, |
|
|
|
xls.SetSheetRow("template", "A"+strconv.Itoa(j), &[]interface{}{kk, |
|
|
|
v["早餐"]["count"], v["早餐"]["sum"], |
|
|
|
v["午餐"]["count"], v["午餐"]["sum"], |
|
|
|
v["晚餐"]["count"], v["晚餐"]["sum"], |
|
|
@@ -1845,10 +1845,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
}) |
|
|
|
j++ |
|
|
|
} |
|
|
|
sheetIndex++ |
|
|
|
} |
|
|
|
} |
|
|
|
xls.DeleteSheet("template") //删除模板表 |
|
|
|
//xls.DeleteSheet("template") //删除模板表 |
|
|
|
//将文件保存至服务器 |
|
|
|
xls.SaveAs("./static" + downloadPath) |
|
|
|
break |
|
|
|