调整加订单配送小费逻辑,添加美团外卖平台支持

This commit is contained in:
gazebo
2019-12-26 16:19:04 +08:00
parent f13a8bbea2
commit 381d1b2f21
10 changed files with 108 additions and 88 deletions

View File

@@ -164,15 +164,13 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
if err == nil {
dao.Commit(db)
if orderStatus.Status == model.OrderStatusWaybillTipChanged {
if handler := partner.GetWaybillTipUpdater(orderStatus.RefVendorID); handler != nil {
tipFee, err2 := handler.GetWaybillTip(jxcontext.AdminCtx, vendorOrgCode, orderStatus.RefVendorOrderID, orderStatus.VendorOrderID, "")
if err2 == nil {
c.UpdateOrderFields(&model.GoodsOrder{
VendorOrderID: orderStatus.RefVendorOrderID,
VendorID: orderStatus.RefVendorID,
VendorOrgCode: vendorOrgCode,
WaybillTipMoney: tipFee,
}, []string{"WaybillTipMoney"})
if order, err2 := c.LoadOrder(orderStatus.VendorOrderID, orderStatus.VendorID); err2 == nil {
if handler := partner.GetWaybillTipUpdater(orderStatus.RefVendorID); handler != nil {
tipFee, err2 := handler.GetWaybillTip(jxcontext.AdminCtx, vendorOrgCode, order.VendorStoreID, orderStatus.RefVendorOrderID, orderStatus.VendorOrderID, "")
if err2 == nil {
order.WaybillTipMoney = tipFee
c.UpdateOrderFields(order, []string{"WaybillTipMoney"})
}
}
}
}