From 54ffb6d377fab7e92ae5e68d7f95ec8d6d428dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 20 Mar 2020 09:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=90=A5=E4=B8=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman_ext.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index c2c6048db..85e2ec9f1 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -647,6 +647,10 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID orderMap = make(map[string]*model.GoodsOrder) orderSkuMap = make(map[string]*dao.OrderSkuWithActualPayPrice) saleInfoMap = make(map[int64]*dao.StoresOrderSaleInfo) + var flagVendorOrderID string + if len(skuList) > 0 { + flagVendorOrderID = skuList[0].VendorOrderID + } for _, v := range skuList { if v.EarningPrice == 0 { v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, v.PayPercentage) @@ -670,8 +674,14 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID saleInfo.VendorPrice += v.VendorPrice * int64(v.Count) saleInfo.SalePrice += v.SalePrice * int64(v.Count) // saleInfo.EarningPrice += v.EarningPrice * int64(v.Count) - globals.SugarLogger.Debugf("GetStoresOrderSaleInfoNew", utils.Format4Output(v, false)) - saleInfo.EarningPrice = v.NewEarningPrice + if v.VendorOrderID == flagVendorOrderID { + if len(skuList) == 1 { + saleInfo.EarningPrice = v.NewEarningPrice + } + } else { + flagVendorOrderID = v.VendorOrderID + saleInfo.EarningPrice += v.NewEarningPrice + } universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID) if orderMap[universalOrderID] == nil { @@ -723,6 +733,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID order.VendorPrice += orderSku.VendorPrice * int64(v.Count) order.SalePrice += orderSku.SalePrice * int64(v.Count) order.EarningPrice += orderSku.EarningPrice * int64(v.Count) + globals.SugarLogger.Debugf("GetStoresOrderSaleInfoNew", utils.Format4Output(order, false)) } else { // globals.SugarLogger.Debug(utils.Format4Output(v, true)) }