- 重构创建运单策略

This commit is contained in:
gazebo
2019-03-30 15:00:59 +08:00
parent 68b5ec38b6
commit 10a444c895
11 changed files with 142 additions and 125 deletions

View File

@@ -3,6 +3,7 @@ package basesch
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
"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"
@@ -138,8 +139,8 @@ func (c *BaseScheduler) SelfDeliverDelivered(order *model.GoodsOrder, userName s
return err
}
func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOrder, policy func(deliveryFee, addFee int64) error) (bill *model.Waybill, err error) {
globals.SugarLogger.Infof("CreateWaybill orderID:%s, vendorID:%d", order.VendorOrderID, platformVendorID)
func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOrder, policy partner.CreateWaybillPolicy) (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)
return nil, scheduler.ErrOrderIsNotSolid

View File

@@ -13,7 +13,7 @@ import (
"git.rosy.net.cn/jx-callback/globals"
)
func (c *BaseScheduler) CreateWaybillOnProviders(order *model.GoodsOrder, userName string, courierVendorIDs []int, policyHandler func(deliveryFee, addFee int64) error) (bills []*model.Waybill, err error) {
func (c *BaseScheduler) CreateWaybillOnProviders(order *model.GoodsOrder, userName string, courierVendorIDs []int, policyHandler partner.CreateWaybillPolicy) (bills []*model.Waybill, err error) {
globals.SugarLogger.Infof("CreateWaybillOnProviders orderID:%s userName:%s", order.VendorOrderID, userName)
var errList []string
for _, courierVendorID := range courierVendorIDs {