From 539dd16c7ee4da6c4b9d4f953b91f1360bb4a7b4 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 20 十月 2023 14:47:53 +0800 Subject: [PATCH] no message --- api/.vs/FxProject/v16/.suo | 0 api/Api.Operater/Controllers/sms/WxBackController.cs | 11 +++++++++++ api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml.user | 10 ++++++++++ api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml | 20 ++++++++++++++++++++ api/Api.Operater/Api.Operater.csproj.user | 2 +- api/Api.Operater/appsettings.json | 2 ++ api/ScheduledTasks/appsettings.json | 2 ++ api/CommonUtil/Web/SendQwGroup.cs | 9 +++++++-- 8 files changed, 53 insertions(+), 3 deletions(-) diff --git a/api/.vs/FxProject/v16/.suo b/api/.vs/FxProject/v16/.suo index fb50286..023a618 100644 --- a/api/.vs/FxProject/v16/.suo +++ b/api/.vs/FxProject/v16/.suo Binary files differ diff --git a/api/Api.Operater/Api.Operater.csproj.user b/api/Api.Operater/Api.Operater.csproj.user index 9e38e84..2290ab6 100644 --- a/api/Api.Operater/Api.Operater.csproj.user +++ b/api/Api.Operater/Api.Operater.csproj.user @@ -3,6 +3,6 @@ <PropertyGroup> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> - <NameOfLastUsedPublishProfile>E:\OPProject\operateApi\Api.Operater\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> + <NameOfLastUsedPublishProfile>E:\OPProject\鐭俊椤圭洰\api\Api.Operater\Properties\PublishProfiles\FolderProfile2.pubxml</NameOfLastUsedPublishProfile> </PropertyGroup> </Project> \ No newline at end of file diff --git a/api/Api.Operater/Controllers/sms/WxBackController.cs b/api/Api.Operater/Controllers/sms/WxBackController.cs index c57f99a..098523d 100644 --- a/api/Api.Operater/Controllers/sms/WxBackController.cs +++ b/api/Api.Operater/Controllers/sms/WxBackController.cs @@ -158,6 +158,17 @@ new WxpayTradeDAL().Update(preTrade, null, null); //鍏呭�煎鐞� PayUserInfo(notify, preTrade); + //鍙戦�佹彁閱� + try + { + string warStr = "鍏呭�兼彁閱抃n>绫诲瀷锛氱煭淇″厖鍊糪n>鐭俊鏁伴噺锛�" + preTrade.SmsCount + "\n>鍏呭�奸噾棰濓細" + Math.Round((decimal)preTrade.Amount / 100, 2); + SendQwGroup.SendMessage(warStr); + } + catch + { + + } + return WeChatPayNotifyResult.Success; } return WeChatPayNotifyResult.Failure; diff --git a/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml b/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml new file mode 100644 index 0000000..1c9a2a3 --- /dev/null +++ b/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml @@ -0,0 +1,20 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- +https://go.microsoft.com/fwlink/?LinkID=208121. +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <DeleteExistingFiles>True</DeleteExistingFiles> + <ExcludeApp_Data>False</ExcludeApp_Data> + <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> + <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> + <LastUsedPlatform>Any CPU</LastUsedPlatform> + <PublishProvider>FileSystem</PublishProvider> + <PublishUrl>bin\Release\netcoreapp3.1\publish\</PublishUrl> + <WebPublishMethod>FileSystem</WebPublishMethod> + <SiteUrlToLaunchAfterPublish /> + <TargetFramework>netcoreapp3.1</TargetFramework> + <ProjectGuid>9c5e2acc-af32-4e82-bc9b-583db5826a90</ProjectGuid> + <SelfContained>false</SelfContained> + </PropertyGroup> +</Project> \ No newline at end of file diff --git a/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml.user b/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml.user new file mode 100644 index 0000000..2975108 --- /dev/null +++ b/api/Api.Operater/Properties/PublishProfiles/FolderProfile2.pubxml.user @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- +https://go.microsoft.com/fwlink/?LinkID=208121. +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <_PublishTargetUrl>E:\OPProject\鐭俊椤圭洰\api\Api.Operater\bin\Release\netcoreapp3.1\publish\</_PublishTargetUrl> + <History>True|2023-10-20T06:26:34.7297111Z;</History> + </PropertyGroup> +</Project> \ No newline at end of file diff --git a/api/Api.Operater/appsettings.json b/api/Api.Operater/appsettings.json index ea3e79f..72ff20b 100644 --- a/api/Api.Operater/appsettings.json +++ b/api/Api.Operater/appsettings.json @@ -60,6 +60,8 @@ // 目前仅调用"企业付款到银行卡API [V2]"时使用,执行本示例中的"获取RSA加密公钥API [V2]"即可获取。 "RsaPublicKey": "" }, + //企微webhook + "qw_webhook": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1e5a8b47-b108-40a6-9a29-d629863bd066", "DbConnection": [ { ////测试 diff --git a/api/CommonUtil/Web/SendQwGroup.cs b/api/CommonUtil/Web/SendQwGroup.cs index 588ef4e..35fbb21 100644 --- a/api/CommonUtil/Web/SendQwGroup.cs +++ b/api/CommonUtil/Web/SendQwGroup.cs @@ -16,11 +16,16 @@ { try { + string webhook = ConfigUtil.GetValue<string>("qw_webhook"); + if(webhook.IsNullOrEmpty()) + { + return; + } string body = "{\"msgtype\": \"markdown\",\"markdown\":{\"content\":\"" + message + "\"}}"; - string res = new WebUtil().DoPostWithJson("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1e5a8b47-b108-40a6-9a29-d629863bd066", body, null); + string res = new WebUtil().DoPostWithJson(webhook, body, null); body = "{\"msgtype\": \"text\",\"text\":{\"content\":\"鎮ㄦ湁鏂扮殑娑堟伅闇�瑕佸鐞哱",\"mentioned_mobile_list\":[\"13382447768\",\"15862977578\",\"17315773080\"]}}"; - res = new WebUtil().DoPostWithJson("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1e5a8b47-b108-40a6-9a29-d629863bd066", body, null); + res = new WebUtil().DoPostWithJson(webhook, body, null); } catch { diff --git a/api/ScheduledTasks/appsettings.json b/api/ScheduledTasks/appsettings.json index 00afa5a..10f2dd0 100644 --- a/api/ScheduledTasks/appsettings.json +++ b/api/ScheduledTasks/appsettings.json @@ -7,6 +7,8 @@ } }, "AllowedHosts": "*", + //企微webhook + "qw_webhook": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1e5a8b47-b108-40a6-9a29-d629863bd066", //短信系统预警 每隔5分钟触发一次 "job_smswarning": "0 0/5 * * * ?", "DbConnection": [ -- Gitblit v1.9.3