- 添加门店状态临时休息,之前是1,0,-1改为1,0,-1,-2
- 禁用门店状态同步
This commit is contained in:
@@ -21,6 +21,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int, storeStatus int) (err error) {
|
func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int, storeStatus int) (err error) {
|
||||||
|
return err
|
||||||
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeStatus:%d", vendorStoreID, storeStatus)
|
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeStatus:%d", vendorStoreID, storeStatus)
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
storeDetail, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID)
|
storeDetail, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID)
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ package model
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
StoreStatusAll = -9
|
StoreStatusAll = -9
|
||||||
StoreStatusDisabled = -1
|
StoreStatusDisabled = -2
|
||||||
StoreStatusClosed = 0
|
StoreStatusClosed = -1
|
||||||
|
StoreStatusHaveRest = 0
|
||||||
StoreStatusOpened = 1
|
StoreStatusOpened = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,7 +33,8 @@ const (
|
|||||||
var (
|
var (
|
||||||
StoreStatusName = map[int]string{
|
StoreStatusName = map[int]string{
|
||||||
StoreStatusDisabled: "禁用",
|
StoreStatusDisabled: "禁用",
|
||||||
StoreStatusClosed: "休息",
|
StoreStatusClosed: "长期休息",
|
||||||
|
StoreStatusHaveRest: "临时休息",
|
||||||
StoreStatusOpened: "营业中",
|
StoreStatusOpened: "营业中",
|
||||||
}
|
}
|
||||||
DeliveryRangeTypeName = map[int]string{
|
DeliveryRangeTypeName = map[int]string{
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func init() {
|
|||||||
|
|
||||||
func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
||||||
if ebaiStatus == ebaiapi.ShopBusStatusHaveRest || ebaiStatus == ebaiapi.ShopBusStatusSuspended {
|
if ebaiStatus == ebaiapi.ShopBusStatusHaveRest || ebaiStatus == ebaiapi.ShopBusStatusSuspended {
|
||||||
return model.StoreStatusClosed
|
return model.StoreStatusHaveRest
|
||||||
}
|
}
|
||||||
return model.StoreStatusOpened
|
return model.StoreStatusOpened
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
if store2.Status != mergeStatus {
|
if store2.Status != mergeStatus {
|
||||||
if mergeStatus == model.StoreStatusOpened {
|
if mergeStatus == model.StoreStatusOpened {
|
||||||
err = api.EbaiAPI.ShopOpen("", utils.Str2Int64(store.VendorStoreID))
|
err = api.EbaiAPI.ShopOpen("", utils.Str2Int64(store.VendorStoreID))
|
||||||
} else if mergeStatus == model.StoreStatusClosed {
|
} else if mergeStatus == model.StoreStatusHaveRest || mergeStatus == model.StoreStatusClosed {
|
||||||
err = api.EbaiAPI.ShopClose("", utils.Str2Int64(store.VendorStoreID))
|
err = api.EbaiAPI.ShopClose("", utils.Str2Int64(store.VendorStoreID))
|
||||||
} else if mergeStatus == model.StoreStatusDisabled {
|
} else if mergeStatus == model.StoreStatusDisabled {
|
||||||
err = api.EbaiAPI.ShopOffline("", utils.Str2Int64(store.VendorStoreID))
|
err = api.EbaiAPI.ShopOffline("", utils.Str2Int64(store.VendorStoreID))
|
||||||
@@ -415,7 +415,7 @@ func (c *PurchaseHandler) onShopMsgPush(msg *ebaiapi.CallbackMsg) (response *eba
|
|||||||
if int(utils.ForceInterface2Int64(msg.Body["business_ele"])) == 1 {
|
if int(utils.ForceInterface2Int64(msg.Body["business_ele"])) == 1 {
|
||||||
storeStatus = model.StoreStatusOpened
|
storeStatus = model.StoreStatusOpened
|
||||||
} else {
|
} else {
|
||||||
storeStatus = model.StoreStatusClosed
|
storeStatus = model.StoreStatusHaveRest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func JdStoreStatus2JxStatus(yn, closeStatus interface{}) int {
|
|||||||
if yn2 == 1 {
|
if yn2 == 1 {
|
||||||
return model.StoreStatusDisabled
|
return model.StoreStatusDisabled
|
||||||
} else if closeStatus2 == 1 {
|
} else if closeStatus2 == 1 {
|
||||||
return model.StoreStatusClosed
|
return model.StoreStatusHaveRest
|
||||||
}
|
}
|
||||||
return model.StoreStatusOpened
|
return model.StoreStatusOpened
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ func JxStoreStatus2JdStatus(status int) (yn, closeStatus int) {
|
|||||||
switch status {
|
switch status {
|
||||||
case model.StoreStatusDisabled:
|
case model.StoreStatusDisabled:
|
||||||
return 1, 1
|
return 1, 1
|
||||||
case model.StoreStatusClosed:
|
case model.StoreStatusHaveRest, model.StoreStatusClosed:
|
||||||
return 0, 1
|
return 0, 1
|
||||||
default:
|
default:
|
||||||
return 0, 0
|
return 0, 0
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ func bizStatusMtwm2JX(openLevel, online int) int {
|
|||||||
return model.StoreStatusDisabled
|
return model.StoreStatusDisabled
|
||||||
} else {
|
} else {
|
||||||
if openLevel == mtwmapi.PoiOpenLevelHaveRest {
|
if openLevel == mtwmapi.PoiOpenLevelHaveRest {
|
||||||
return model.StoreStatusClosed
|
return model.StoreStatusHaveRest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return model.StoreStatusOpened
|
return model.StoreStatusOpened
|
||||||
@@ -138,7 +138,7 @@ func bizStatusMtwm2JX(openLevel, online int) int {
|
|||||||
func bizStatusJX2Mtwm(status int) (openLevel, online int) {
|
func bizStatusJX2Mtwm(status int) (openLevel, online int) {
|
||||||
if status == model.StoreStatusDisabled {
|
if status == model.StoreStatusDisabled {
|
||||||
return mtwmapi.PoiOpenLevelHaveRest, mtwmapi.PoiStatusOffline
|
return mtwmapi.PoiOpenLevelHaveRest, mtwmapi.PoiStatusOffline
|
||||||
} else if status == model.StoreStatusClosed {
|
} else if status == model.StoreStatusHaveRest || status == model.StoreStatusClosed {
|
||||||
return mtwmapi.PoiOpenLevelHaveRest, mtwmapi.PoiStatusOnline
|
return mtwmapi.PoiOpenLevelHaveRest, mtwmapi.PoiStatusOnline
|
||||||
}
|
}
|
||||||
return mtwmapi.PoiOpenLevelNormal, mtwmapi.PoiStatusOnline
|
return mtwmapi.PoiOpenLevelNormal, mtwmapi.PoiStatusOnline
|
||||||
|
|||||||
Reference in New Issue
Block a user