|
|
@ -798,6 +798,7 @@ namespace SiNan.Business |
|
|
|
|
|
|
|
List<AggregationJDPopularizeAdSkuDaily> insertAggregationAdSkuDailyList = new List<AggregationJDPopularizeAdSkuDaily>(); |
|
|
|
var aggregationDate_PopularizeLevelList = goiBusiness.CalculationAdSkuLevelGOI(adSkuIdList, startDate_aggregationDate, endDate_aggregationDate); |
|
|
|
var aggregationDate_ProductLevelList = goiBusiness.CalculationAdSkuProductLevelGOI(adSkuIdList, startDate_aggregationDate, endDate_aggregationDate); |
|
|
|
|
|
|
|
var adSkuIndex = 0; |
|
|
|
foreach (var adSku in adSkuList) |
|
|
@ -805,10 +806,11 @@ namespace SiNan.Business |
|
|
|
adSkuIndex++; |
|
|
|
Console.WriteLine($"{DateTime.Now} {shopName} SKU聚合 {adSkuIndex}/{adSkuIdList.Count()}"); |
|
|
|
|
|
|
|
#region 处理计划每日聚合
|
|
|
|
#region 处理SKU每日聚合
|
|
|
|
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); |
|
|
|
|
|
|
|
if (adSkuGoi_AggregationDate_PopularizeLevel != null) |
|
|
|
if (adSkuGoi_AggregationDate_PopularizeLevel != null || adSkuGoi_AggregationDate_ProductLevel != null) |
|
|
|
{ |
|
|
|
var adSkuDailyAggregation = new AggregationJDPopularizeAdSkuDaily() |
|
|
|
{ |
|
|
@ -819,6 +821,8 @@ namespace SiNan.Business |
|
|
|
Cost = adSkuGoi_AggregationDate_PopularizeLevel?.Cost ?? 0M, |
|
|
|
PopularizeLevelProfit = adSkuGoi_AggregationDate_PopularizeLevel?.Profit ?? 0M, |
|
|
|
PopularizeLevelGOI = adSkuGoi_AggregationDate_PopularizeLevel?.GOI ?? 0M, |
|
|
|
ProductLevelProfit = adSkuGoi_AggregationDate_ProductLevel?.Profit ?? 0M, |
|
|
|
ProductLevelGOI = adSkuGoi_AggregationDate_ProductLevel?.GOI ?? 0M, |
|
|
|
AdGroupId = adSku.AdGroupId, |
|
|
|
CampaignId = adSku.CampaignId, |
|
|
|
BusinessType = adSku.BusinessType, |
|
|
@ -834,7 +838,6 @@ namespace SiNan.Business |
|
|
|
{ |
|
|
|
fsql.Delete<AggregationJDPopularizeAdSkuDaily>().Where(s => s.Date == aggregationDate && adSkuIdList.Contains(s.SkuId)).ExecuteAffrows(); |
|
|
|
fsql.Insert(insertAggregationAdSkuDailyList).ExecuteAffrows(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|