|
|
@ -739,8 +739,9 @@ namespace BBWY.Server.Business |
|
|
|
/// <param name="promotionId"></param>
|
|
|
|
/// <param name="skuList"></param>
|
|
|
|
/// <param name="isGift"></param>
|
|
|
|
/// <param name="taskCount"></param>
|
|
|
|
/// <exception cref="BusinessException"></exception>
|
|
|
|
private void AddJDPromotionSku(IJdClient jdClient, string token, long promotionId, IList<ProductSkuResponse> skuList, bool isGift) |
|
|
|
private void AddJDPromotionSku(IJdClient jdClient, string token, long promotionId, IList<ProductSkuResponse> skuList, bool isGift, int taskCount) |
|
|
|
{ |
|
|
|
var req = new SellerPromotionSkuAddRequest(); |
|
|
|
req.promoId = promotionId; |
|
|
@ -763,7 +764,7 @@ namespace BBWY.Server.Business |
|
|
|
req.skuIds = $"{req.skuIds}{sku.Id},"; |
|
|
|
req.jdPrices = $"{req.jdPrices}{sku.Price},"; |
|
|
|
req.bindType = $"{req.bindType}{(isGift ? 2 : 1)},"; |
|
|
|
req.num = $"{req.num}{(isGift ? 1 : 100)},"; |
|
|
|
req.num = $"{req.num}{(isGift ? 1 : taskCount)},"; |
|
|
|
req.promoPrices = $"{req.promoPrices}{(isGift ? 0 : sku.Price)},"; |
|
|
|
} |
|
|
|
|
|
|
@ -1020,7 +1021,10 @@ namespace BBWY.Server.Business |
|
|
|
{ |
|
|
|
RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, null, request.MainProductSpu, request.FullTitle, brandName, false); |
|
|
|
|
|
|
|
throw new BusinessException($"上架sku失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); |
|
|
|
if (res.Body.Contains("en_desc")) |
|
|
|
throw new BusinessException($"上架sku失败-{res.Json["error_response"].Value<string>("en_desc")}"); |
|
|
|
else |
|
|
|
throw new BusinessException($"上架sku失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); |
|
|
|
|
|
|
|
/*{"error_response":{"code":"501","en_desc":"com.jd.bk.saf.exception.SafJosException:京东价超出该类目允许范围:12.15-39437元!#821c1c3b382f476abeb21f1f515274c7(Solution reference: https://jos.jd.com/commondoc?listId=171)","zh_desc":"调用参数错误(解决方案参考: https://jos.jd.com/commondoc?listId=171)"}}*/ |
|
|
|
} |
|
|
@ -1131,25 +1135,25 @@ namespace BBWY.Server.Business |
|
|
|
if (motherTemplateSkuList != null && motherTemplateSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
stepText = "添加奶妈模板SKU"; |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, motherTemplateSkuList, false); |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, motherTemplateSkuList, false, request.TaskCount); |
|
|
|
} |
|
|
|
|
|
|
|
if (customerMotherSkuList != null && customerMotherSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
stepText = "添加自定义奶妈SKU"; |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, customerMotherSkuList, false); |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, customerMotherSkuList, false, request.TaskCount); |
|
|
|
} |
|
|
|
|
|
|
|
if (mainProductSkuList != null && mainProductSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
stepText = "添加主商品SKU"; |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, mainProductSkuList, false); |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, mainProductSkuList, false, request.TaskCount); |
|
|
|
} |
|
|
|
|
|
|
|
if (giftSkuList != null && giftSkuList.Count() > 0) |
|
|
|
{ |
|
|
|
stepText = "添加赠品SKU"; |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, giftSkuList, true); |
|
|
|
AddJDPromotionSku(jdClient, request.AppToken, promotionId, giftSkuList, true, request.TaskCount); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|