From 22be34c1d833f5c7e728a98426e3d6002abeed14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Wed, 17 Nov 2021 15:18:05 +0000 Subject: [PATCH] =?UTF-8?q?!164=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=AF=AF=E7=94=A8=E5=85=AC=E4=BC=97=E5=8F=B7?= =?UTF-8?q?=E6=8E=A8=E9=80=81=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E5=AD=98=E5=9C=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=9B=AE=E5=BD=95=E5=8F=AF=E8=83=BD=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=20*=20=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E8=AF=AF=E7=94=A8?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E6=8E=A8=E9=80=81=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=8F=91=E9=80=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=20*=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=95=86=E5=93=81=E7=9B=AE=E5=BD=95=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20*=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E6=8B=BC=E5=9B=A2?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=97=AE=E9=A2=98=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=8B=BC=E5=9B=A2objectId=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E5=8F=98undefined=E4=BA=86=E3=80=82#I4I0LM=20*=20=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=BB=86=E8=8A=82=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Middlewares/MiddlewareHelpers.cs | 2 +- .../SendWxTemplateMessageSubscribe.cs | 71 ++++++++++--------- CoreCms.Net.Web.Admin/Startup.cs | 2 +- .../Controllers/GoodController.cs | 2 +- CoreCms.Net.Web.WebApi/Startup.cs | 2 +- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/CoreCms.Net.Middlewares/MiddlewareHelpers.cs b/CoreCms.Net.Middlewares/MiddlewareHelpers.cs index 12daa3e..8ab9002 100644 --- a/CoreCms.Net.Middlewares/MiddlewareHelpers.cs +++ b/CoreCms.Net.Middlewares/MiddlewareHelpers.cs @@ -25,7 +25,7 @@ namespace CoreCms.Net.Middlewares /// /// /// - public static IApplicationBuilder UseReuestResponseLog(this IApplicationBuilder app) + public static IApplicationBuilder UseRequestResponseLog(this IApplicationBuilder app) { return app.UseMiddleware(); } diff --git a/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs b/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs index 862a5b2..3d90edd 100644 --- a/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs +++ b/CoreCms.Net.RedisMQ/Subscribe/SendWxTemplateMessageSubscribe.cs @@ -96,55 +96,55 @@ namespace CoreCms.Net.RedisMQ.Subscribe } - var templateMessageData = new Dictionary(); + var templateMessageData = new Dictionary(); var pageUrl = string.Empty; if (request.code == GlobalEnumVars.PlatformMessageTypes.CreateOrder.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipName"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipMobile"].ToString() }; - templateMessageData[templateData.data05] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["shipAddress"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipName"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipMobile"].ToString() }; + templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["shipAddress"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.RemindOrderPay.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.OrderPayed.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["paymentTime"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["paymentTime"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.DeliveryNotice.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["logiName"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["logiNo"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["logiName"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["logiNo"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.AfterSalesPass.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesStatus"].ToString() }; - pageUrl = "/pages/member/order/orderdetail?orderId=" + parameters["orderId"]; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["orderAmount"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesStatus"].ToString() }; + pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"]; } else if (request.code == GlobalEnumVars.PlatformMessageTypes.RefundSuccess.ToString()) { - templateMessageData[templateData.data01] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["sourceId"].ToString() }; - templateMessageData[templateData.data02] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; - templateMessageData[templateData.data03] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["money"].ToString() }; - templateMessageData[templateData.data04] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["paymentCode"].ToString() }; - templateMessageData[templateData.data05] = new CgibinMessageSubscribeBusinessSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; + templateMessageData[templateData.data01] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["sourceId"].ToString() }; + templateMessageData[templateData.data02] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["aftersalesId"].ToString() }; + templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["money"].ToString() }; + templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["paymentCode"].ToString() }; + templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() }; } var result = await Send(weChatUserInfo.openid, templateData.templateId, templateMessageData, pageUrl); @@ -223,20 +223,21 @@ namespace CoreCms.Net.RedisMQ.Subscribe /// 发送数据 /// 路径(如:pages/index/index) /// - private async Task Send(string openId, string templateId, Dictionary tmpData, string pageUrl) + private async Task Send(string openId, string templateId, Dictionary tmpData, string pageUrl) { var jm = new WebApiCallBack(); var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken(); var client = _weChatApiHttpClientFactory.CreateWxOpenClient(); - var request = new CgibinMessageSubscribeBusinessSendRequest(); - + var request = new CgibinMessageSubscribeSendRequest(); + request.AccessToken = accessToken; - request.Page = pageUrl; + request.MiniProgramPagePath = pageUrl; request.TemplateId = templateId; request.ToUserOpenId = openId; request.Data = tmpData; + request.MiniProgramState = "formal"; - var response = await client.ExecuteCgibinMessageSubscribeBusinessSendAsync(request); + var response = await client.ExecuteCgibinMessageSubscribeSendAsync(request); if (response.IsSuccessful()) { jm.status = true; diff --git a/CoreCms.Net.Web.Admin/Startup.cs b/CoreCms.Net.Web.Admin/Startup.cs index 0586e39..e6568f9 100644 --- a/CoreCms.Net.Web.Admin/Startup.cs +++ b/CoreCms.Net.Web.Admin/Startup.cs @@ -162,7 +162,7 @@ namespace CoreCms.Net.Web.Admin public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { // ¼뷵 (ע⿪ȨޣȻ޷д) - app.UseReuestResponseLog(); + app.UseRequestResponseLog(); // ûʼ¼(ŵ㣬Ȼ쳣ᱨΪܷ)(ע⿪ȨޣȻ޷д) app.UseRecordAccessLogsMildd(); // ¼ip (ע⿪ȨޣȻ޷д) diff --git a/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs b/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs index 55816c8..9c3f345 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/GoodController.cs @@ -196,7 +196,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers className = category.name; } - var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == category.id); + var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == catId); if (childs.Any()) { var ids = childs.Select(p => p.id).ToList(); diff --git a/CoreCms.Net.Web.WebApi/Startup.cs b/CoreCms.Net.Web.WebApi/Startup.cs index 56b1688..c83893a 100644 --- a/CoreCms.Net.Web.WebApi/Startup.cs +++ b/CoreCms.Net.Web.WebApi/Startup.cs @@ -179,7 +179,7 @@ namespace CoreCms.Net.Web.WebApi public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { // ¼뷵 (ע⿪ȨޣȻ޷д) - app.UseReuestResponseLog(); + app.UseRequestResponseLog(); // ûʼ¼(ŵ㣬Ȼ쳣ᱨΪܷ)(ע⿪ȨޣȻ޷д) app.UseRecordAccessLogsMildd(); // ¼ip (ע⿪ȨޣȻ޷д)