This commit is contained in:
邹宗楠
2022-05-28 13:51:17 +08:00
parent b673ac24c4
commit aba49a367a

View File

@@ -519,24 +519,24 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
// return nil
// }
// if (order.DeliveryFlag & model.OrderDeliveryFlagMaskScheduleDisabled) == 0 { // 如果被停止调度,整个不动作
if bill.Status == model.WaybillStatusNew {
s.addWaybill2Map(savedOrderInfo, bill)
if !isPending {
if order.Status >= model.OrderStatusDelivering && order.DeliveryType == model.OrderDeliveryTypeStoreSelf{
s.SelfDeliverDelivered(order, "订单在配送中来了新运单,如果是自送则转自送")
}
if order.Status >= model.OrderStatusDelivering && order.DeliveryType != model.OrderDeliveryTypeStoreSelf{
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
}
if order.Status > model.OrderStatusEndBegin {
if order.Status >= model.OrderStatusDelivering && order.Status < model.OrderStatusEndBegin {
if order.DeliveryType == model.OrderDeliveryTypeStoreSelf {
s.SelfDeliverDelivering(order, bill.CourierMobile)
} else {
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
}
} else if order.Status > model.OrderStatusEndBegin {
// 订单处于完成状态,来的新运单,取消三方配送,转自送!
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
s.SelfDeliverDelivered(order, "自送或三方")
partner.CurOrderManager.OnOrderMsg(order, "订单处于结束状态来的运单", "取消三方运单转自送1")
} else {
needAddTip := order.WaybillTipMoney > 0 && !model.IsWaybillPlatformOwn(bill)
if model.IsOrderHaveWaybill(order) {// 是否有有效运单
if model.IsOrderHaveWaybill(order) { // 是否有有效运单
globals.SugarLogger.Debugf("OnWaybillStatusChanged multiple waybill created, bill:%v", bill)
if model.IsWaybillPlatformOwn(bill) { // 是购物平台运单
if !model.IsOrderHaveOwnWaybill(order) { // 既有运单不是购物平台运单