This commit is contained in:
苏尹岚
2021-03-17 10:20:55 +08:00
parent 9d370d88a8
commit 6f3577c92b
2 changed files with 18 additions and 0 deletions

View File

@@ -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
// }

View File

@@ -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 {