Explorar o código

自动通过接口获取广电卡激活数据,1小时1次

lcl hai 1 ano
pai
achega
764f8c9bb8
Modificáronse 1 ficheiros con 20 adicións e 0 borrados
  1. 20 0
      AppStart/Helper/SIMPosMerchantTradeService.cs

+ 20 - 0
AppStart/Helper/SIMPosMerchantTradeService.cs

@@ -29,6 +29,11 @@ namespace MySystem
             Thread thread1 = new Thread(SIMActDo); // 通过接口获取广电卡激活数据
             thread1.IsBackground = true;
             thread1.Start();
+
+            Thread thread2 = new Thread(AutoSIMAct); // 自动通过接口获取广电卡激活数据
+            thread2.IsBackground = true;
+            thread2.Start();
+            
         }
 
         public void ImportPostDo()
@@ -212,6 +217,21 @@ namespace MySystem
         }
 
 
+        public void AutoSIMAct()
+        {
+            while (true)
+            {
+                try
+                {
+                    string DateStr = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
+                    RedisDbconn.Instance.AddList("SIMActInfo", DateStr);
+                    Thread.Sleep(3600);
+                }
+                catch { }
+            }
+        }
+
+
         /// <summary>
         /// 通过接口获取广电卡激活数据
         /// </summary>