Browse Source

SKU推广维度聚合任务增加点击量指标聚合

GOIAggregation
shanji 1 year ago
parent
commit
2e83093d01
  1. 5
      SiNan.Business/AggregationBusiness.cs
  2. 13
      SiNan.Business/GOIBusiness.cs
  3. 2
      SiNan.Model/Core/GOI/GOIByAdSku.cs
  4. 3
      SiNan.Model/Db/Aggregation/AggregationJDPopularizeAdSkuDaily.cs

5
SiNan.Business/AggregationBusiness.cs

@ -764,7 +764,7 @@ namespace SiNan.Business
} }
#endregion #endregion
#region SKU创意/推广维度聚合任务 #region SKU维度聚合任务
public void StartAdSkuAggregationTask() public void StartAdSkuAggregationTask()
{ {
StartAdSkuAggregationTaskByCondition(new AdSkuAggregationRequest() StartAdSkuAggregationTaskByCondition(new AdSkuAggregationRequest()
@ -852,7 +852,8 @@ namespace SiNan.Business
BusinessType = adSku.BusinessType, BusinessType = adSku.BusinessType,
SkuId = adSku.Sku, SkuId = adSku.Sku,
AdId = adSku.AdId, AdId = adSku.AdId,
PopularizeAmount = adSkuPoplarizeAmount?.ActualAmount ?? 0M PopularizeAmount = adSkuPoplarizeAmount?.ActualAmount ?? 0M,
Clicks = adSkuGoi_AggregationDate_PopularizeLevel?.Clicks ?? 0
}; };
insertAggregationAdSkuDailyList.Add(adSkuDailyAggregation); insertAggregationAdSkuDailyList.Add(adSkuDailyAggregation);

13
SiNan.Business/GOIBusiness.cs

@ -205,8 +205,9 @@ namespace SiNan.Business
.ToList(g => new .ToList(g => new
{ {
Cost = g.Sum(g.Value.Cost), Cost = g.Sum(g.Value.Cost),
Sku = g.Key.Sku, Clicks = g.Sum(g.Value.Clicks),
BusinessType = g.Key.BusinessType g.Key.Sku,
g.Key.BusinessType
}); });
var profits = fsql.Select<JDOrderPopularizeRelation, OrderCostDetail, Order>() var profits = fsql.Select<JDOrderPopularizeRelation, OrderCostDetail, Order>()
@ -221,7 +222,7 @@ namespace SiNan.Business
{ {
Profit = g.Sum(g.Value.Item2.SkuGrossProfit), Profit = g.Sum(g.Value.Item2.SkuGrossProfit),
Sku = g.Key.PopularizeSku, Sku = g.Key.PopularizeSku,
BusinessType = g.Key.BusinessType g.Key.BusinessType
}); });
IList<GOIByAdSku> list = new List<GOIByAdSku>(); IList<GOIByAdSku> list = new List<GOIByAdSku>();
@ -233,8 +234,9 @@ namespace SiNan.Business
if (kuaicheCost != null || kuaicheProfit != null) if (kuaicheCost != null || kuaicheProfit != null)
{ {
var cost = kuaicheCost?.Cost ?? 0M; var cost = kuaicheCost?.Cost ?? 0M;
var clicks = kuaicheCost?.Clicks ?? 0;
var profit = kuaicheProfit?.Profit ?? 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, Clicks = Convert.ToInt32(clicks) };
list.Add(adskuGoi); list.Add(adskuGoi);
} }
} }
@ -245,8 +247,9 @@ namespace SiNan.Business
if (zntfCost != null || zntfProfit != null) if (zntfCost != null || zntfProfit != null)
{ {
var cost = zntfCost?.Cost ?? 0M; var cost = zntfCost?.Cost ?? 0M;
var clicks = zntfCost?.Clicks ?? 0;
var profit = zntfProfit?.Profit ?? 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, Clicks = Convert.ToInt32(clicks) };
list.Add(adskuGoi); list.Add(adskuGoi);
} }
} }

2
SiNan.Model/Core/GOI/GOIByAdSku.cs

@ -3,5 +3,7 @@
public class GOIByAdSku : GOIBySku public class GOIByAdSku : GOIBySku
{ {
public int BusinessType { get; set; } public int BusinessType { get; set; }
public int Clicks { get; set; }
} }
} }

3
SiNan.Model/Db/Aggregation/AggregationJDPopularizeAdSkuDaily.cs

@ -84,6 +84,9 @@ namespace SiNan.Model.Db
/// </summary> /// </summary>
[Column(DbType = "decimal(18,2)")] [Column(DbType = "decimal(18,2)")]
public decimal? PopularizeAmount { get; set; } = 0.00M; public decimal? PopularizeAmount { get; set; } = 0.00M;
[Column(DbType = "int")]
public int? Clicks { get; set; } = 0;
} }
} }

Loading…
Cancel
Save