Kaynağa Gözat

update

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

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

@@ -671,18 +671,21 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
for k1, v1 := range list {
tmpFileName := k1 + "学校预定统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx"
tmpDownloadPath := "./static/export/central_kitchen_for_school/" + tmpFileName
titleList = []string{req.StartDate + "~~" + req.EndDate + " " + k1}
startDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local)
endDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local)
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " (" + k1 + ") "}
xlsx.SetSheetRow("Sheet1", "A1", &titleList)
titleList = []string{"年级", "班级", "早餐", "午餐", "晚餐"}
xlsx.SetSheetRow("Sheet1", "A2", &titleList)
xlsx.MergeCell("Sheet1", "A1", "E1") //合并单元格
style, err := xlsx.NewStyle(`{"fill":{"type":"pattern","color":["FF0000"],"pattern":1}}`)
style, err := xlsx.NewStyle(`{"fill":{"type":"pattern","color":["000000"],"pattern":1}}`)
if err != nil {
logx.Error(err)
println("<<<<CentralKitchenForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
panic(err)
}
xlsx.SetCellStyle("Sheet1", "A1", "E1", style)
xlsx.SetColWidth("Sheet1", "A", "E", 20)

j := 3 //表头前两行用了,只能从第三行开始
for k2, v2 := range v1 {


Yükleniyor…
İptal
Kaydet