From 60ea461e39cb33902ec5fc4b0e567c1b433f2ab9 Mon Sep 17 00:00:00 2001 From: gazebo Date: Sun, 9 Sep 2018 18:21:40 +0800 Subject: [PATCH 1/2] - disable call QuerySingleOrder when received DeliveryStatusAccepted msg. --- business/partner/purchase/jd/waybill.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/business/partner/purchase/jd/waybill.go b/business/partner/purchase/jd/waybill.go index b633dd3e7..c08438a1e 100644 --- a/business/partner/purchase/jd/waybill.go +++ b/business/partner/purchase/jd/waybill.go @@ -6,7 +6,6 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/partner" - "git.rosy.net.cn/jx-callback/globals/api" ) func (c *PurchaseHandler) OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) { @@ -22,13 +21,14 @@ func (c *PurchaseHandler) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (re case jdapi.DeliveryStatusWait4Grap: order.Status = model.WaybillStatusNew case jdapi.DeliveryStatusAccepted: - if result, err := api.JdAPI.QuerySingleOrder(msg.OrderID); err == nil { - // 默认配送费=订单应付运费(orderReceivableFreight) - //订单应付运费为未优惠前应付运费(满免优惠,运费优惠券,VIP免基础运费,用户小费)ps:用户小费是用户给配送员的小费 - order.DesiredFee = utils.Interface2Int64WithDefault(result["orderReceivableFreight"], 0) + - utils.Interface2Int64WithDefault(result["merchantPaymentDistanceFreightMoney"], 0) + - utils.Interface2Int64WithDefault(result["tips"], 0) - } + // todo 性能问题,暂时取消调用 + // if result, err := api.JdAPI.QuerySingleOrder(msg.OrderID); err == nil { + // // 默认配送费=订单应付运费(orderReceivableFreight) + // //订单应付运费为未优惠前应付运费(满免优惠,运费优惠券,VIP免基础运费,用户小费)ps:用户小费是用户给配送员的小费 + // order.DesiredFee = utils.Interface2Int64WithDefault(result["orderReceivableFreight"], 0) + + // utils.Interface2Int64WithDefault(result["merchantPaymentDistanceFreightMoney"], 0) + + // utils.Interface2Int64WithDefault(result["tips"], 0) + // } order.Status = model.WaybillStatusAccepted case jdapi.DeliveryStatusCourierCanceled: order.Status = model.WaybillStatusAcceptCanceled From 52041a142e89dbce59a41b0c1284210b55c1386f Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 11 Sep 2018 22:22:13 +0800 Subject: [PATCH 2/2] - ebai --- business/model/const.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/business/model/const.go b/business/model/const.go index 6b06c8122..92428ed01 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -7,7 +7,8 @@ const ( VendorIDJD = 0 VendorIDMTWM = 1 VendorIDELM = 2 - VendorIDPurchaseEnd = 2 + VendorIDEBAI = 3 + VendorIDPurchaseEnd = 3 VendorIDDeliveryBegin = 101 VendorIDDada = 101 @@ -21,6 +22,7 @@ var ( VendorIDJD: "JD", VendorIDMTWM: "MT", VendorIDELM: "ELEME", + VendorIDEBAI: "EBAI", VendorIDDada: "Dada", VendorIDMTPS: "MTPS", } @@ -28,6 +30,7 @@ var ( VendorIDJD: "京东到家", VendorIDMTWM: "美团外卖", VendorIDELM: "饿了么", + VendorIDEBAI: "饿百新零售", VendorIDDada: "达达众包", VendorIDMTPS: "美团配送", }