aa
This commit is contained in:
@@ -235,16 +235,11 @@ func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID s
|
||||
}
|
||||
//如果售后退款的商品数等于订单商品数,我就当是全部退款了
|
||||
if afsCount == orderCount {
|
||||
for _, v := range waybills {
|
||||
if err = c.CancelWaybill(v, partner.CancelWaybillReasonOther, partner.CancelWaybillReasonStrActive); err == nil {
|
||||
v.DeliveryFlag |= model.WaybillDeliveryFlagMaskActiveCancel
|
||||
_, err = dao.UpdateEntity(db, v, "Status", "DeliveryFlag")
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("AgreeOrRefuseRefund, cancelwaybill error: %v", err)
|
||||
}
|
||||
}
|
||||
order.DeliveryFlag |= model.OrderDeliveryFlagMaskScheduleDisabled
|
||||
partner.CurOrderManager.UpdateOrderFields(order, []string{"DeliveryFlag"})
|
||||
for _, v := range waybills {
|
||||
c.CancelWaybill(v, partner.CancelWaybillReasonOther, partner.CancelWaybillReasonStrActive)
|
||||
}
|
||||
}
|
||||
}
|
||||
if order.EarningType == model.EarningTypePoints {
|
||||
|
||||
@@ -676,17 +676,17 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
|
||||
if model.IsOrderHaveWaybill(order) {
|
||||
s.updateOrderByBill(order, nil, true)
|
||||
}
|
||||
if order.VendorID == model.VendorIDMTWM {
|
||||
order, _ = partner.CurOrderManager.LoadOrder(order.VendorOrderID, order.VendorID)
|
||||
}
|
||||
//if order.VendorID == model.VendorIDMTWM {
|
||||
// order, _ = partner.CurOrderManager.LoadOrder(order.VendorOrderID, order.VendorID)
|
||||
//}
|
||||
// 3方的运单取消才会重新发起创建3方订单,购物平台的运单取消后,它本身还会再创建新运单(NewWaybill事件有相应TIMER)),至少京东是这样的,暂时按京东的行为来
|
||||
// 现在发现饿百取消订单后不会再创建运单了,所以饿百运单取消也允许直接创建三方运单
|
||||
// 之前的条件是order.Status < model.OrderStatusDelivering,但像订单902322817000122确实有在配送中取消状态,改成非订单结束状态都可以
|
||||
// OrderStatusFinishedPickup状态的订单依赖于TIMER重新建运单
|
||||
if bill.DeliveryFlag&model.WaybillDeliveryFlagMaskActiveCancel == 0 {
|
||||
if (order.Status >= model.OrderStatusFinishedPickup && order.Status < model.OrderStatusEndBegin) && (bill.WaybillVendorID != order.VendorID /* || bill.WaybillVendorID == model.VendorIDEBAI*/) && (order.DeliveryFlag&model.OrderDeliveryFlagMaskScheduleDisabled) == 0 {
|
||||
s.createWaybillOn3rdProviders(savedOrderInfo, 0, nil)
|
||||
}
|
||||
//if (order.Status >= model.OrderStatusFinishedPickup && order.Status < model.OrderStatusEndBegin) && (bill.WaybillVendorID != order.VendorID /* || bill.WaybillVendorID == model.VendorIDEBAI*/) && (order.DeliveryFlag&model.OrderDeliveryFlagMaskScheduleDisabled) == 0 {
|
||||
// s.createWaybillOn3rdProviders(savedOrderInfo, 0, nil)
|
||||
//}
|
||||
}
|
||||
//if order.Status < model.OrderStatusDelivering {
|
||||
// if order.VendorID == model.VendorIDMTWM && order.DeliveryType == model.OrderDeliveryTypePlatform {
|
||||
|
||||
Reference in New Issue
Block a user