|
@@ -316,9 +316,9 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta |
|
|
println("<<<<SelfSupportForSchoolDataStatisticsExport2>>>>>1111Error:::", err.Error()) |
|
|
println("<<<<SelfSupportForSchoolDataStatisticsExport2>>>>>1111Error:::", err.Error()) |
|
|
return |
|
|
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 |
|
|
var m []*db.SelfSupportForSchoolOrdWithUserIdentity |
|
@@ -371,10 +371,13 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta |
|
|
|
|
|
|
|
|
xlsx.SetSheetRow("", "A1", &titleList) |
|
|
xlsx.SetSheetRow("", "A1", &titleList) |
|
|
sheetIndex := 2 //第一个表是模板表 |
|
|
sheetIndex := 2 //第一个表是模板表 |
|
|
j := 4 //表头前三行被占用了,只能从第四行开始 |
|
|
|
|
|
for k, v := range data { |
|
|
for k, v := range data { |
|
|
|
|
|
if k == "" { |
|
|
|
|
|
k = "未知" |
|
|
|
|
|
} |
|
|
xlsx.NewSheet(k) //1、新建表格 |
|
|
xlsx.NewSheet(k) //1、新建表格 |
|
|
xlsx.CopySheet(1, sheetIndex) |
|
|
xlsx.CopySheet(1, sheetIndex) |
|
|
|
|
|
j := 4 //表头前三行被占用了,只能从第四行开始 |
|
|
for kk, vv := range v { |
|
|
for kk, vv := range v { |
|
|
xlsx.SetSheetRow(k, "A"+strconv.Itoa(j), &[]interface{}{kk, |
|
|
xlsx.SetSheetRow(k, "A"+strconv.Itoa(j), &[]interface{}{kk, |
|
|
vv["早餐"]["num"], vv["早餐"]["amount"], |
|
|
vv["早餐"]["num"], vv["早餐"]["amount"], |
|
@@ -1323,13 +1326,14 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func JudgeSelfSupportForMealTime(mealDate string) (mealZh string) { |
|
|
func JudgeSelfSupportForMealTime(mealDate string) (mealZh string) { |
|
|
now := time.Now() |
|
|
|
|
|
mealZh = "未知" |
|
|
mealZh = "未知" |
|
|
mealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", mealDate, time.Local) |
|
|
mealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", mealDate, time.Local) |
|
|
for _, v := range md.SelfSupportForMealTimeMapping { |
|
|
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) { |
|
|
if mealTime.After(tmpFromTime) && mealTime.Before(tmpToTime) { |
|
|
mealZh = v["name"] |
|
|
mealZh = v["name"] |
|
|
} |
|
|
} |
|
|