From 54ca7d84d8fa454b433a5d428f61fab220ce38d9 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Tue, 25 Jul 2023 11:21:43 +0800 Subject: [PATCH 1/3] 1 --- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 8b23f19f..e64c4ffc 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -427,6 +427,11 @@ namespace BBWY.Server.Business if (platformRequest.SaveResponseLog) nLogManager.Default().Info(response.Body); + if (!string.IsNullOrEmpty(response.ErrorMsg) && response.ErrorMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + if (!string.IsNullOrEmpty(response.ErrMsg) && response.ErrMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + var jarray = (JArray)(response.Json["jingdong_fce_alpha_getVenderCarrier_responce"]["StandardGenericResponse"]["result"]["carrierList"]); return jarray.Select(j => new LogisticsResponse() @@ -1374,7 +1379,15 @@ namespace BBWY.Server.Business var req = new ImPopGroupinfoGetRequest(); var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); if (res.IsError) + { + if (!string.IsNullOrEmpty(res.ErrorMsg) && res.ErrorMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + if (!string.IsNullOrEmpty(res.ErrMsg) && res.ErrMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + throw new BusinessException($"查询客服组失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); + } + if (res.Json == null) res.Json = JsonConvert.DeserializeObject(res.Body); return res.Json["jingdong_im_pop_groupinfo_get_responce"]["popgroup"]["waiterList"].Select(j => new WaiterResponse() From a69efce1e92dcd21e23b6d1c81ccbee39f6c4902 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Tue, 25 Jul 2023 11:51:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=89=A9=E6=B5=81?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E8=BF=87=E6=9C=9F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Server.Business/PlatformSDK/JDBusiness.cs | 7 +++++-- BBWY.Test/Program.cs | 15 +++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index e64c4ffc..5fe28c16 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -420,12 +420,15 @@ namespace BBWY.Server.Business { var jdClient = GetJdClient(platformRequest.AppKey, platformRequest.AppSecret); var response = jdClient.Execute(new FceAlphaGetVenderCarrierRequest(), platformRequest.AppToken, DateTime.Now.ToLocalTime()); + if (platformRequest.SaveResponseLog) + nLogManager.Default().Info(response.Body); + + if (!string.IsNullOrEmpty(response.Body) && response.Body.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); if (response.IsError) throw new BusinessException($"{response.RealErrorMsg}"); if (response.Json == null) response.Json = JObject.Parse(response.Body); - if (platformRequest.SaveResponseLog) - nLogManager.Default().Info(response.Body); if (!string.IsNullOrEmpty(response.ErrorMsg) && response.ErrorMsg.Contains("token已过期")) throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); diff --git a/BBWY.Test/Program.cs b/BBWY.Test/Program.cs index 851a27c3..9c1d9ac3 100644 --- a/BBWY.Test/Program.cs +++ b/BBWY.Test/Program.cs @@ -57,20 +57,11 @@ namespace BBWY.Test //var token = "44c19a1c1fbd4641957e6e8985ed1358jmtl"; //森王玩具 //var token = "4a0ddc095e054c7aa90adcaccb14f83cwzgr"; //可比车品 //var token = "50a4c0f5c55848b5a8a715709e8d6fe0jntb"; //卿卿玩具专营店 - var client = GetJdClient(appkey, appSecret); - var req1 = new EclpPoQueryPoOrderRequest(); - req1.poOrderNo = "EPL4418077994061"; - var response1 = client.Execute(req1, token, DateTime.Now.ToLocalTime()); - Console.WriteLine(JsonConvert.SerializeObject(response1)); + var jdClient = GetJdClient(appkey, appSecret); + var response = jdClient.Execute(new FceAlphaGetVenderCarrierRequest(), token, DateTime.Now.ToLocalTime()); - if (response1.Json == null) - response1.Json = JObject.Parse(response1.Body); - - var req2 = new EclpMasterQuerySupplierRequest(); - req2.deptNo = response1.Json["jingdong_eclp_po_queryPoOrder_responce"]["queryPoModelList"].Children().FirstOrDefault().Value("deptNo"); - var response2 = client.Execute(req2, token, DateTime.Now.ToLocalTime()); - Console.WriteLine(JsonConvert.SerializeObject(response2)); + Console.WriteLine(JsonConvert.SerializeObject(response)); Console.ReadKey(); } From f752cdca414fc79eec843ca64fe6107720da9712 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Tue, 25 Jul 2023 12:42:04 +0800 Subject: [PATCH 3/3] 10155 --- BBWY.Client/GlobalContext.cs | 2 +- BBWY.Client/ViewModels/MainViewModel.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index a16db80b..da65c194 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10154"; + ClientVersion = "10155"; } private User user; diff --git a/BBWY.Client/ViewModels/MainViewModel.cs b/BBWY.Client/ViewModels/MainViewModel.cs index d2d1fa57..645c76c3 100644 --- a/BBWY.Client/ViewModels/MainViewModel.cs +++ b/BBWY.Client/ViewModels/MainViewModel.cs @@ -498,6 +498,20 @@ namespace BBWY.Client.ViewModels if (!apiResponse.Success) { MessageBox.Show(apiResponse.Msg, "获取客服组"); + if (apiResponse.Msg.Contains("订购链接")) + { + var url = "https://fw.jd.com/main/detail/FW_GOODS-187201"; + try + { + + ShellExecuteHelper.ShellExecute(IntPtr.Zero, "open", url, string.Empty, string.Empty, ShellExecuteHelper.ShowCommands.SW_SHOWNORMAL); + } + catch (Exception ex) + { + Clipboard.SetText(url); + MessageBox.Show($"{ex.Message}\r\n打开订购页面失败,订购链接已复制到系统剪切板", "提示"); + } + } Environment.Exit(Environment.ExitCode); } GlobalContext.ShopServiceGroupList.Clear();