Merge remote-tracking branch 'origin/master' into jxstore

This commit is contained in:
gazebo
2018-09-11 22:22:42 +08:00
2 changed files with 10 additions and 8 deletions

View File

@@ -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: "美团配送",
}

View File

@@ -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