| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | CnClose(); |
| | | CnDispose(); |
| | | } |
| | | |
| | | private static readonly object lockObj = new object(); |
| | | //写日志 |
| | | public static void CustomWriteLog(object obj, string FileName, string filePath = "Vlog", bool isAppend = true) |
| | | { |
| | | try |
| | | { |
| | | lock (lockObj) |
| | | { |
| | | filePath = $@"{filePath}\{FileName}.txt"; |
| | | |
| | | filePath = AppDomain.CurrentDomain.BaseDirectory + filePath; |
| | | |
| | | if (!System.IO.Directory.Exists(Path.GetDirectoryName(filePath))) |
| | | { |
| | | System.IO.Directory.CreateDirectory(Path.GetDirectoryName(filePath)); |
| | | } |
| | | |
| | | bool fileExists = System.IO.File.Exists(filePath); |
| | | //不存在 则创建该文件 |
| | | if (!fileExists) |
| | | { |
| | | System.IO.File.Create(filePath).Close(); |
| | | } |
| | | |
| | | using (StreamWriter writer = new StreamWriter(filePath, isAppend)) |
| | | { |
| | | //存在的时候才写一行 |
| | | if (fileExists && isAppend) |
| | | { |
| | | writer.WriteLine(); |
| | | } |
| | | |
| | | var content = obj is string ? obj : JsonConvert.SerializeObject(obj); |
| | | writer.WriteLine($"{DateTime.Now} {content}"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <PropertyGroup> |
| | | <ShowAllFiles>false</ShowAllFiles> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | { |
| | | string appKey = "dingrsrzhdyn3mlaof95"; |
| | | string appSecret = "RAqH6YtZnPLCpDbuqfaYQkKkVtVdS0wqfC8I26X6qiS-8eoCJCNrzx3fubGND4Sq"; |
| | | Console.WriteLine("Hello World!"); |
| | | Console.WriteLine("程序正在执行,请不要关闭!!!!"); |
| | | while (true) |
| | | { |
| | | Console.WriteLine("Hello World!1"); |
| | | //查数据 |
| | | string sql = "select a.HInterID,a.HReceiveMan 接收人,c.HDingDingUserID 钉钉id,b.HDescription 内容 from OA_ErrMsgBackBillSub2" + |
| | | " a inner join OA_ErrMsgBackBillMain b on a.HInterID=b.HInterID left join Gy_Czygl c " + |
| | |
| | | string sql1 = "update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('" + Stares + "')"; |
| | | oCN.RunProc(sql1); |
| | | Console.WriteLine(sql1); |
| | | DBHelper.CustomWriteLog("钉钉返回信息:"+response+" 更新子表语句:"+sql1, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | } |
| | | else |
| | | { |
| | | Console.WriteLine(responseData.errcode); |
| | | DBHelper.CustomWriteLog("钉钉返回信息:" + response, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | // 等待一分钟 |
New file |
| | |
| | | 2024/7/2 21:05:55 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3165700882944,"request_id":"16mg1ldq6z11j"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('张瑞广') |
| | | |
| | | 2024/7/2 21:06:00 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3164678153205,"request_id":"15sq8m7iyid3v"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('余思杰') |
| | | |
| | | 2024/7/2 21:06:01 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3169343584156,"request_id":"16mo0g1pnusay"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('杨乐') |
| | | |
| | | 2024/7/2 21:06:01 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3165696885235,"request_id":"16kzgzu1cx5mw"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('景焕章') |
| | | |
| | | 2024/7/2 21:06:02 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3164668263691,"request_id":"16l28rpuv1xg9"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('景焕章') |
| | | |
| | | 2024/7/2 21:06:02 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3167779443991,"request_id":"15rdh7i30ubwn"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('张瑞广') |
| | | |
| | | 2024/7/2 21:06:03 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3167795343392,"request_id":"15r926xqwmk72"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('余思杰') |
| | | |
| | | 2024/7/2 21:06:12 钉钉返回信息:{"errcode":0,"errmsg":"ok","task_id":3169325770146,"request_id":"16mh98twpxfjs"} 更新子表语句:update OA_ErrMsgBackBillSub2 set HSendFlag='1' where HReceiveMan in ('杨乐') |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> |
| | | <metadata> |
| | | <id>DingDingMsg</id> |
| | | <version>1.0.0</version> |
| | | <authors>DingDingMsg</authors> |
| | | <requireLicenseAcceptance>false</requireLicenseAcceptance> |
| | | <description>Package Description</description> |
| | | <dependencies> |
| | | <group targetFramework=".NETCoreApp3.1"> |
| | | <dependency id="Newtonsoft.Json" version="13.0.3" exclude="Build,Analyzers" /> |
| | | <dependency id="System.Data.SqlClient" version="4.8.6" exclude="Build,Analyzers" /> |
| | | </group> |
| | | </dependencies> |
| | | </metadata> |
| | | <files> |
| | | <file src="D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.runtimeconfig.json" target="lib\netcoreapp3.1\DingDingMsg.runtimeconfig.json" /> |
| | | <file src="D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.dll" target="lib\netcoreapp3.1\DingDingMsg.dll" /> |
| | | </files> |
| | | </package> |
| | |
| | | D:\智云迈思\MES\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.genruntimeconfig.cache |
| | | D:\智云迈思\MES\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll |
| | | D:\智云迈思\MES\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.csproj.AssemblyReference.cache |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.exe |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.deps.json |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.runtimeconfig.json |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.runtimeconfig.dev.json |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\DingDingMsg.pdb |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\System.Data.SqlClient.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\runtimes\win-arm64\native\sni.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\runtimes\win-x64\native\sni.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\runtimes\win-x86\native\sni.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.1\System.Data.SqlClient.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.1\System.Data.SqlClient.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.AssemblyInfoInputs.cache |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.AssemblyInfo.cs |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.csproj.CoreCompileInputs.cache |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.csproj.CopyComplete |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.dll |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.pdb |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.genruntimeconfig.cache |
| | | D:\智云迈思\DingDingMsg\DingDingMsg\DingDingMsg\obj\Debug\netcoreapp3.1\DingDingMsg.csproj.AssemblyReference.cache |