Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
28b3b0780a
2 changed files with 6 additions and 7 deletions
  1. +6
    -7
      app/admin/svc/svc_data_statisstics.go
  2. BIN
     

+ 6
- 7
app/admin/svc/svc_data_statisstics.go View File

@@ -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


BIN
View File


Loading…
Cancel
Save