- 购买平台自己的运单事件,只有在收到WaybillStatusDelivering才强制设置订单状态为配送中

This commit is contained in:
gazebo
2019-05-19 13:11:21 +08:00
parent 2fe73ef898
commit fbb328409e
2 changed files with 17 additions and 15 deletions

View File

@@ -13,10 +13,10 @@ import (
var (
waybillOrderStatusMap = map[int]int{
model.WaybillStatusApplyFailedGetGoods: model.WaybillStatusApplyFailedGetGoods,
model.WaybillStatusAgreeFailedGetGoods: model.WaybillStatusAgreeFailedGetGoods,
model.WaybillStatusRefuseFailedGetGoods: model.WaybillStatusRefuseFailedGetGoods,
model.WaybillStatusDeliverFailed: model.WaybillStatusDeliverFailed,
model.WaybillStatusApplyFailedGetGoods: model.OrderStatusApplyFailedGetGoods,
model.WaybillStatusAgreeFailedGetGoods: model.OrderStatusAgreeFailedGetGoods,
model.WaybillStatusRefuseFailedGetGoods: model.OrderStatusRefuseFailedGetGoods,
model.WaybillStatusDeliverFailed: model.OrderStatusDeliverFailed,
}
)

View File

@@ -402,7 +402,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
globals.SugarLogger.Debugf("OnWaybillStatusChanged bill not exist! orderID:%s, bill:%v", bill.VendorOrderID, bill)
}
switch bill.Status {
case model.WaybillStatusAccepted, model.WaybillStatusDelivering:
case model.WaybillStatusAccepted, model.WaybillStatusCourierArrived, model.WaybillStatusDelivering:
s.resetTimer(savedOrderInfo, bill, isPending)
if (isBillExist || bill.WaybillVendorID != model.VendorIDDada) && !isPending { // todo 达达运单有错序的情况,临时看看
isBillAlreadyCandidate := s.isBillCandidate(order, bill)
@@ -417,9 +417,11 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
s.cancelOtherWaybillsCheckOrderDeliveryFlag(savedOrderInfo, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
if model.IsWaybillPlatformOwn(bill) {
// 强制将订单状态置为配送中?
order.Status = model.OrderStatusDelivering
partner.CurOrderManager.UpdateOrderStatusAndFlag(order)
if bill.Status == model.WaybillStatusDelivering {
// 强制将订单状态置为配送中?
order.Status = model.OrderStatusDelivering
partner.CurOrderManager.UpdateOrderStatusAndFlag(order)
}
} else {
if savedOrderInfo.storeDeliveryType == scheduler.StoreDeliveryTypeByStore ||
model.IsSpecialOrderPlatformWaybill(bill) {
@@ -461,13 +463,13 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
globals.SugarLogger.Warnf("OnWaybillStatusChanged AcceptCanceled orderID:%s got multiple bill:%v, order details:%v", order.VendorOrderID, bill, order)
}
}
case model.WaybillStatusCourierArrived: // do nothing
s.resetTimer(savedOrderInfo, bill, isPending)
if s.isBillCandidate(order, bill) {
} else {
// s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
globals.SugarLogger.Infof("OnWaybillStatusChanged CourierArrived order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill)
}
// case model.WaybillStatusCourierArrived: // do nothing
// s.resetTimer(savedOrderInfo, bill, isPending)
// if s.isBillCandidate(order, bill) {
// } else {
// // s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
// globals.SugarLogger.Infof("OnWaybillStatusChanged CourierArrived order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill)
// }
case model.WaybillStatusCanceled, model.WaybillStatusFailed:
s.removeWaybillFromMap(savedOrderInfo, bill.WaybillVendorID)
if s.isBillCandidate(order, bill) || order.WaybillVendorID == model.VendorIDUnknown {