- fixed mtps fee cal bug.

This commit is contained in:
gazebo
2018-07-19 21:10:26 +08:00
parent 61157174e6
commit 680c0a0696
6 changed files with 16 additions and 11 deletions

View File

@@ -23,13 +23,13 @@ func (c *WaybillController) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (
order := c.callbackMsg2Waybill(msg)
switch msg.DeliveryStatus {
case jdapi.DeliveryStatusWait4Grap:
order.Status = model.WaybillStatusNew
case jdapi.DeliveryStatusAccepted:
if result, err := api.JdAPI.QuerySingleOrder(msg.OrderID); err == nil {
order.DesiredFee = utils.Interface2Int64WithDefault(result["orderFreightMoney"], 0) +
utils.Interface2Int64WithDefault(result["merchantPaymentDistanceFreightMoney"], 0) +
utils.Interface2Int64WithDefault(result["tips"], 0)
}
order.Status = model.WaybillStatusNew
case jdapi.DeliveryStatusAccepted:
order.Status = model.WaybillStatusAccepted
case jdapi.DeliveryStatusCourierCanceled:
order.Status = model.WaybillStatusCanceled