|
|
@ -138,7 +138,10 @@ namespace BBWY.Server.Business |
|
|
|
var pageSize = 20; |
|
|
|
var totalPageSize = 1; |
|
|
|
if (!string.IsNullOrEmpty(searchProductSkuRequest.Spu)) |
|
|
|
{ |
|
|
|
totalPageSize = 1; |
|
|
|
searchProductSkuRequest.IsCheckSkuCount = false; |
|
|
|
} |
|
|
|
else if (!string.IsNullOrEmpty(searchProductSkuRequest.Sku)) |
|
|
|
{ |
|
|
|
skuIdList = searchProductSkuRequest.Sku.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); |
|
|
@ -182,7 +185,8 @@ namespace BBWY.Server.Business |
|
|
|
{ |
|
|
|
var targetSkuIdList = skuList.Select(s => s.Id); |
|
|
|
var exceptSkuIdList = skuIdList.Except(targetSkuIdList); |
|
|
|
throw new BusinessException($"{searchProductSkuRequest.CheckStep}-sku条件数量和查询结果数量不一致\r\n{string.Join(",", exceptSkuIdList)}"); |
|
|
|
// throw new BusinessException($"{searchProductSkuRequest.CheckStep}-sku条件数量和查询结果数量不一致\r\n{string.Join(",", exceptSkuIdList)}");
|
|
|
|
throw new BusinessException($"{JsonConvert.SerializeObject(skuIdList)} 以上SKU可能已下架,请修改任务将该SKU移除奶妈列表"); |
|
|
|
} |
|
|
|
return skuList; |
|
|
|
|
|
|
@ -852,6 +856,15 @@ namespace BBWY.Server.Business |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private string SkuShangJiaFanYi(string errorMsg) |
|
|
|
{ |
|
|
|
if (errorMsg.Contains("销售属性值组合重复") && errorMsg.Contains("业务要求唯一性")) |
|
|
|
errorMsg = "该任务已上架赠品,请手动下架赠品,系统10分钟后将自动重新启动该任务"; |
|
|
|
if (errorMsg.Contains("属性[产品尺寸]扩展值数量与值数量不一致")) |
|
|
|
errorMsg = "上架赠品失败,评价助手暂无法上架带有[产品尺寸]的商品,请手动上架赠品后在评价助手创建已上架赠品模式"; |
|
|
|
return errorMsg; |
|
|
|
} |
|
|
|
|
|
|
|
public override StartPromotionTaskResponse StartJDPromotionTask(StartPromotionTaskRequest2 request) |
|
|
|
{ |
|
|
|
var stepText = string.Empty; |
|
|
@ -1137,12 +1150,14 @@ namespace BBWY.Server.Business |
|
|
|
errorMsg = res.Body.Contains("en_desc") ? |
|
|
|
res.Json["error_response"].Value<string>("en_desc") : |
|
|
|
(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg); |
|
|
|
errorMsg = SkuShangJiaFanYi(errorMsg); |
|
|
|
RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, null, request.MainProductSpu, request.FullTitle, brandName, false); |
|
|
|
throw new BusinessException($"上架sku失败-{errorMsg}"); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
errorMsg = SkuShangJiaFanYi(errorMsg); |
|
|
|
RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, null, request.MainProductSpu, request.FullTitle, brandName, false); |
|
|
|
throw new BusinessException($"上架sku失败-{errorMsg}"); |
|
|
|
} |
|
|
@ -1424,6 +1439,9 @@ namespace BBWY.Server.Business |
|
|
|
ddMsg.AppendLine($"任务奶妈数:{request.JoinSkuCount}"); |
|
|
|
ddMsg.AppendLine($"参与奶妈数:{lastQueryJoinCount}"); |
|
|
|
ddMsg.AppendLine("参与任务的奶妈数异常请检查"); |
|
|
|
//ddMsg.AppendLine("以上SKU可能已下架或同时参与多个赠品促销活动");
|
|
|
|
//ddMsg.AppendLine("1.如已下架请将对应的SKU移除奶妈列表");
|
|
|
|
//ddMsg.AppendLine("2.系统会自动剔除同时参与多个赠品促销的SKU,请检查以上SKU是否在失效的促销活动,请及时删除,已暂停或已停止的促销活动");
|
|
|
|
} |
|
|
|
if (!string.IsNullOrEmpty(request.PJZSDingDingKey) && !string.IsNullOrEmpty(request.PJZSDingDingWebHook)) |
|
|
|
dingDingBusiness.SendDingDingBotMessage(request.PJZSDingDingKey, request.PJZSDingDingWebHook, ddMsg.ToString()); |
|
|
@ -1762,7 +1780,7 @@ namespace BBWY.Server.Business |
|
|
|
public override JToken GetProductById(GetProductByIdRequest request) |
|
|
|
{ |
|
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
|
var req = new WareReadFindWareByIdRequest() { wareId = request.SpuId}; |
|
|
|
var req = new WareReadFindWareByIdRequest() { wareId = request.SpuId }; |
|
|
|
|
|
|
|
if (request.Field != null) |
|
|
|
req.field = request.Field; |
|
|
@ -1777,9 +1795,9 @@ namespace BBWY.Server.Business |
|
|
|
public override JToken GetAttrsByCategoryId(GetAttrsByCategoryIdRequest request) |
|
|
|
{ |
|
|
|
var jdClient = GetJdClient(request.AppKey, request.AppSecret); |
|
|
|
var req = new CategoryReadFindAttrsByCategoryIdUnlimitCateRequest() { cid=request.CatId}; |
|
|
|
var req = new CategoryReadFindAttrsByCategoryIdUnlimitCateRequest() { cid = request.CatId }; |
|
|
|
|
|
|
|
if(request.AttributeType!=null) |
|
|
|
if (request.AttributeType != null) |
|
|
|
req.attributeType = request.AttributeType; |
|
|
|
if (request.Field != null) |
|
|
|
req.field = request.Field; |
|
|
|