diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 6753e8a9..8970cd32 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; -using System.Threading.Tasks; namespace BBWY.Server.Business { @@ -905,29 +904,6 @@ namespace BBWY.Server.Business if (haveGiftTemplateSku) { #region 上架赠品 - //string barCode = string.Empty, categoryId = string.Empty; - //IList multiCateProps = null; - - //#region 获取主商品sku信息 barCode,categoryId,multiCateProps - //{ - // stepText = "获取主商品sku信息"; - // var mainSkuList = GetProductSkuList(new SearchProductSkuRequest() - // { - // AppKey = request.AppKey, - // AppSecret = request.AppSecret, - // AppToken = request.AppToken, - // IsContainSource = true, - // Platform = request.Platform, - // Spu = request.MainProductSpu - // }); - // if (mainSkuList.Count() == 0) - // throw new BusinessException($"获取主商品sku信息-未查询到sku信息"); - - // barCode = mainSkuList[0].Source.Value("barCode"); - // categoryId = mainSkuList[0].Source.Value("categoryId"); - // multiCateProps = mainSkuList[0].Source["multiCateProps"] != null ? mainSkuList[0].Source["multiCateProps"].ToList() : null; - //} - //#endregion #region 获取销售属性 stepText = "获取销售属性"; @@ -942,7 +918,10 @@ namespace BBWY.Server.Business response.Json = JObject.Parse(response.Body); var colorProperty = response.Json["jingdong_category_read_findAttrsByCategoryIdUnlimitCate_responce"]["findattrsbycategoryidunlimitcate_result"].FirstOrDefault(j => j.Value("name") == "颜色"); if (colorProperty == null) + { + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, giftSkuIdList, request.MainProductSpu, request.FullTitle, brandName, haveGiftTemplateSku); throw new BusinessException("获取销售属性-缺少颜色属性"); + } colorSaleAttrs = colorProperty["attrValueList"].ToList(); } #endregion