京东订单计算newearningprice2

This commit is contained in:
苏尹岚
2020-05-25 14:39:15 +08:00
parent 4a5b0bbae2
commit f3e1f4e83b

View File

@@ -6,6 +6,8 @@ import (
"strings"
"time"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/baseapi/platformapi/autonavi"
@@ -71,7 +73,7 @@ func (c *PurchaseHandler) updateOrderFinancialInfo(a *jdapi.API, orderID string)
if err == nil {
if orderSettlement != nil {
updateOrderBySettleMent(order, orderSettlement)
err = partner.CurOrderManager.UpdateOrderFields(order, []string{ /*"WaybillTipMoney", */ "TotalShopMoney", "PmSubsidyMoney"})
err = partner.CurOrderManager.UpdateOrderFields(order, []string{ /*"WaybillTipMoney", */ "TotalShopMoney", "PmSubsidyMoney", "NewEarningPrice"})
}
}
return err
@@ -135,6 +137,10 @@ func updateOrderBySettleMent(order *model.GoodsOrder, orderSettlement *jdapi.Ord
// order.WaybillTipMoney = orderSettlement.VenderPaidTips
order.TotalShopMoney = orderSettlement.SettlementAmount
order.PmSubsidyMoney = orderSettlement.PlatOrderGoodsDiscountMoney + orderSettlement.PlatSkuGoodsDiscountMoney
stores, _ := dao.GetStoreList(dao.GetDB(), []int{order.StoreID}, nil, nil, nil, "")
if len(stores) > 0 {
jxutils.RefreshOrderEarningPrice2(order, stores[0].PayPercentage)
}
}
}