Kaynağa Gözat

update

add_mode
DengBiao 1 yıl önce
ebeveyn
işleme
bc4e1b4bd7
1 değiştirilmiş dosya ile 16 ekleme ve 1 silme
  1. +16
    -1
      app/admin/svc/svc_data_statisstics.go

+ 16
- 1
app/admin/svc/svc_data_statisstics.go Dosyayı Görüntüle

@@ -1506,6 +1506,9 @@ func CentralKitchenForSchoolDataStatisticsContrast(req md.CentralKitchenForSchoo
for k1, v1 := range list {
tmpFileName := k1 + "数据对比_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx"
tmpDownloadPath := "./static/export/central_kitchen_for_school/" + tmpFileName
startDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.Date1[0], time.Local)
endDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.Date2[0], time.Local)

for k2, v2 := range v1 {
if k2 == "" {
//若年级为空,则为教师
@@ -1513,9 +1516,21 @@ func CentralKitchenForSchoolDataStatisticsContrast(req md.CentralKitchenForSchoo
}

for k3, v3 := range v2 {
titleList = []string{"姓名", "家长联系电话"}
xlsx.NewSheet(k3)
titleList = []string{startDate.Format("2006-01") + "~~" + endDate.Format("2006-01") + " [" + k1 + ", " + k3 + "] 班级明细"}
xlsx.SetSheetRow(k3, "A1", &titleList)
titleList = []string{"姓名", "家长联系电话"}
xlsx.SetSheetRow(k3, "A2", &titleList)
xlsx.MergeCell(k3, "A1", "B1") //合并单元格
style, err := xlsx.NewStyle(`{"fill":{"type":"pattern","color":["FFFF00"],"pattern":1}, "alignment":{"horizontal":"center"}}`)
if err != nil {
logx.Error(err)
println("<<<<CentralKitchenForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
panic(err)
}
xlsx.SetCellStyle(k3, "A1", "B1", style)
xlsx.SetColWidth(k3, "A", "B", 20)

j := 2 //表头被第一行用了,只能从第二行开始
for k4, v4 := range v3 {
//TODO::判断当前用户是否在新的月份里面


Yükleniyor…
İptal
Kaydet