+ IPurchasePlatformOrderHandler
This commit is contained in:
@@ -58,7 +58,7 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) GetStatusFromVendorStatus(vendorStatus string) int {
|
||||
func (p *PurchaseHandler) getStatusFromVendorStatus(vendorStatus string) int {
|
||||
if status, ok := VendorStatus2StatusMap[vendorStatus]; ok {
|
||||
return status
|
||||
}
|
||||
@@ -197,7 +197,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
||||
if order.StoreID > math.MaxInt32 {
|
||||
order.StoreID = 0
|
||||
}
|
||||
order.Status = p.GetStatusFromVendorStatus(order.VendorStatus)
|
||||
order.Status = p.getStatusFromVendorStatus(order.VendorStatus)
|
||||
if utils.MustInterface2Int64(orderMap["send_immediately"]) == 1 {
|
||||
order.BusinessType = model.BusinessTypeImmediate
|
||||
} else {
|
||||
@@ -452,7 +452,7 @@ func (c *PurchaseHandler) callbackMsg2Status(msg *ebaiapi.CallbackMsg) (orderSta
|
||||
}
|
||||
orderStatus.Remark = utils.Interface2String(msg.Body["reason"])
|
||||
}
|
||||
orderStatus.Status = c.GetStatusFromVendorStatus(orderStatus.VendorStatus)
|
||||
orderStatus.Status = c.getStatusFromVendorStatus(orderStatus.VendorStatus)
|
||||
return orderStatus
|
||||
}
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ func genStoreMapFromStore(store *tEbaiStoreInfo) map[string]interface{} {
|
||||
return params
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID string) (storeStatus int, err error) {
|
||||
func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeStatus int, err error) {
|
||||
ebaiStatus, err := api.EbaiAPI.ShopBusStatusGet("", utils.Str2Int64(vendorStoreID), ebaiapi.PlatformFlagElm)
|
||||
if err == nil {
|
||||
storeStatus = EbaiBusStatus2JxStatus(ebaiStatus)
|
||||
@@ -404,10 +404,11 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID s
|
||||
func (c *PurchaseHandler) onShopMsgPush(msg *ebaiapi.CallbackMsg) (response *ebaiapi.CallbackResponse) {
|
||||
var err error
|
||||
vendorStoreID := utils.Interface2String(msg.Body["baidu_shop_id"])
|
||||
storeID := int(utils.Interface2Int64WithDefault(msg.Body["shop_id"], 0))
|
||||
storeStatus := model.StoreStatusOpened
|
||||
switch utils.Interface2String(msg.Body["msg_type"]) {
|
||||
case "online", "offline":
|
||||
storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorStoreID)
|
||||
storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, storeID, vendorStoreID)
|
||||
case "shop_open", "shop_pause", "shop_close":
|
||||
if int(utils.ForceInterface2Int64(msg.Body["business_ele"])) == 1 {
|
||||
storeStatus = model.StoreStatusOpened
|
||||
|
||||
Reference in New Issue
Block a user