- send weixin msg more accurately.

This commit is contained in:
gazebo
2018-08-11 16:37:16 +08:00
parent 75a0f77c6f
commit f5f3805470
4 changed files with 20 additions and 11 deletions

View File

@@ -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)
}
}
}
}