- 修复CreateWaybillOnProviders中的BUG

This commit is contained in:
gazebo
2019-08-01 10:58:52 +08:00
parent a7b9a49982
commit fe5bb1e844

View File

@@ -15,7 +15,7 @@ import (
func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *model.GoodsOrder, courierVendorIDs, excludeCourierVendorIDs []int, policyHandler partner.CreateWaybillPolicyFunc, createOnlyOne bool) (bills []*model.Waybill, err error) {
userName := ctx.GetUserName()
globals.SugarLogger.Infof("CreateWaybillOnProviders orderID:%s userName:%s", order.VendorOrderID, userName)
globals.SugarLogger.Infof("CreateWaybillOnProviders orderID:%s userName:%s, courierVendorIDs:%v, excludeCourierVendorIDs:%v", order.VendorOrderID, userName, courierVendorIDs, excludeCourierVendorIDs)
storeCourierList, err := dao.GetStoreCourierList(dao.GetDB(), jxutils.GetSaleStoreIDFromOrder(order), model.StoreStatusOpened)
if err != nil {
return nil, err
@@ -24,8 +24,8 @@ func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *
excludeCourierVendorIDMap := jxutils.IntList2Map(excludeCourierVendorIDs)
var errList []string
for _, storeCourier := range storeCourierList {
if (courierVendorIDMap == nil || courierVendorIDMap[storeCourier.VendorID] == 1) &&
(excludeCourierVendorIDMap == nil || excludeCourierVendorIDMap[storeCourier.VendorID] == 0) {
if (courierVendorIDs == nil || courierVendorIDMap[storeCourier.VendorID] == 1) &&
(excludeCourierVendorIDs == nil || excludeCourierVendorIDMap[storeCourier.VendorID] == 0) {
if handler := partner.GetDeliveryPlatformFromVendorID(storeCourier.VendorID); handler != nil && handler.Use4CreateWaybill {
courierVendorID := storeCourier.VendorID
if order.VendorID != model.VendorIDWSC || courierVendorID != model.VendorIDDada { // 达达作为微商城的自有配送,不参与配送竞争