Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
package cms
|
package cms
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
@@ -37,10 +35,10 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
|||||||
storeKV = map[string]interface{}{
|
storeKV = map[string]interface{}{
|
||||||
"Status": model.StoreStatusOpened,
|
"Status": model.StoreStatusOpened,
|
||||||
}
|
}
|
||||||
content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[vendorID] + "] 平台上营业状态和京西不一致!平台状态:【营业】,京西状态:【非营业】"
|
//content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[vendorID] + "] 平台上营业状态和京西不一致!平台状态:【营业】,京西状态:【非营业】"
|
||||||
if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
//if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
// ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
if storeDetail.VendorStatus != model.StoreStatusOpened {
|
if storeDetail.VendorStatus != model.StoreStatusOpened {
|
||||||
storeMapKV = map[string]interface{}{
|
storeMapKV = map[string]interface{}{
|
||||||
@@ -54,10 +52,10 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
|||||||
"Status": storeStatus,
|
"Status": storeStatus,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[vendorID] + "] 平台上营业状态和京西不一致!平台状态:【非营业】,京西状态:【营业】"
|
//content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[vendorID] + "] 平台上营业状态和京西不一致!平台状态:【非营业】,京西状态:【营业】"
|
||||||
if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
//if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
// ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
||||||
}
|
//}
|
||||||
} else if storeDetail.Status <= storeStatus {
|
} else if storeDetail.Status <= storeStatus {
|
||||||
if storeDetail.VendorStatus != model.StoreStatusOpened {
|
if storeDetail.VendorStatus != model.StoreStatusOpened {
|
||||||
storeMapKV = map[string]interface{}{
|
storeMapKV = map[string]interface{}{
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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/baseapi/platformapi/mtwmapi"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
@@ -495,25 +492,25 @@ func buildStoreManageState(ctx *jxcontext.Context, db *dao.DaoDB, storeMap *mode
|
|||||||
//营业状态
|
//营业状态
|
||||||
storeManage.VendorStatus = store.Status
|
storeManage.VendorStatus = store.Status
|
||||||
//不一致发消息
|
//不一致发消息
|
||||||
if messageFlag {
|
//if messageFlag {
|
||||||
vendorStatus, status := -1, -1
|
// vendorStatus, status := -1, -1
|
||||||
if store.Status == model.StoreStatusOpened {
|
// if store.Status == model.StoreStatusOpened {
|
||||||
vendorStatus = 1
|
// vendorStatus = 1
|
||||||
}
|
// }
|
||||||
if storeDetail.Status == model.StoreStatusOpened {
|
// if storeDetail.Status == model.StoreStatusOpened {
|
||||||
status = 1
|
// status = 1
|
||||||
}
|
// }
|
||||||
statusMap := map[int]string{
|
// //statusMap := map[int]string{
|
||||||
1: "营业",
|
// // 1: "营业",
|
||||||
-1: "休息",
|
// // -1: "休息",
|
||||||
}
|
// //}
|
||||||
if vendorStatus != status {
|
// //if vendorStatus != status {
|
||||||
content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[storeMap.VendorID] + "] 平台上营业状态和京西不一致!平台状态:【" + statusMap[vendorStatus] + "】,京西状态:【" + statusMap[status] + "】"
|
// // content := "您的门店 [" + storeDetail.Name + "],ID:[" + utils.Int2Str(storeDetail.ID) + "],在[" + model.VendorChineseNames[storeMap.VendorID] + "] 平台上营业状态和京西不一致!平台状态:【" + statusMap[vendorStatus] + "】,京西状态:【" + statusMap[status] + "】"
|
||||||
if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
// // if user, err := dao.GetUserByID(db, "mobile", storeDetail.MarketManPhone); err == nil {
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
// // ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
||||||
}
|
// // }
|
||||||
}
|
// //}
|
||||||
}
|
//}
|
||||||
//营业时长
|
//营业时长
|
||||||
optime := jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime1, time.Now()).Sub(jxutils.JxOperationTime2TimeByDate(storeDetail.OpenTime1, time.Now())).Hours()
|
optime := jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime1, time.Now()).Sub(jxutils.JxOperationTime2TimeByDate(storeDetail.OpenTime1, time.Now())).Hours()
|
||||||
if storeDetail.CloseTime2 != 0 && storeDetail.OpenTime2 != 0 {
|
if storeDetail.CloseTime2 != 0 && storeDetail.OpenTime2 != 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user