From 06055ebac225449fe8844c0661606ab7c3e55c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 4 Feb 2020 13:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=94=99=E8=AF=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 28310dcc2..215e72811 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -646,9 +646,6 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) { task.SetFinishHook(func(task tasksch.ITask) { - if len(task.GetFailedList()) == 0 { - return - } var noticeMsg = "您此次的同步任务错误详情返回如下: \n" if ctx.GetUserName() != "jxadmin" { if len(task.GetFailedList()) > 10 { @@ -659,11 +656,13 @@ func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) { noticeMsg += utils.Format4Output(buildErrMsgJson(task), true) } } - if authInfo, err := ctx.GetV2AuthInfo(); err == nil { - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg) + if len(task.GetFailedList()) != 0 { + if authInfo, err := ctx.GetV2AuthInfo(); err == nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg) + } } } else { - if time.Now().Hour() >= 20 && time.Now().Hour() < 7 { + if time.Now().Hour() >= 20 || time.Now().Hour() < 7 { downloadURL, _, _ := WirteToExcelBySyncFailed(task) user, err := dao.GetUserByID(dao.GetDB(), "mobile", "18160030913") noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL)