三方运单计价各管各,不在以美团为基准,创建运单只有一个限制条件,最高运费:maxDeliveryFee

优化美团运费计算,两点距离用高德API实际计算行走距离
This commit is contained in:
gazebo
2019-09-26 15:47:18 +08:00
parent 860040e6f1
commit 78930d9c1a
12 changed files with 168 additions and 125 deletions

View File

@@ -142,7 +142,7 @@ func (c *BaseScheduler) SelfDeliverDelivered(order *model.GoodsOrder, userName s
return err
}
func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOrder, policy partner.CreateWaybillPolicyFunc) (bill *model.Waybill, err error) {
func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOrder, maxDeliveryFee int64) (bill *model.Waybill, err error) {
globals.SugarLogger.Infof("CreateWaybill orderID:%s, vendor:%s", order.VendorOrderID, jxutils.GetVendorName(platformVendorID))
if !model.IsOrderSolid(order) { // 如果订单是不完整的
globals.SugarLogger.Warnf("CreateWaybill orderID:%s, vendorID:%d is not solid!!!", order.VendorOrderID, platformVendorID)
@@ -160,7 +160,7 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
if handlerInfo != nil && handlerInfo.Use4CreateWaybill {
if c.IsReallyCallPlatformAPI {
bill, err = handlerInfo.Handler.CreateWaybill(order, policy)
bill, err = handlerInfo.Handler.CreateWaybill(order, maxDeliveryFee)
if err != nil {
globals.SugarLogger.Infof("CreateWaybill failed orderID:%s vendorID:%d with error:%v", order.VendorOrderID, platformVendorID, err)
} else {