From 63115e3a16a94ea9a9996ff2629345c4de4e8a26 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 18 Feb 2019 16:40:05 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E9=83=A8=E5=88=86=E5=BF=AB=E9=80=92?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=9C=A8=E5=8F=96=E6=B6=88=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E6=9C=89=E6=97=B6=E4=BC=9A=E4=B8=8D=E5=8F=91=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E5=8F=96=E6=B6=88=E6=B6=88=E6=81=AF=E8=BF=87=E6=9D=A5?= =?UTF-8?q?=EF=BC=88=E6=AF=94=E5=A6=82=E8=BE=BE=E8=BE=BE=EF=BC=8C904200512?= =?UTF-8?q?000442=EF=BC=89=EF=BC=8C=E4=B8=BA=E9=81=BF=E5=85=8D=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=8F=96=E6=B6=88=E6=8A=A5=E9=94=99=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD(in=20BaseSchedule?= =?UTF-8?q?r.CancelWaybill)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/basesch/basesch.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/business/jxcallback/scheduler/basesch/basesch.go b/business/jxcallback/scheduler/basesch/basesch.go index 412037d9f..337cf11be 100644 --- a/business/jxcallback/scheduler/basesch/basesch.go +++ b/business/jxcallback/scheduler/basesch/basesch.go @@ -160,11 +160,14 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr func (c *BaseScheduler) CancelWaybill(bill *model.Waybill, cancelReasonID int, cancelReason string) (err error) { globals.SugarLogger.Infof("CancelWaybill bill:%v, cancelReasonID:%d cancelReason:%s", bill, cancelReasonID, cancelReason) - if c.IsReallyCallPlatformAPI && bill.OrderVendorID != bill.WaybillVendorID { + // 部分快递平台在取消成功后有时会不发运单取消消息过来(比如达达,904200512000442),为避免二次取消报错,添加状态判断 + if c.IsReallyCallPlatformAPI && bill.OrderVendorID != bill.WaybillVendorID && bill.Status != model.WaybillStatusCanceled { if handlerInfo := partner.GetDeliveryPlatformFromVendorID(bill.WaybillVendorID); handlerInfo != nil { - err = utils.CallFuncLogError(func() error { + if err = utils.CallFuncLogError(func() error { return handlerInfo.Handler.CancelWaybill(bill, cancelReasonID, cancelReason) - }, "CancelWaybill bill:%v", bill) + }, "CancelWaybill bill:%v", bill); err == nil { + bill.Status = model.WaybillStatusCanceled + } globals.SugarLogger.Debugf("CancelWaybill bill:%v canceled by myself", bill) } }