Browse Source

pjzs sku上架逻辑更新,获取第一个attrValueList不为空的销售属性

AddValidOverTime
shanji 2 years ago
parent
commit
19c831887f
  1. 4
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs

4
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -967,11 +967,11 @@ namespace BBWY.Server.Business
var response = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
if (response.Json == null)
response.Json = JObject.Parse(response.Body);
var colorProperty = response.Json["jingdong_category_read_findAttrsByCategoryIdUnlimitCate_responce"]["findattrsbycategoryidunlimitcate_result"].FirstOrDefault(j => j.Value<string>("name") == "颜色");
var colorProperty = response.Json["jingdong_category_read_findAttrsByCategoryIdUnlimitCate_responce"]["findattrsbycategoryidunlimitcate_result"].FirstOrDefault(j => j["attrValueList"] != null && j["attrValueList"].Count() > 0);
if (colorProperty == null)
{
RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, giftSkuIdList, request.MainProductSpu, request.FullTitle, brandName, haveGiftTemplateSku);
throw new BusinessException("获取销售属性-缺少颜色属性");
throw new BusinessException("缺少销售属性");
}
colorSaleAttrs = colorProperty["attrValueList"].ToList();
}

Loading…
Cancel
Save