美团在召唤三方配送时将美团外卖转自送,如果转自送接口返回值不是ok则取消所有的三方配送!

This commit is contained in:
邹宗楠
2022-04-16 15:42:17 +08:00
parent 2cbf031d51
commit 3b047ee900
2 changed files with 9 additions and 6 deletions

View File

@@ -591,6 +591,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
globals.SugarLogger.Infof("OnWaybillStatusChanged orderID:%s purchase platform waybill arrvied later, may cause problem", order.VendorOrderID)
}
s.updateOrderByBill(order, bill, false)
// 转自送
s.cancelOtherWaybillsCheckOrderDeliveryFlag(savedOrderInfo, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
//若接单时间不在门店的营业时间范围内要取消运单
s.cancelWaybillNotInStoreOpentime(savedOrderInfo, bill)
@@ -630,6 +631,8 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
} else {
if model.IsOrderDeliveryByStore(savedOrderInfo.order) {
if err := s.SelfDeliverDelivering(savedOrderInfo.order, bill.CourierMobile); err != nil {
// 转自送失败,取消三方配送
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrSwitch2SelfFailed)
partner.CurOrderManager.OnOrderMsg(order, "自送出设置失败", err.Error())
}
s.notify3rdPartyWaybill(order, bill, isBillAlreadyCandidate)

View File

@@ -29,12 +29,12 @@ type GoodsOrderExt struct {
CurrentConsigneeMobile string `orm:"-" json:"currentConsigneeMobile"`
CourierVendorName string `json:"courierVendorName"`
Status2 string `json:"status2"`
ActualFee int64 `json:"actualFee"` // 实际要支付给快递公司的费用
DesiredFee int64 `json:"desiredFee"` // 运单总费用
WaybillCreatedAt time.Time `orm:"type(datetime);index" json:"waybillCreatedAt"`
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
VendorWaybillId2Waybill string `orm:"column(vendor_waybill_id2);size(48)" json:"vendorWaybillId2Waybill"` // 某些平台有多个ID比如美团配送当前美团配送的 delivery_id存这里
Status2 string `json:"status2"`
ActualFee int64 `json:"actualFee"` // 实际要支付给快递公司的费用
DesiredFee int64 `json:"desiredFee"` // 运单总费用
WaybillCreatedAt time.Time `orm:"type(datetime);index" json:"waybillCreatedAt"`
WaybillFinishedAt time.Time `orm:"type(datetime)" json:"waybillFinishedAt"`
VendorWaybillId2Waybill string `orm:"column(vendor_waybill_id2);size(48)" json:"vendorWaybillId2Waybill"` // 某些平台有多个ID比如美团配送当前美团配送的 delivery_id存这里
DistrictName string `json:"districtName"`
CityName string `json:"cityName"`