1
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/smsmsg"
|
"git.rosy.net.cn/jx-callback/business/jxutils/smsmsg"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -744,10 +745,6 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
|
|||||||
s.resetTimer(savedOrderInfo, bill, isPending)
|
s.resetTimer(savedOrderInfo, bill, isPending)
|
||||||
s.removeWaybillFromMap(savedOrderInfo, bill.WaybillVendorID)
|
s.removeWaybillFromMap(savedOrderInfo, bill.WaybillVendorID)
|
||||||
|
|
||||||
if order.DeliveryType == model.OrderDeliveryTypeStoreSelf { // 只要门店自送,订单结束都推一下送达!(bug完成的订单还会继续美团外卖送)
|
|
||||||
s.SelfDeliverDelivered(order, "")
|
|
||||||
s.swtich2SelfDeliverWithRetry(savedOrderInfo, bill, switch2SelfDeliverRetryCount, switch2SelfDeliverRetryGap)
|
|
||||||
}
|
|
||||||
if !isPending {
|
if !isPending {
|
||||||
var err2 error
|
var err2 error
|
||||||
if !model.IsWaybillPlatformOwn(bill) {
|
if !model.IsWaybillPlatformOwn(bill) {
|
||||||
@@ -1029,7 +1026,7 @@ func (s *DefScheduler) swtich2SelfDeliverWithRetry(savedOrderInfo *WatchOrderInf
|
|||||||
order := savedOrderInfo.order
|
order := savedOrderInfo.order
|
||||||
globals.SugarLogger.Debugf("swtich2SelfDeliverWithRetry orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("swtich2SelfDeliverWithRetry orderID:%s", order.VendorOrderID)
|
||||||
if order.WaybillVendorID != order.VendorID {
|
if order.WaybillVendorID != order.VendorID {
|
||||||
if err := s.Swtich2SelfDeliver(order, ""); err != nil && (err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation || err != scheduler.ErrOrderStatusAlreadySatisfyCurOperationELM || err != scheduler.ErrOrderStatusAlreadySatisfyCurOperationMTWM) {
|
if err := s.Swtich2SelfDeliver(order, ""); err != nil && (err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation || err != scheduler.ErrOrderStatusAlreadySatisfyCurOperationELM || !strings.Contains(err.Error(), "1047")) { //1047美团混合送
|
||||||
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry failed, bill:%v, err:%v", bill, err)
|
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry failed, bill:%v, err:%v", bill, err)
|
||||||
if retryCount > 0 {
|
if retryCount > 0 {
|
||||||
utils.AfterFuncWithRecover(duration, func() {
|
utils.AfterFuncWithRecover(duration, func() {
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ var (
|
|||||||
ErrOrderStatusIsNotSuitable4CurOperation = errors.New("订单锁定或状态不适合当前操作")
|
ErrOrderStatusIsNotSuitable4CurOperation = errors.New("订单锁定或状态不适合当前操作")
|
||||||
ErrOrderStatusAlreadySatisfyCurOperation = errors.New("订单当前状态已满足当前操作")
|
ErrOrderStatusAlreadySatisfyCurOperation = errors.New("订单当前状态已满足当前操作")
|
||||||
ErrOrderStatusAlreadySatisfyCurOperationELM = errors.New("无需切自配送")
|
ErrOrderStatusAlreadySatisfyCurOperationELM = errors.New("无需切自配送")
|
||||||
ErrOrderStatusAlreadySatisfyCurOperationMTWM = errors.New("非专送、快送、混合送订单不允许调用此接口 level:0, code:1047")
|
//ErrOrderStatusAlreadySatisfyCurOperationMTWM = errors.New("非专送、快送、混合送订单不允许调用此接口 level:0, code:1047")
|
||||||
|
ErrOrderStatusAlreadySatisfyCurOperationMTWM = errors.New("code:1047")
|
||||||
|
|
||||||
ErrCanNotCreateAtLeastOneWaybill = errors.New("一个运单都不能创建")
|
ErrCanNotCreateAtLeastOneWaybill = errors.New("一个运单都不能创建")
|
||||||
ErrCanNotFindOrder = errors.New("不能找到订单(一般是由于事件错序)")
|
ErrCanNotFindOrder = errors.New("不能找到订单(一般是由于事件错序)")
|
||||||
|
|||||||
Reference in New Issue
Block a user