From ded473c57b9f5ec1f565ae0f8bc6c19f51f30e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 22 Jan 2020 10:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E5=A4=A9=E7=9A=84=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=8F=91=E7=BB=99=E6=88=91=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index c54e8884c..31ac7696d 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -646,21 +646,26 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) { task.SetFinishHook(func(task tasksch.ITask) { - var noticeMsg string + var noticeMsg = "您此次的同步任务错误详情返回如下: \n" if ctx.GetUserName() != "jxadmin" { if len(task.GetFailedList()) > 10 { downloadURL, _, _ := WirteToExcelBySyncFailed(task) - noticeMsg = "您此次的同步任务错误详情返回如下: \n" noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) } else if len(task.GetFailedList()) > 0 && len(task.GetFailedList()) <= 10 { if task.GetErr() != nil { - noticeMsg = "您此次的同步任务错误详情返回如下: \n" noticeMsg += utils.Format4Output(buildErrMsgJson(task), true) } } if authInfo, err := ctx.GetV2AuthInfo(); err == nil { ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg) } + } else { + downloadURL, _, _ := WirteToExcelBySyncFailed(task) + user, err := dao.GetUserByID(dao.GetDB(), "mobile", "18160030913") + noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) + if user != nil && err == nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) + } } }) }