- send weixin msg more accurately.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/legacymodel"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/scheduler"
|
||||
@@ -205,6 +206,9 @@ func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool) (err
|
||||
savedOrderInfo.SetOrder(order) // 调整单或消息错序都可能进到这里来
|
||||
}
|
||||
s.resetTimer(savedOrderInfo, nil, isPending)
|
||||
if !isPending {
|
||||
weixinmsg.NotifyNewOrder(order)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -285,6 +289,9 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
|
||||
s.swtich2SelfDeliverWithRetry(savedOrderInfo, bill, 2, 10*time.Second)
|
||||
}
|
||||
}
|
||||
if !isPending {
|
||||
weixinmsg.NotifyWaybillStatus(bill, order)
|
||||
}
|
||||
} else if !s.isBillCandidate(order, bill) && bill.WaybillVendorID != order.VendorID {
|
||||
// 发生这种情况的原因就是两个接单事件几乎同时到达(来不及取消),也算正常
|
||||
s.CancelWaybill(bill)
|
||||
@@ -364,6 +371,9 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
|
||||
s.updateOrderByBill(order, bill, false)
|
||||
}
|
||||
}
|
||||
if !isPending {
|
||||
weixinmsg.NotifyWaybillStatus(bill, order)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user