diff --git a/BBWY.Server.Business/Sync/JD/JDPopularizeReportFormAdLevelSyncBusiness.cs b/BBWY.Server.Business/Sync/JD/JDPopularizeReportFormAdLevelSyncBusiness.cs index addcb537..c143f561 100644 --- a/BBWY.Server.Business/Sync/JD/JDPopularizeReportFormAdLevelSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/JD/JDPopularizeReportFormAdLevelSyncBusiness.cs @@ -117,7 +117,7 @@ namespace BBWY.Server.Business.Sync if (!presponse.Success) throw new Exception($"获取JD推广报表-创意维度失败 {presponse.Msg}"); - SyncShopPopularizeReportFormAdLevel(long.Parse(shop.ShopId), presponse.Data); + SyncShopPopularizeReportFormAdLevel(shop.ShopName, long.Parse(shop.ShopId), presponse.Data); currentCount = presponse.Data?.Count() ?? 0; } catch (Exception ex) @@ -127,7 +127,7 @@ namespace BBWY.Server.Business.Sync } } - private void SyncShopPopularizeReportFormAdLevel(long shopId, JArray jArray) + private void SyncShopPopularizeReportFormAdLevel(string shopName, long shopId, JArray jArray) { if (jArray == null || !jArray.HasValues) return; @@ -135,6 +135,7 @@ namespace BBWY.Server.Business.Sync foreach (var j in jArray) { var adName = j.Value("adName"); + var adId = j.Value("adId"); var skuMatch = Regex.Match(adName, @"^(.*-)?(\d+)-(.*)$"); string sku; @@ -144,12 +145,18 @@ namespace BBWY.Server.Business.Sync { skuMatch = Regex.Match(adName, @"^(.*)-(\d+)$"); if (!skuMatch.Success) + { + nLogManager.GetLogger($"创意维度-{shopName}").Info($"创意名称识别失败 adId {adId} adName {adName} 名称格式错误"); continue; + } sku = skuMatch.Groups[2].Value; } - if (sku == j.Value("adId")) + if (sku == adId) + { + nLogManager.GetLogger($"创意维度-{shopName}").Info($"创意名称识别失败 adId {adId} adName {adName} 提取的[sku]与创意Id相同"); continue; + } insertList.Add(new JDPopularizeAdSku() { @@ -159,7 +166,7 @@ namespace BBWY.Server.Business.Sync CreateTime = DateTime.Now, CampaignId = j.Value("campaignId"), AdGroupId = j.Value("adGroupId"), - AdId = j.Value("adId"), + AdId = long.Parse(adId), AdName = adName, Date = DateTime.ParseExact(j.Value("date"), "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture), Cost = j["retrievalType0"].Value("cost"),