lcl 1 hete
szülő
commit
f4d8b0c2f5
2 módosított fájl, 19 hozzáadás és 13 törlés
  1. 18 13
      AppStart/Helper/LeaderCompPrize2Helper.cs
  2. 1 0
      Startup.cs

+ 18 - 13
AppStart/Helper/LeaderCompPrize2Helper.cs

@@ -44,27 +44,32 @@ namespace MySystem
             }
         }
 
-        public void StartTest()//启动
+        public void StartRepeat()//启动
         {
-            Thread thread = new Thread(ListenTest);
+            Thread thread = new Thread(ListenRepeat);
             thread.IsBackground = true;
             thread.Start();
         }
 
-        public void ListenTest()//启动
+        public void ListenRepeat()//启动
         {
-            string check = function.ReadInstance("/LeaderComp/Repeat/202505.txt");
-            if (string.IsNullOrEmpty(check))
+            while(true)
             {
-                function.WritePage("/LeaderComp/Repeat/", "202505.txt", DateTime.Now.ToString());
-                Ready("202505");
+                string month = RedisDbconn.Instance.RPop<string>("LeaderCompRepeatQueue");
+                if(!string.IsNullOrEmpty(month))
+                {
+                    string check = function.ReadInstance("/LeaderComp/Repeat/" + month + ".txt");
+                    if (string.IsNullOrEmpty(check))
+                    {
+                        function.WritePage("/LeaderComp/Repeat/", "" + month + ".txt", DateTime.Now.ToString());
+                        Ready(month);
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(120000);
+                }
             }
-            // check = function.ReadInstance("/LeaderComp/Repeat/202503.txt");
-            // if (string.IsNullOrEmpty(check))
-            // {
-            //     function.WritePage("/LeaderComp/Repeat/", "202503.txt", DateTime.Now.ToString());
-            //     Ready("202503");
-            // }
         }
 
         public void Ready(string curMonth)

+ 1 - 0
Startup.cs

@@ -167,6 +167,7 @@ namespace MySystem
             // if(Library.ConfigurationManager.EnvironmentFlag == 2)
             // {
                 LeaderCompPrize2Helper.Instance.Start(); //领导人达标奖
+                LeaderCompPrize2Helper.Instance.StartRepeat(); //领导人达标奖重跑
                 RecommandKing2Helper.Instance.Start(); //推荐王
                 // AddSourcePosSnHelper.Instance.Start(); //补来源机具
             // }