Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
251ece5903
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      app/admin/svc/svc_data_statisstics.go

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

@@ -851,7 +851,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD

for k3, v3 := range v2 {
xlsx.NewSheet(k3)
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " (" + k1 + ", " + k3 + ") 班级明细"}
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " [" + k1 + ", " + k3 + "] 班级明细"}
xlsx.SetSheetRow(k3, "A1", &titleList)
titleList = []string{"姓名", "早餐", "午餐", "晚餐"}
xlsx.SetSheetRow(k3, "A2", &titleList)
@@ -863,14 +863,20 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
panic(err)
}
xlsx.SetCellStyle(k3, "A1", "D1", style)

xlsx.SetColWidth(k3, "A", "D", 20)

var sumBreakfast, sumLunch, sumDinner = int64(0), int64(0), int64(0)
j := 3 //表头前两行用了,只能从第三行开始
for k4, v4 := range v3 {
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{
k4, v4["breakfast"], v4["lunch"], v4["dinner"]})
sumBreakfast += v4["breakfast"]
sumLunch += v4["lunch"]
sumDinner += v4["dinner"]
j++
}
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{
"合计", sumBreakfast, sumLunch, sumDinner})
}
}



Loading…
Cancel
Save