From cf83fd62bb3e260307d491b43785b458e2afc2e9 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Thu, 14 Sep 2023 16:20:17 +0800 Subject: [PATCH] update --- app/admin/md/md_self_support.go | 8 ++++---- app/admin/svc/svc_data_statisstics.go | 18 +++++++++++------- ...学校(商家分餐数据统计表).xlsx | Bin 9181 -> 9182 bytes .../自营学校(教师消费统计表).xlsx | Bin 9037 -> 9040 bytes 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/admin/md/md_self_support.go b/app/admin/md/md_self_support.go index f280982..ca3f4c7 100644 --- a/app/admin/md/md_self_support.go +++ b/app/admin/md/md_self_support.go @@ -2,8 +2,8 @@ package md var SelfSupportForMealTimeMapping = []map[string]string{ { - "from": "5:30", - "to": "9.00", + "from": "05:30", + "to": "09:00", "name": "早餐", }, { @@ -13,12 +13,12 @@ var SelfSupportForMealTimeMapping = []map[string]string{ }, { "from": "17:30", - "to": "20:00", + "to": "20:00", "name": "晚餐", }, { "from": "20:30", - "to": "21:00", + "to": "21:00", "name": "夜宵", }, } diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go index 7740a81..9276119 100644 --- a/app/admin/svc/svc_data_statisstics.go +++ b/app/admin/svc/svc_data_statisstics.go @@ -316,9 +316,9 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta println("<<<>>>>1111Error:::", err.Error()) return } - var deviceListMapping map[string]model.Device - for _, v := range deviceListMapping { - deviceListMapping[v.DeviceSn] = v + var deviceListMapping = map[string]model.Device{} + for _, v := range deviceList { + deviceListMapping[v.DeviceSn] = *v } var m []*db.SelfSupportForSchoolOrdWithUserIdentity @@ -371,10 +371,13 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta xlsx.SetSheetRow("", "A1", &titleList) sheetIndex := 2 //第一个表是模板表 - j := 4 //表头前三行被占用了,只能从第四行开始 for k, v := range data { + if k == "" { + k = "未知" + } xlsx.NewSheet(k) //1、新建表格 xlsx.CopySheet(1, sheetIndex) + j := 4 //表头前三行被占用了,只能从第四行开始 for kk, vv := range v { xlsx.SetSheetRow(k, "A"+strconv.Itoa(j), &[]interface{}{kk, vv["早餐"]["num"], vv["早餐"]["amount"], @@ -1323,13 +1326,14 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD } func JudgeSelfSupportForMealTime(mealDate string) (mealZh string) { - now := time.Now() mealZh = "未知" mealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", mealDate, time.Local) for _, v := range md.SelfSupportForMealTimeMapping { //判断时间大小 - tmpFromTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+v["from"], time.Local) - tmpToTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+v["from"], time.Local) + tmpFromTime, _ := time.ParseInLocation("2006-01-02 15:04:05", mealTime.Format("2006-01-02")+" "+v["from"]+":00", time.Local) + tmpToTime, _ := time.ParseInLocation("2006-01-02 15:04:05", mealTime.Format("2006-01-02")+" "+v["to"]+":00", time.Local) + fmt.Println(">>>>>>>>>>>>>", mealTime.After(tmpFromTime)) + fmt.Println("<<<<<<<<<<<<<", mealTime.Before(tmpToTime)) if mealTime.After(tmpFromTime) && mealTime.Before(tmpToTime) { mealZh = v["name"] } diff --git a/static/template/自营学校(商家分餐数据统计表).xlsx b/static/template/自营学校(商家分餐数据统计表).xlsx index 0e29e2ebe68a439a809aea91d1f116b0f08db9eb..5f03acb2cd9ef766ded8a702e05a519b27b79c72 100644 GIT binary patch delta 1936 zcmV;B2XFY@N8U$}H3{I?#)2;a001|UJ|ur{(-sjanH0glon2J-F>}WTGD*n24z17P z#)aS;xbkfjd<-))pwr^Y-MKl3lkX;Sv8f$vAfXMu;M4JhGw>#q*54QWW_2+-;S5Rp zQoG=x;9EexP=^O{nL>m_7Ler%j|E>7#kmk@)=+C4XWM6|3aQqV$8;}3RapaP!90J| z;7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