DengBiao 1 рік тому
джерело
коміт
9cca454ef3
1 змінених файлів з 28 додано та 21 видалено
  1. +28
    -21
      app/admin/svc/svc_data_statisstics.go

+ 28
- 21
app/admin/svc/svc_data_statisstics.go Переглянути файл

@@ -1574,29 +1574,36 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
return
}

count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
for _, value := range req.MealKindList {
if value == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast {
count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast).String()] += count1
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForLunch {
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForLunch).String()] += count2
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForDinner {
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForDinner).String()] += count3
}
}

list[v.Enterprise.Name]["count"] += count
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast).String()] += count1
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForLunch).String()] += count2
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForDinner).String()] += count3
time.Sleep(20 * time.Millisecond) // 20毫秒
}



Завантаження…
Відмінити
Зберегти