- 添加门店状态临时休息,之前是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) {
|
||||
return err
|
||||
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeStatus:%d", vendorStoreID, storeStatus)
|
||||
db := dao.GetDB()
|
||||
storeDetail, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID)
|
||||
|
||||
@@ -2,8 +2,9 @@ package model
|
||||
|
||||
const (
|
||||
StoreStatusAll = -9
|
||||
StoreStatusDisabled = -1
|
||||
StoreStatusClosed = 0
|
||||
StoreStatusDisabled = -2
|
||||
StoreStatusClosed = -1
|
||||
StoreStatusHaveRest = 0
|
||||
StoreStatusOpened = 1
|
||||
)
|
||||
|
||||
@@ -32,7 +33,8 @@ const (
|
||||
var (
|
||||
StoreStatusName = map[int]string{
|
||||
StoreStatusDisabled: "禁用",
|
||||
StoreStatusClosed: "休息",
|
||||
StoreStatusClosed: "长期休息",
|
||||
StoreStatusHaveRest: "临时休息",
|
||||
StoreStatusOpened: "营业中",
|
||||
}
|
||||
DeliveryRangeTypeName = map[int]string{
|
||||
|
||||
@@ -27,7 +27,7 @@ func init() {
|
||||
|
||||
func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
||||
if ebaiStatus == ebaiapi.ShopBusStatusHaveRest || ebaiStatus == ebaiapi.ShopBusStatusSuspended {
|
||||
return model.StoreStatusClosed
|
||||
return model.StoreStatusHaveRest
|
||||
}
|
||||
return model.StoreStatusOpened
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
if store2.Status != mergeStatus {
|
||||
if mergeStatus == model.StoreStatusOpened {
|
||||
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))
|
||||
} else if mergeStatus == model.StoreStatusDisabled {
|
||||
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 {
|
||||
storeStatus = model.StoreStatusOpened
|
||||
} else {
|
||||
storeStatus = model.StoreStatusClosed
|
||||
storeStatus = model.StoreStatusHaveRest
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
|
||||
@@ -42,7 +42,7 @@ func JdStoreStatus2JxStatus(yn, closeStatus interface{}) int {
|
||||
if yn2 == 1 {
|
||||
return model.StoreStatusDisabled
|
||||
} else if closeStatus2 == 1 {
|
||||
return model.StoreStatusClosed
|
||||
return model.StoreStatusHaveRest
|
||||
}
|
||||
return model.StoreStatusOpened
|
||||
}
|
||||
@@ -51,7 +51,7 @@ func JxStoreStatus2JdStatus(status int) (yn, closeStatus int) {
|
||||
switch status {
|
||||
case model.StoreStatusDisabled:
|
||||
return 1, 1
|
||||
case model.StoreStatusClosed:
|
||||
case model.StoreStatusHaveRest, model.StoreStatusClosed:
|
||||
return 0, 1
|
||||
default:
|
||||
return 0, 0
|
||||
|
||||
@@ -129,7 +129,7 @@ func bizStatusMtwm2JX(openLevel, online int) int {
|
||||
return model.StoreStatusDisabled
|
||||
} else {
|
||||
if openLevel == mtwmapi.PoiOpenLevelHaveRest {
|
||||
return model.StoreStatusClosed
|
||||
return model.StoreStatusHaveRest
|
||||
}
|
||||
}
|
||||
return model.StoreStatusOpened
|
||||
@@ -138,7 +138,7 @@ func bizStatusMtwm2JX(openLevel, online int) int {
|
||||
func bizStatusJX2Mtwm(status int) (openLevel, online int) {
|
||||
if status == model.StoreStatusDisabled {
|
||||
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.PoiOpenLevelNormal, mtwmapi.PoiStatusOnline
|
||||
|
||||
Reference in New Issue
Block a user