|
@@ -851,7 +851,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
|
|
|
|
|
for k3, v3 := range v2 { |
|
|
for k3, v3 := range v2 { |
|
|
xlsx.NewSheet(k3) |
|
|
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) |
|
|
xlsx.SetSheetRow(k3, "A1", &titleList) |
|
|
titleList = []string{"姓名", "早餐", "午餐", "晚餐"} |
|
|
titleList = []string{"姓名", "早餐", "午餐", "晚餐"} |
|
|
xlsx.SetSheetRow(k3, "A2", &titleList) |
|
|
xlsx.SetSheetRow(k3, "A2", &titleList) |
|
@@ -863,14 +863,20 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
xlsx.SetCellStyle(k3, "A1", "D1", style) |
|
|
xlsx.SetCellStyle(k3, "A1", "D1", style) |
|
|
|
|
|
|
|
|
xlsx.SetColWidth(k3, "A", "D", 20) |
|
|
xlsx.SetColWidth(k3, "A", "D", 20) |
|
|
|
|
|
|
|
|
|
|
|
var sumBreakfast, sumLunch, sumDinner = int64(0), int64(0), int64(0) |
|
|
j := 3 //表头前两行用了,只能从第三行开始 |
|
|
j := 3 //表头前两行用了,只能从第三行开始 |
|
|
for k4, v4 := range v3 { |
|
|
for k4, v4 := range v3 { |
|
|
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{ |
|
|
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{ |
|
|
k4, v4["breakfast"], v4["lunch"], v4["dinner"]}) |
|
|
k4, v4["breakfast"], v4["lunch"], v4["dinner"]}) |
|
|
|
|
|
sumBreakfast += v4["breakfast"] |
|
|
|
|
|
sumLunch += v4["lunch"] |
|
|
|
|
|
sumDinner += v4["dinner"] |
|
|
j++ |
|
|
j++ |
|
|
} |
|
|
} |
|
|
|
|
|
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{ |
|
|
|
|
|
"合计", sumBreakfast, sumLunch, sumDinner}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|