- 修改门店状态监控通知excel格式

This commit is contained in:
gazebo
2019-06-27 10:44:41 +08:00
parent e41bc3b47b
commit 77b25b6329

View File

@@ -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)