瀏覽代碼

update

add_mode
DengBiao 1 年之前
父節點
當前提交
e195ec19cd
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      app/admin/svc/svc_data_statisstics.go

+ 5
- 2
app/admin/svc/svc_data_statisstics.go 查看文件

@@ -671,8 +671,8 @@ 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
startDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local)
endDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local)
startDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local)
endDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local)
titleList = []string{startDate.Format("2006-01-02") + "~~" + endDate.Format("2006-01-02") + " (" + k1 + ") "}
xlsx.SetSheetRow("Sheet1", "A1", &titleList)
titleList = []string{"年级", "班级", "早餐", "午餐", "晚餐"}
@@ -685,6 +685,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
panic(err)
}
xlsx.SetCellStyle("Sheet1", "A1", "E1", style)
style, err = xlsx.NewStyle(`{"alignment":{"horizontal":"center"}}`)
xlsx.SetCellStyle("Sheet1", "A1", "E1", style)

xlsx.SetColWidth("Sheet1", "A", "E", 20)

j := 3 //表头前两行用了,只能从第三行开始


Loading…
取消
儲存