- fk
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ebai
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"math"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -25,8 +24,8 @@ const (
|
||||
pickupOrderDelay = 240 * time.Second
|
||||
pickupOrderGap = 30
|
||||
// fakePickedUp = "9527"
|
||||
fakeUserApplyCancel = "user_apply_cancel"
|
||||
fakeAcceptOrder = "accept_order"
|
||||
fakeUserApplyCancel = "fake_user_apply_cancel"
|
||||
fakeAcceptOrder = "fake_accept_order"
|
||||
)
|
||||
|
||||
// 饿百的接单会直接召唤配送,为了统一将饿百的接单影射成拣货完成,然后模拟一个接单消息
|
||||
@@ -274,8 +273,11 @@ func (c *PurchaseHandler) callbackMsg2Status(msg *ebaiapi.CallbackMsg) (orderSta
|
||||
orderStatus = nil
|
||||
}
|
||||
} else if status, ok := msg.Body["status"]; ok {
|
||||
vendorStatus := utils.Int64ToStr(utils.MustInterface2Int64(status))
|
||||
orderStatus.VendorStatus = vendorStatus
|
||||
if vendorStatus, ok := status.(string); ok {
|
||||
orderStatus.VendorStatus = vendorStatus
|
||||
} else {
|
||||
orderStatus.VendorStatus = utils.Int64ToStr(utils.MustInterface2Int64(status))
|
||||
}
|
||||
orderStatus.Status = c.GetStatusFromVendorStatus(orderStatus.VendorStatus)
|
||||
orderStatus.Remark = utils.Interface2String(msg.Body["reason"])
|
||||
} else {
|
||||
@@ -318,7 +320,7 @@ func (c *PurchaseHandler) postFakeOrderAcceptMsg(vendorOrderID string) {
|
||||
Cmd: ebaiapi.CmdOrderStatus,
|
||||
Timestamp: time.Now().Unix(),
|
||||
Body: map[string]interface{}{
|
||||
"status": json.Number(fakeAcceptOrder), // json.Number实际是string
|
||||
"status": fakeAcceptOrder,
|
||||
"order_id": vendorOrderID,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user