- fix calculateOrderDeliveryFee bug for weight.

This commit is contained in:
gazebo
2018-09-05 22:48:15 +08:00
parent 1ed1838802
commit c52e8deade
4 changed files with 7 additions and 7 deletions

View File

@@ -144,11 +144,11 @@ func (c *DeliveryHandler) calculateOrderDeliveryFee(order *model.GoodsOrder, bil
if order.Weight < 5*1000 {
} else if order.Weight < 10*1000 {
addFee += jxutils.StandardPrice2Int(0.5 * float64(order.Weight/1000-5))
addFee += jxutils.StandardPrice2Int(0.5 * float64(jxutils.IntWeight2Float(order.Weight)-5))
} else if order.Weight < 20*1000 {
addFee += jxutils.StandardPrice2Int(2.5 + 1*float64(order.Weight/1000-10))
addFee += jxutils.StandardPrice2Int(2.5 + 1*float64(jxutils.IntWeight2Float(order.Weight)-10))
} else {
addFee += jxutils.StandardPrice2Int(2.5 + 10 + 2*float64(order.Weight/1000-20))
addFee += jxutils.StandardPrice2Int(2.5 + 10 + 2*float64(jxutils.IntWeight2Float(order.Weight)-20))
}
hour, min, sec := billTime.Clock()
@@ -191,7 +191,7 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, policy func(del
ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat),
ReceiverLat: jxutils.StandardCoordinate2Int(latFloat),
GoodsValue: jxutils.IntPrice2Standard(order.ActualPayPrice), // todo 超价处理
GoodsWeight: float64(order.Weight) / 1000,
GoodsWeight: float64(jxutils.IntWeight2Float(order.Weight)),
// ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(),
OrderType: mtpsapi.OrderTypeASAP,
}