UpdateOrderWaybillTip

This commit is contained in:
gazebo
2019-12-26 14:18:16 +08:00
parent 9559fc6420
commit deadc8f563
10 changed files with 151 additions and 1 deletions

View File

@@ -163,6 +163,19 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
isDuplicated, order, err := c.addOrderStatus(orderStatus, db)
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 !isDuplicated {
if order != nil {
order.Skus = c.loadOrderSku(db, order.VendorOrderID, order.VendorID)