|
@@ -1780,8 +1780,10 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
break |
|
|
break |
|
|
case 10: |
|
|
case 10: |
|
|
//就餐数据统计表 |
|
|
//就餐数据统计表 |
|
|
|
|
|
sTime, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) |
|
|
|
|
|
eTime, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) |
|
|
xls, _ := excelize.OpenFile("./static/template/央厨学校(就餐数据统计表).xlsx") |
|
|
xls, _ := excelize.OpenFile("./static/template/央厨学校(就餐数据统计表).xlsx") |
|
|
fileName = "就餐数据统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" |
|
|
|
|
|
|
|
|
fileName = "【" + sTime.Format("2006-01-02") + " ~ " + eTime.Format("2006-01-02") + "】就餐数据统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" |
|
|
downloadPath = "/export/central_kitchen_for_school/" + fileName |
|
|
downloadPath = "/export/central_kitchen_for_school/" + fileName |
|
|
|
|
|
|
|
|
var list = map[string]map[string]map[string]float64{} |
|
|
var list = map[string]map[string]map[string]float64{} |
|
@@ -1790,8 +1792,6 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
if req.StartDate != "" { |
|
|
if req.StartDate != "" { |
|
|
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} |
|
|
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} |
|
|
centralKitchenForSchoolUserWithDayDb.Set(0) |
|
|
centralKitchenForSchoolUserWithDayDb.Set(0) |
|
|
sTime, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) |
|
|
|
|
|
eTime, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) |
|
|
|
|
|
diffDays := int(eTime.Sub(sTime).Hours() / 24) |
|
|
diffDays := int(eTime.Sub(sTime).Hours() / 24) |
|
|
for i := 0; i <= diffDays; i++ { |
|
|
for i := 0; i <= diffDays; i++ { |
|
|
date := sTime.AddDate(0, 0, i) |
|
|
date := sTime.AddDate(0, 0, i) |
|
|