浏览代码

update

add_mode
DengBiao 1年前
父节点
当前提交
251ece5903
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. +8
    -2
      app/admin/svc/svc_data_statisstics.go

+ 8
- 2
app/admin/svc/svc_data_statisstics.go 查看文件

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



正在加载...
取消
保存