From ed2bab0f474e1b511f283cbe7d9b75b6b80793d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 23 Mar 2020 16:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 56 +++++++++++++++++------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 615861f35..48594269e 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -9,10 +9,8 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/putils" "git.rosy.net.cn/baseapi" - "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxutils" - "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" "git.rosy.net.cn/jx-callback/business/jxutils/excel" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" @@ -646,33 +644,33 @@ 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 = "您此次的同步任务错误详情返回如下: \n" - if ctx.GetUserName() != "jxadmin" { - if len(task.GetFailedList()) > 10 { - downloadURL, _, _ := WirteToExcelBySyncFailed(task) - 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 += utils.Format4Output(buildErrMsgJson(task), true) - } - } else { - noticeMsg = "您的同步任务执行完成,没有错误返回。" - } - if authInfo, err := ctx.GetV2AuthInfo(); err == nil { - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg) - } else { - globals.SugarLogger.Debugf("同步错误发送钉钉消息失败, authinfo [%v] , [%v]", *authInfo, err) - } - } else { - 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) - if user != nil && err == nil { - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) - } - } - } + // var noticeMsg = "您此次的同步任务错误详情返回如下: \n" + // if ctx.GetUserName() != "jxadmin" { + // if len(task.GetFailedList()) > 10 { + // downloadURL, _, _ := WirteToExcelBySyncFailed(task) + // 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 += utils.Format4Output(buildErrMsgJson(task), true) + // } + // } else { + // noticeMsg = "您的同步任务执行完成,没有错误返回。" + // } + // if authInfo, err := ctx.GetV2AuthInfo(); err == nil { + // ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg) + // } else { + // globals.SugarLogger.Debugf("同步错误发送钉钉消息失败, authinfo [%v] , [%v]", *authInfo, err) + // } + // } else { + // 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) + // if user != nil && err == nil { + // ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) + // } + // } + // } }) }