From c2393c17be25f0459544d910b76c4787951e0d9a Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 5 Nov 2019 18:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=BF=90=E8=90=A5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E9=80=81=E9=92=89=E9=92=89=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 6c4adf249..28711d610 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -30,6 +30,7 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/ebai" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" ) const ( @@ -758,6 +759,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa } } else { dao.Commit(db) + notifyStoreOperatorChanged(store, valid["operatorPhone"]) } } } else { @@ -766,6 +768,21 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa return num, err } +func notifyStoreOperatorChanged(store *model.Store, newOperator2 interface{}) { + if store.OperatorPhone != "" && newOperator2 != nil { + db := dao.GetDB() + if user, err := dao.GetUserByID(db, "mobile", store.OperatorPhone); err == nil { + curUserName := "" + if newOperator := utils.Interface2String(newOperator2); newOperator != "" { + if curUser, err := dao.GetUserByID(db, "mobile", store.OperatorPhone); err == nil { + curUserName = curUser.GetName() + } + } + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.GetID(), "门店运营变更", fmt.Sprintf("门店:%d-%s,原运营:%s,变更为:%s", store.ID, store.Name, user.GetName(), curUserName)) + } + } +} + func SetStoreStatus(ctx *jxcontext.Context, storeID, status int) (err error) { payload := map[string]interface{}{ "status": status,