获取营业数据测试

This commit is contained in:
苏尹岚
2020-03-20 09:18:23 +08:00
parent 7a6ee4e396
commit 54ffb6d377

View File

@@ -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))
}