From 6f3577c92bad5214e7c286ea5743fe0f9542de42 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, 17 Mar 2021 10:20:55 +0800 Subject: [PATCH] aa --- business/jxstore/cms/store.go | 8 ++++++++ business/jxstore/report/report.go | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index f226adae5..e941434f1 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -4070,3 +4070,11 @@ func GetStoreAcctBalance(ctx *jxcontext.Context, storeID int) (storeAcct *model. AccountBalance: totalIncome - totalExpend, }, err } + +// func SendVendorStoreStatusChanged(ctx *jxcontext.Context) (err error) { +// var ( +// db = dao.GetDB() +// ) +// dao.GetStoresMapList(db, []int{model.VendorIDJD, model.VendorIDMTWM, model.VendorIDEBAI}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "") +// return err +// } diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index 3ef174c96..894dc346d 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -8,6 +8,9 @@ import ( "strings" "time" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" + + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/jx-callback/business/jxutils" @@ -427,6 +430,13 @@ func RefreshStoreManageState(ctx *jxcontext.Context) { storeManage.CoverArea = utils.Str2Float64(fmt.Sprintf("%.2f", storeManage.CoverArea)) //营业状态 storeManage.VendorStatus = store.Status + //不一致发消息 + if storeDetail.VendorStatus != store.Status { + content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorNames[vendorID] + "] 平台上营业状态和京西不一致!" + if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content) + } + } //营业时长 optime := jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime1, time.Now()).Sub(jxutils.JxOperationTime2TimeByDate(storeDetail.OpenTime1, time.Now())).Hours() if storeDetail.CloseTime2 != 0 && storeDetail.OpenTime2 != 0 {