- send different wx msg when mt changed courier

This commit is contained in:
gazebo
2018-12-17 11:53:12 +08:00
parent 215cdd9533
commit cae7c6d372
2 changed files with 12 additions and 5 deletions

View File

@@ -359,6 +359,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
case model.WaybillStatusAccepted:
s.resetTimer(savedOrderInfo, bill, isPending)
if !isPending {
isBillAlreadyCandidate := s.isBillCandidate(order, bill)
// todo 购买平台的运单优先级最高但这样写也可能带来问题即在这个时间因为之前3方已经接单已经发出了转自送请求而且可能成功了所以加个状态判断
if order.WaybillVendorID == model.VendorIDUnknown ||
(order.VendorID == bill.WaybillVendorID && order.VendorID != order.WaybillVendorID && (order.DeliveryFlag&model.OrderDeliveryFlagMaskPurcahseDisabled) == 0) {
@@ -381,7 +382,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
globals.SugarLogger.Infof("OnWaybillStatusChanged Accepted orderID:%s got multiple bill:%v", order.VendorOrderID, bill)
}
if s.isBillCandidate(order, bill) && order.WaybillVendorID != order.VendorID {
weixinmsg.NotifyWaybillStatus(bill, order)
weixinmsg.NotifyWaybillStatus(bill, order, isBillAlreadyCandidate)
}
}
case model.WaybillStatusAcceptCanceled:
@@ -461,7 +462,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
}
}
if !isPending {
weixinmsg.NotifyWaybillStatus(bill, order)
weixinmsg.NotifyWaybillStatus(bill, order, false)
}
case model.WaybillStatusNeverSend: // 平台不配送,直接创建三方运单
s.resetTimer(savedOrderInfo, bill, isPending)