京东刷新结算价

This commit is contained in:
苏尹岚
2020-09-29 09:27:59 +08:00
parent 2540aa7b5c
commit 5474654012
3 changed files with 58 additions and 11 deletions

View File

@@ -1299,15 +1299,18 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord
}
for _, v := range results.BillList.Result {
if v.DueAmount != 0 {
order := &model.GoodsOrder{}
order.VendorOrderID = utils.Int64ToStr(v.OrderID)
dao.GetEntity(db, order, "VendorOrderID")
storeDeatil, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
if order.NewEarningPrice == 0 {
jxutils.RefreshOrderEarningPrice2(order, storeDeatil.PayPercentage)
order, _ := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(v.OrderID), model.VendorIDJD)
stores, _ := dao.GetStoreList(db, []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "")
if len(stores) > 0 {
store := stores[0]
if order.NewEarningPrice == 0 {
jxutils.RefreshOrderEarningPrice2(order, store.PayPercentage)
}
if order.TotalShopMoney == 0 {
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
}
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
}
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
}
}
return err