企业微信智慧校园的门禁控制服务
wzp
2024-07-15 91b0b1f89e1a14f522b95ad0ebd3118261aafd7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Rdream.Core.Model;
using Rdream.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Rdream.Core.DataHandler;
using System.Collections;
using Newtonsoft.Json;
 
namespace TimedTaskService
{
    class Program
    {
        public static int _sleepTime = int.Parse(System.Configuration.ConfigurationManager.AppSettings["sleepTime"]);
 
        static void Main(string[] args)
        {
 
            log4netService.Debug("门禁监控程序已启动...");
            Console.WriteLine("门禁监控程序已启动...");
 
            while (true)
            {
                ResponseMsgMo rpm = new ResponseMsgMo();
                try
                {
                    rpm = SendMsgByAccessControlRecord.Instance.sendMsgByAccessControlRecord();    //result为上面的Json数据
 
                    if (rpm == null)
                    {
 
                        System.Threading.Thread.Sleep(_sleepTime);
                        //log4netService.Debug("调用推送学生进出学校消息响应为空!");
                        continue;
                    }
 
                } catch (Exception ex)
                {
                    System.Threading.Thread.Sleep(_sleepTime);
 
                    log4netService.Debug("调用推送学生进出学校消息接口异常:" + ex.Message + "详情:" + ex.ToString());
                    continue;
                }
                
                System.Threading.Thread.Sleep(_sleepTime);
                
            }
            
        }
 
 
    }
}