diff --git a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo index 7f519378..64fed920 100644 Binary files a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo and b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo differ diff --git a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.backup.json b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.backup.json new file mode 100644 index 00000000..0ee74a3a --- /dev/null +++ b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.backup.json @@ -0,0 +1,79 @@ +{ + "Version": 1, + "WorkspaceRootPath": "D:\\\u6570\u636E\\\u8BFA\u5FC5\u8FBE\\\u4E94\u73AF\\CNCEC_SUBQHSE_WUHUAN\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 1, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedHeight": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}" + }, + { + "$type": "Bookmark", + "Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:132:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:133:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:134:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:1:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:131:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}" + }, + { + "$type": "Bookmark", + "Name": "ST:2:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:3:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1a46fd64-28d5-434c-8eb3-17a02d419b53}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{5726b0e3-1012-5233-81f9-d1fad48e7a56}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.json b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.json index 0ee74a3a..ee21c543 100644 --- a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.json +++ b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/DocumentLayout.json @@ -59,10 +59,6 @@ "$type": "Bookmark", "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" }, - { - "$type": "Bookmark", - "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" - }, { "$type": "Bookmark", "Name": "ST:0:0:{1a46fd64-28d5-434c-8eb3-17a02d419b53}" @@ -70,6 +66,14 @@ { "$type": "Bookmark", "Name": "ST:0:0:{5726b0e3-1012-5233-81f9-d1fad48e7a56}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" } ] } diff --git a/SGGL/BLL/OpenService/MonitorService.cs b/SGGL/BLL/OpenService/MonitorService.cs index 907cb7b1..32ffa43c 100644 --- a/SGGL/BLL/OpenService/MonitorService.cs +++ b/SGGL/BLL/OpenService/MonitorService.cs @@ -4,6 +4,7 @@ using System.DirectoryServices; using System.Linq; using System.Web.UI.WebControls; using System.Collections.Generic; +using System.Threading.Tasks; using Newtonsoft.Json.Linq; using Newtonsoft.Json; //using Microsoft.SqlServer.Dts.Runtime; @@ -16,9 +17,12 @@ namespace BLL private static Timer inOutTimer1; - public static void StartInOutSync() + public static async Task StartInOutSync() { + ErrLogInfo.WriteLog("启用出入定时器开始!"); + + // 停止并释放之前的定时器(如果存在) if (inOutTimer1 != null) { inOutTimer1.Stop(); @@ -26,24 +30,26 @@ namespace BLL inOutTimer1 = null; } + // 创建新的定时器 inOutTimer1 = new Timer { - AutoReset = true + AutoReset = true, + Interval = 1000 * 60 * 10 // 60分钟 }; - inOutTimer1.Elapsed += new ElapsedEventHandler(InOutProcess1); - inOutTimer1.Interval = 1000 * 60 * 10;// 60分钟 60000 * adTimeJ; + + // 使用异步事件处理方法 + inOutTimer1.Elapsed += async (sender, e) => await InOutProcess1Async(sender, e); + + // 启动定时器 inOutTimer1.Start(); - - - ErrLogInfo.WriteLog("启用出入定时器结束!"); } - public static void InOutProcess1(object sender, ElapsedEventArgs e) + public static async Task InOutProcess1Async(object sender, ElapsedEventArgs e) { ErrLogInfo.WriteLog("氟化工出入同步开始"); try