- 修改门店状态监控通知excel格式
This commit is contained in:
@@ -1280,7 +1280,8 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(mobileList) > 0 {
|
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,
|
task := tasksch.NewParallelTask("SendAlarmVendorSnapshot", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
mobile := batchItemList[0].(string)
|
mobile := batchItemList[0].(string)
|
||||||
@@ -1321,12 +1322,17 @@ func SendAlarmVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, p
|
|||||||
isFirstRow = false
|
isFirstRow = false
|
||||||
}
|
}
|
||||||
excelConf := &excel.Obj2ExcelSheetConfig{
|
excelConf := &excel.Obj2ExcelSheetConfig{
|
||||||
Title: title,
|
Title: fixTitle,
|
||||||
Data: dataList,
|
Data: dataList,
|
||||||
CaptionList: captionList,
|
CaptionList: captionList,
|
||||||
}
|
}
|
||||||
excelBin := excel.Obj2Excel([]*excel.Obj2ExcelSheetConfig{excelConf})
|
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)
|
excelURL, err2 := jxutils.UploadExportContent(excelBin, key)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
globals.SugarLogger.Warnf("SendAlarmVendorSnapshot, send %s failed with error:%v", key, err2)
|
globals.SugarLogger.Warnf("SendAlarmVendorSnapshot, send %s failed with error:%v", key, err2)
|
||||||
|
|||||||
Reference in New Issue
Block a user