DengBiao 1 anno fa
parent
commit
a3c3750684
1 ha cambiato i file con 30 aggiunte e 17 eliminazioni
  1. +30
    -17
      app/admin/svc/svc_data_statisstics.go

+ 30
- 17
app/admin/svc/svc_data_statisstics.go Vedi File

@@ -725,25 +725,38 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD

j := 3 //表头前两行用了,只能从第三行开始
var sumClassNum, sumBreakfast, sumLunch, sumDinner = int64(0), int64(0), int64(0), int64(0)
for k2, v2 := range v1 {
if k2 == "" {
//若年级为空,则为教师餐
k2 = "教师餐"
}

for k3, v3 := range v2 {
if k3 == "" {
//若班级为空,则为教师餐
k3 = "教师餐"
tmpClassDb := db.ClassDb{}
tmpClassDb.Set(0)
classList, err := tmpClassDb.FindClassAscByEnterprise(tmpEnterprise.Id)
if err != nil {
logx.Error(err)
println("<<<<CentralKitchenForSchoolDataStatisticsExport4>>>>>Error:::", err.Error())
panic(err)
}
for _, class := range *classList {
for k2, v2 := range v1 {
if k2 == "" {
//若年级为空,则为教师餐
k2 = "教师餐"
}

xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{
k2, k3, v3["breakfast"], v3["lunch"], v3["dinner"]})
sumClassNum++
sumBreakfast += v3["breakfast"]
sumLunch += v3["lunch"]
sumDinner += v3["dinner"]
j++
for k3, v3 := range v2 {
if class.Name != k3 {
continue
}
if k3 == "" {
//若班级为空,则为教师餐
k3 = "教师餐"
}

xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{
k2, k3, v3["breakfast"], v3["lunch"], v3["dinner"]})
sumClassNum++
sumBreakfast += v3["breakfast"]
sumLunch += v3["lunch"]
sumDinner += v3["dinner"]
j++
}
}
}
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{


Caricamento…
Annulla
Salva