浏览代码

添加补购机奖励队列

lcl 1 年之前
父节点
当前提交
08d9c8d446
共有 3 个文件被更改,包括 34 次插入13 次删除
  1. 33 1
      AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs
  2. 0 12
      Controllers/HomeController.cs
  3. 1 0
      Startup.cs

+ 33 - 1
AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs

@@ -214,6 +214,38 @@ namespace MySystem
 
 
 
+
+
+        public void Start2()
+        {
+            Thread th = new Thread(ready2);
+            th.IsBackground = true;
+            th.Start();
+        }
+        
+        private void ready2()
+        { 
+            bool op = true;
+            while (op)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("PosCouponPrizeQueue2");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    try
+                    {
+                        dosomething(int.Parse(function.CheckInt(content)));
+                    }
+                    catch
+                    {
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(5000);
+                }
+            }
+        }
+
         public void dosomething2(int OrderId)
         { 
             WebCMSEntities db = new WebCMSEntities();
@@ -300,7 +332,7 @@ namespace MySystem
                                             PrizeFlag = false;
                                         }
                                     }
-                                    if(PrizeFlag && !db.UserAccountRecord.Any(m => m.QueryCount == order.Id && m.ChangeType == 128) && GetPrize == 60)
+                                    if(PrizeFlag && !db.UserAccountRecord.Any(m => m.QueryCount == order.Id && m.ChangeType == ChangeType))
                                     {
                                         OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, ChangeType);
                                     }

+ 0 - 12
Controllers/HomeController.cs

@@ -471,17 +471,5 @@ namespace MySystem.Controllers
             }
             return "ok";
         }
-
-        public string order60()
-        {
-            WebCMSEntities db = new WebCMSEntities();
-            List<int> oids = new List<int>();
-            foreach(int oid in oids)
-            {
-                PosCouponPrizeService.Instance.dosomething2(oid);
-            }
-            db.Dispose();
-            return "ok";
-        }
     }
 }

+ 1 - 0
Startup.cs

@@ -206,6 +206,7 @@ namespace MySystem
 
                 AlipayPayBack2Service.Instance.Start(); //支付宝回调处理
                 PosCouponPrizeService.Instance.Start(); //购券奖励队列
+                PosCouponPrizeService.Instance.Start2(); //购券奖励队列(补奖励)
                 OperateAddService.Instance.Start(); //购买运营中心队列
                 BalancePayBackService.Instance.Start(); //余额支付队列
                 ReservePayBackService.Instance.Start(); //储备金支付队列