|
|
@ -1110,6 +1110,33 @@ namespace BBWY.Server.Business |
|
|
|
|
|
|
|
stepText = "获取上架skuId"; |
|
|
|
var newSkuIdList = res.Json["jingdong_sku_write_updateSkus_responce"]["skuList"].ToList().Select(x => x.Value<string>("skuId")).ToList(); |
|
|
|
|
|
|
|
#region 处理上架之后没有skuId的情况
|
|
|
|
if (newSkuIdList.Any(s => string.IsNullOrEmpty(s))) |
|
|
|
{ |
|
|
|
newSkuIdList.Clear(); |
|
|
|
Thread.Sleep(30 * 1000); |
|
|
|
var _mainProductSkuList = GetProductSkuList(new SearchProductSkuRequest() |
|
|
|
{ |
|
|
|
AppKey = request.AppKey, |
|
|
|
AppSecret = request.AppSecret, |
|
|
|
AppToken = request.AppToken, |
|
|
|
Platform = Enums.Platform.京东, |
|
|
|
Spu = request.MainProductSpu |
|
|
|
}); |
|
|
|
foreach (var ps in _mainProductSkuList) |
|
|
|
{ |
|
|
|
if (request.GiftTemplateSkuList.Any(x => x.Title == ps.Title)) |
|
|
|
{ |
|
|
|
//此sku是赠品sku
|
|
|
|
newSkuIdList.Add(ps.Id); |
|
|
|
} |
|
|
|
} |
|
|
|
if (newSkuIdList.Count() == 0) |
|
|
|
throw new BusinessException("未能从sku列表接口正常获取新上架sku"); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
giftSkuIdList.AddRange(newSkuIdList); |
|
|
|
|
|
|
|
stepText = "获取上架sku"; |
|
|
|