From 77b25b63294c1ef60e03704002f2ec6572956e06 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 27 Jun 2019 10:44:41 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E6=94=B9=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9B=91=E6=8E=A7=E9=80=9A=E7=9F=A5excel?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index d41403b09..7b8db4cee 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1280,7 +1280,8 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p } } if len(mobileList) > 0 { - title := fmt.Sprintf("门店状态变化:%s-->%s", utils.Time2Str(prevSnapshotList[0].SnapshotAt), utils.Time2Str(curSnapshotList[0].SnapshotAt)) + const fixTitle = "门店状态变化" + title := fmt.Sprintf("%s:%s-->%s", fixTitle, utils.Time2Str(prevSnapshotList[0].SnapshotAt), utils.Time2Str(curSnapshotList[0].SnapshotAt)) task := tasksch.NewParallelTask("SendAlarmVendorSnapshot", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { mobile := batchItemList[0].(string) @@ -1321,12 +1322,17 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p isFirstRow = false } excelConf := &excel.Obj2ExcelSheetConfig{ - Title: title, + Title: fixTitle, Data: dataList, CaptionList: captionList, } excelBin := excel.Obj2Excel([]*excel.Obj2ExcelSheetConfig{excelConf}) - key := "export/" + mobile + time.Now().Format("20060102T150405") + ".xlsx" + keyPart := []string{ + fixTitle, + mobile, + time.Now().Format("20060102T150405") + ".xlsx", + } + key := "export/" + strings.Join(keyPart, "_") excelURL, err2 := jxutils.UploadExportContent(excelBin, key) if err2 != nil { globals.SugarLogger.Warnf("SendAlarmVendorSnapshot, send %s failed with error:%v", key, err2)