From 44a03cc261ddf0b836dad7df76c66fee69d75c31 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Fri, 6 Jan 2023 14:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=B2=BE=E7=AE=80=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E9=9D=9E=E7=A9=BA=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EvaluationAssistantBusiness.cs | 4 ++-- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 2 +- BBWY.Test/JDProductAPITest.cs | 17 +++++++++++++++++ BBWY.Test/Program.cs | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index baed072b..242205ef 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -87,8 +87,8 @@ namespace BBWY.Server.Business if (request.GiftTemplateId == 0 && string.IsNullOrEmpty(request.MainProductGiftSku)) throw new BusinessException("赠品模板和主商品赠品SKU至少具备一个"); - if (string.IsNullOrEmpty(request.SimpleTitle) || string.IsNullOrEmpty(request.FullTitle)) - throw new BusinessException("缺少精简标题或完整标题"); + if (string.IsNullOrEmpty(request.FullTitle)) + throw new BusinessException("缺少完整标题"); if (string.IsNullOrEmpty(request.ActivityName)) throw new BusinessException("缺少活动名称"); diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 0584dc6e..b16e27bb 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -752,7 +752,7 @@ namespace BBWY.Server.Business var req = new WareWriteUpdateWareTitleRequest(); req.wareId = wareId; //req.title = request.SimpleTitle; - if (!request.SimpleTitle.StartsWith(brandName)) + if (string.IsNullOrEmpty(request.SimpleTitle) || !request.SimpleTitle.StartsWith(brandName)) req.title = $"{brandName}{request.SimpleTitle}"; else req.title = request.SimpleTitle; diff --git a/BBWY.Test/JDProductAPITest.cs b/BBWY.Test/JDProductAPITest.cs index a796de76..34387d64 100644 --- a/BBWY.Test/JDProductAPITest.cs +++ b/BBWY.Test/JDProductAPITest.cs @@ -26,6 +26,23 @@ namespace BBWY.Test Console.WriteLine(JsonConvert.SerializeObject(response)); } + public void GetSpu(IJdClient client, string token, string spu) + { + var req_productList = new WareReadSearchWare4ValidRequest() + { + orderField = "modified", + orderType = "desc", + pageSize = 50, + pageNo = 1, + field = "created,logo,brandName" + }; + + req_productList.wareId = spu; + + var res = client.Execute(req_productList, token, DateTime.Now.ToLocalTime()); + Console.WriteLine(JsonConvert.SerializeObject(res)); + } + public void QueryOrderCount(IJdClient client, string token) { var req = new ActyQueryRegistrationDataCountRequest(); diff --git a/BBWY.Test/Program.cs b/BBWY.Test/Program.cs index b40847c9..d723db95 100644 --- a/BBWY.Test/Program.cs +++ b/BBWY.Test/Program.cs @@ -39,7 +39,7 @@ namespace BBWY.Test IJdClient client = GetJdClient(appkey, appSecret); var test1 = new JDProductAPITest(); - test1.GetPromotionDetailById(client, token); + test1.GetSpu(client, token, "10023500913672"); Console.ReadKey();