From 2b55cd85665674ef1ef9fe8acbfc4632ab1381de Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 8 May 2019 18:18:56 +0800 Subject: [PATCH] =?UTF-8?q?-=20BaseScheduler.CreateWaybill=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E8=BD=AC=E5=95=86=E5=AE=B6=E8=87=AA=E9=80=81=E7=9A=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=AA=E5=85=81=E8=AE=B8=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=9C=89=E6=95=88=E8=BF=90=E5=8D=95=EF=BC=88=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=B3=A8=E9=87=8A=E6=8E=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jxcallback/scheduler/basesch/basesch.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/business/jxcallback/scheduler/basesch/basesch.go b/business/jxcallback/scheduler/basesch/basesch.go index 92b53bcb4..cdf624c38 100644 --- a/business/jxcallback/scheduler/basesch/basesch.go +++ b/business/jxcallback/scheduler/basesch/basesch.go @@ -149,9 +149,18 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr globals.SugarLogger.Warnf("CreateWaybill orderID:%s, vendorID:%d is not solid!!!", order.VendorOrderID, platformVendorID) return nil, scheduler.ErrOrderIsNotSolid } - if c.IsReallyCallPlatformAPI { - handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID) - if handlerInfo != nil && handlerInfo.Use4CreateWaybill { + // if order.DeliveryFlag&model.OrderDeliveryFlagMaskScheduleDisabled != 0 { + // waybillList, err := partner.CurOrderManager.GetOrderWaybillInfo(jxcontext.AdminCtx, order.VendorOrderID, order.VendorID, true) + // if err != nil { + // return nil, err + // } + // if len(waybillList) > 0 { + // return nil, fmt.Errorf("转商家自送的订单只允许有一个有效运单,当前已经有%s运单", jxutils.GetVendorName(waybillList[0].WaybillVendorID)) + // } + // } + handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID) + if handlerInfo != nil && handlerInfo.Use4CreateWaybill { + if c.IsReallyCallPlatformAPI { bill, err = handlerInfo.Handler.CreateWaybill(order, policy) if err != nil { globals.SugarLogger.Infof("CreateWaybill failed orderID:%s vendorID:%d with error:%v", order.VendorOrderID, platformVendorID, err) @@ -159,9 +168,9 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr order.DeliveryFlag |= model.WaybillVendorID2Mask(platformVendorID) err = partner.CurOrderManager.UpdateOrderStatusAndFlag(order) } - } else { - err = scheduler.ErrDeliverProviderWrong } + } else { + err = scheduler.ErrDeliverProviderWrong } return bill, err }