- 购买平台自己的运单事件,只有在收到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 ( var (
waybillOrderStatusMap = map[int]int{ waybillOrderStatusMap = map[int]int{
model.WaybillStatusApplyFailedGetGoods: model.WaybillStatusApplyFailedGetGoods, model.WaybillStatusApplyFailedGetGoods: model.OrderStatusApplyFailedGetGoods,
model.WaybillStatusAgreeFailedGetGoods: model.WaybillStatusAgreeFailedGetGoods, model.WaybillStatusAgreeFailedGetGoods: model.OrderStatusAgreeFailedGetGoods,
model.WaybillStatusRefuseFailedGetGoods: model.WaybillStatusRefuseFailedGetGoods, model.WaybillStatusRefuseFailedGetGoods: model.OrderStatusRefuseFailedGetGoods,
model.WaybillStatusDeliverFailed: model.WaybillStatusDeliverFailed, 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) globals.SugarLogger.Debugf("OnWaybillStatusChanged bill not exist! orderID:%s, bill:%v", bill.VendorOrderID, bill)
} }
switch bill.Status { switch bill.Status {
case model.WaybillStatusAccepted, model.WaybillStatusDelivering: case model.WaybillStatusAccepted, model.WaybillStatusCourierArrived, model.WaybillStatusDelivering:
s.resetTimer(savedOrderInfo, bill, isPending) s.resetTimer(savedOrderInfo, bill, isPending)
if (isBillExist || bill.WaybillVendorID != model.VendorIDDada) && !isPending { // todo 达达运单有错序的情况,临时看看 if (isBillExist || bill.WaybillVendorID != model.VendorIDDada) && !isPending { // todo 达达运单有错序的情况,临时看看
isBillAlreadyCandidate := s.isBillCandidate(order, bill) 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) s.cancelOtherWaybillsCheckOrderDeliveryFlag(savedOrderInfo, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
if model.IsWaybillPlatformOwn(bill) { if model.IsWaybillPlatformOwn(bill) {
// 强制将订单状态置为配送中? if bill.Status == model.WaybillStatusDelivering {
order.Status = model.OrderStatusDelivering // 强制将订单状态置为配送中?
partner.CurOrderManager.UpdateOrderStatusAndFlag(order) order.Status = model.OrderStatusDelivering
partner.CurOrderManager.UpdateOrderStatusAndFlag(order)
}
} else { } else {
if savedOrderInfo.storeDeliveryType == scheduler.StoreDeliveryTypeByStore || if savedOrderInfo.storeDeliveryType == scheduler.StoreDeliveryTypeByStore ||
model.IsSpecialOrderPlatformWaybill(bill) { 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) globals.SugarLogger.Warnf("OnWaybillStatusChanged AcceptCanceled orderID:%s got multiple bill:%v, order details:%v", order.VendorOrderID, bill, order)
} }
} }
case model.WaybillStatusCourierArrived: // do nothing // case model.WaybillStatusCourierArrived: // do nothing
s.resetTimer(savedOrderInfo, bill, isPending) // s.resetTimer(savedOrderInfo, bill, isPending)
if s.isBillCandidate(order, bill) { // if s.isBillCandidate(order, bill) {
} else { // } else {
// s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime) // // 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) // 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: case model.WaybillStatusCanceled, model.WaybillStatusFailed:
s.removeWaybillFromMap(savedOrderInfo, bill.WaybillVendorID) s.removeWaybillFromMap(savedOrderInfo, bill.WaybillVendorID)
if s.isBillCandidate(order, bill) || order.WaybillVendorID == model.VendorIDUnknown { if s.isBillCandidate(order, bill) || order.WaybillVendorID == model.VendorIDUnknown {