Merge remote-tracking branch 'origin/master' into jxstore
This commit is contained in:
@@ -22,6 +22,7 @@ var (
|
||||
VendorIDJD: "JD",
|
||||
VendorIDMTWM: "MT",
|
||||
VendorIDELM: "ELEME",
|
||||
VendorIDEBAI: "EBAI",
|
||||
VendorIDDada: "Dada",
|
||||
VendorIDMTPS: "MTPS",
|
||||
}
|
||||
@@ -29,6 +30,7 @@ var (
|
||||
VendorIDJD: "京东到家",
|
||||
VendorIDMTWM: "美团外卖",
|
||||
VendorIDELM: "饿了么",
|
||||
VendorIDEBAI: "饿百新零售",
|
||||
VendorIDDada: "达达众包",
|
||||
VendorIDMTPS: "美团配送",
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user