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