Browse Source

Merge branch 'master' of http://code.qiyue666.com/pengcong001/SiNan

GOIAggregation
shanji 2 years ago
parent
commit
fe89a8495f
  1. 4
      SiNan.Business/AggregationBusiness.cs
  2. 19
      SiNan.Business/GOIBusiness.cs

4
SiNan.Business/AggregationBusiness.cs

@ -810,8 +810,6 @@ namespace SiNan.Business
var adSkuGoi_AggregationDate_PopularizeLevel = aggregationDate_PopularizeLevelList.FirstOrDefault(x => x.Sku == adSku.Sku && x.BusinessType == adSku.BusinessType); var adSkuGoi_AggregationDate_PopularizeLevel = aggregationDate_PopularizeLevelList.FirstOrDefault(x => x.Sku == adSku.Sku && x.BusinessType == adSku.BusinessType);
var adSkuGoi_AggregationDate_ProductLevel = aggregationDate_ProductLevelList.FirstOrDefault(x => x.Sku == adSku.Sku && x.BusinessType == adSku.BusinessType); var adSkuGoi_AggregationDate_ProductLevel = aggregationDate_ProductLevelList.FirstOrDefault(x => x.Sku == adSku.Sku && x.BusinessType == adSku.BusinessType);
if (adSkuGoi_AggregationDate_PopularizeLevel != null || adSkuGoi_AggregationDate_ProductLevel != null)
{
var adSkuDailyAggregation = new AggregationJDPopularizeAdSkuDaily() var adSkuDailyAggregation = new AggregationJDPopularizeAdSkuDaily()
{ {
Id = idGenerator.NewLong(), Id = idGenerator.NewLong(),
@ -830,7 +828,7 @@ namespace SiNan.Business
AdId = adSku.AdId AdId = adSku.AdId
}; };
insertAggregationAdSkuDailyList.Add(adSkuDailyAggregation); insertAggregationAdSkuDailyList.Add(adSkuDailyAggregation);
}
#endregion #endregion
} }

19
SiNan.Business/GOIBusiness.cs

@ -228,27 +228,28 @@ namespace SiNan.Business
foreach (var skuId in skuIdList) foreach (var skuId in skuIdList)
{ {
{ {
var cost = costs.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 2)?.Cost ?? 0M; var kuaicheCost = costs.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 2);
var profit = profits.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 2)?.Profit ?? 0M; var kuaicheProfit = profits.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 2);
if (kuaicheCost != null || kuaicheProfit != null)
if (cost != 0 || profit != 0)
{ {
var cost = kuaicheCost?.Cost ?? 0M;
var profit = kuaicheProfit?.Profit ?? 0M;
var adskuGoi = new GOIByAdSku() { Sku = skuId, Cost = cost, Profit = profit, BusinessType = 2 }; var adskuGoi = new GOIByAdSku() { Sku = skuId, Cost = cost, Profit = profit, BusinessType = 2 };
list.Add(adskuGoi); list.Add(adskuGoi);
} }
} }
{ {
var cost = costs.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 134217728)?.Cost ?? 0M; var zntfCost = costs.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 134217728);
var profit = profits.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 134217728)?.Profit ?? 0M; var zntfProfit = profits.FirstOrDefault(x => x.Sku == skuId && x.BusinessType == 134217728);
if (cost != 0 || profit != 0) if (zntfCost != null || zntfProfit != null)
{ {
var cost = zntfCost?.Cost ?? 0M;
var profit = zntfProfit?.Profit ?? 0M;
var adskuGoi = new GOIByAdSku() { Sku = skuId, Cost = cost, Profit = profit, BusinessType = 134217728 }; var adskuGoi = new GOIByAdSku() { Sku = skuId, Cost = cost, Profit = profit, BusinessType = 134217728 };
list.Add(adskuGoi); list.Add(adskuGoi);
} }
} }
} }
return list; return list;
} }

Loading…
Cancel
Save