获取营业数据测试
This commit is contained in:
@@ -647,6 +647,10 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
|
|||||||
orderMap = make(map[string]*model.GoodsOrder)
|
orderMap = make(map[string]*model.GoodsOrder)
|
||||||
orderSkuMap = make(map[string]*dao.OrderSkuWithActualPayPrice)
|
orderSkuMap = make(map[string]*dao.OrderSkuWithActualPayPrice)
|
||||||
saleInfoMap = make(map[int64]*dao.StoresOrderSaleInfo)
|
saleInfoMap = make(map[int64]*dao.StoresOrderSaleInfo)
|
||||||
|
var flagVendorOrderID string
|
||||||
|
if len(skuList) > 0 {
|
||||||
|
flagVendorOrderID = skuList[0].VendorOrderID
|
||||||
|
}
|
||||||
for _, v := range skuList {
|
for _, v := range skuList {
|
||||||
if v.EarningPrice == 0 {
|
if v.EarningPrice == 0 {
|
||||||
v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, v.PayPercentage)
|
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.VendorPrice += v.VendorPrice * int64(v.Count)
|
||||||
saleInfo.SalePrice += v.SalePrice * int64(v.Count)
|
saleInfo.SalePrice += v.SalePrice * int64(v.Count)
|
||||||
// saleInfo.EarningPrice += v.EarningPrice * int64(v.Count)
|
// saleInfo.EarningPrice += v.EarningPrice * int64(v.Count)
|
||||||
globals.SugarLogger.Debugf("GetStoresOrderSaleInfoNew", utils.Format4Output(v, false))
|
if v.VendorOrderID == flagVendorOrderID {
|
||||||
saleInfo.EarningPrice = v.NewEarningPrice
|
if len(skuList) == 1 {
|
||||||
|
saleInfo.EarningPrice = v.NewEarningPrice
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
flagVendorOrderID = v.VendorOrderID
|
||||||
|
saleInfo.EarningPrice += v.NewEarningPrice
|
||||||
|
}
|
||||||
|
|
||||||
universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID)
|
universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID)
|
||||||
if orderMap[universalOrderID] == nil {
|
if orderMap[universalOrderID] == nil {
|
||||||
@@ -723,6 +733,7 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
|
|||||||
order.VendorPrice += orderSku.VendorPrice * int64(v.Count)
|
order.VendorPrice += orderSku.VendorPrice * int64(v.Count)
|
||||||
order.SalePrice += orderSku.SalePrice * int64(v.Count)
|
order.SalePrice += orderSku.SalePrice * int64(v.Count)
|
||||||
order.EarningPrice += orderSku.EarningPrice * int64(v.Count)
|
order.EarningPrice += orderSku.EarningPrice * int64(v.Count)
|
||||||
|
globals.SugarLogger.Debugf("GetStoresOrderSaleInfoNew", utils.Format4Output(order, false))
|
||||||
} else {
|
} else {
|
||||||
// globals.SugarLogger.Debug(utils.Format4Output(v, true))
|
// globals.SugarLogger.Debug(utils.Format4Output(v, true))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user