From 4060fc3914b855cb4811fb9bf65c042bc6b5ebad Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Tue, 5 Sep 2023 13:32:29 +0800 Subject: [PATCH 1/2] debug pjzs --- .../EvaluationAssistantBusiness.cs | 18 +++++++++++------- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 6 +++++- .../PromotionTask/StartPromotionTaskRequest.cs | 2 ++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index 2b87cf28..01c1a1bf 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -513,14 +513,18 @@ namespace BBWY.Server.Business } - if (!string.IsNullOrEmpty(dbPromotionTask.CustomMotherSku)) - CheckRepeatSkuInRuningTask(runingTaskList, dbPromotionTask.CustomMotherSku); + if (request.IsDebug == null || request.IsDebug == false) + { + if (!string.IsNullOrEmpty(dbPromotionTask.CustomMotherSku)) + CheckRepeatSkuInRuningTask(runingTaskList, dbPromotionTask.CustomMotherSku); - if (!string.IsNullOrEmpty(motherTemplateSku)) - CheckRepeatSkuInRuningTask(runingTaskList, motherTemplateSku); + if (!string.IsNullOrEmpty(motherTemplateSku)) + CheckRepeatSkuInRuningTask(runingTaskList, motherTemplateSku); + + if (!string.IsNullOrEmpty(dbPromotionTask.MainProductSku)) + CheckRepeatSkuInRuningTask(runingTaskList, dbPromotionTask.MainProductSku); + } - if (!string.IsNullOrEmpty(dbPromotionTask.MainProductSku)) - CheckRepeatSkuInRuningTask(runingTaskList, dbPromotionTask.MainProductSku); var host = GetPlatformRelayAPIHost(Enums.Platform.京东); @@ -761,7 +765,7 @@ namespace BBWY.Server.Business }); } - + /// /// 停止任务 diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 73a69859..9dce7891 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -1055,6 +1055,10 @@ namespace BBWY.Server.Business var req = new SkuWriteUpdateSkusRequest(); req.wareId = wareId; req.skus = skusParamList; + + //输出日志 + nLogManager.Default().Info($"上架赠品请求参数,任务Id{request.Id},{JsonConvert.SerializeObject(req)}"); + var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); if (res.Json == null) @@ -1521,7 +1525,7 @@ namespace BBWY.Server.Business errormsg = $"{errormsg}\r\n请联系京东物流负责人,开通对应事业部ISV的授权操作"; throw new BusinessException(errormsg); } - + return res.Json["jingdong_eclp_po_queryPoOrder_responce"]["queryPoModelList"].Children().Select(x => new JDInStoreOrderDetail() { deptNo = x.Value("deptNo"), diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs index 9a8a3b5b..0eac4de1 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs @@ -8,6 +8,8 @@ namespace BBWY.Server.Model.Dto public class StartPromotionTaskRequest : PlatformRequest { public long Id { get; set; } + + public bool? IsDebug { get; set; } } public class StartPromotionTaskRequest2 : PlatformRequest From 19c831887f8486eecf3dc080b4aeef71d77a7511 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Tue, 5 Sep 2023 16:01:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?pjzs=20sku=E4=B8=8A=E6=9E=B6=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=9B=B4=E6=96=B0=EF=BC=8C=E8=8E=B7=E5=8F=96=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AAattrValueList=E4=B8=8D=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=94=80=E5=94=AE=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 9dce7891..0f42c6d3 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/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("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(); }