lcl 1 жил өмнө
parent
commit
48bb53d821

+ 24 - 10
Controllers/HomeController.cs

@@ -168,7 +168,7 @@ namespace MySystem.Controllers
 
         public string test()
         {
-            // WebCMSEntities db = new WebCMSEntities();
+            WebCMSEntities db = new WebCMSEntities();
             // AlipayPayBack2Service.Instance.DoOrderV2(db, 269424);
             // db.Dispose();
             // List<int> ids = new List<int>();
@@ -188,7 +188,7 @@ namespace MySystem.Controllers
             // AlipayPayBack2Service.Instance.OperateAmountChange(db, 392, 40000, 1, 2, "商城购机");
             // db.Dispose();
 
-            string result = "";
+            string result = "ok";
 
             // result += SetDepositPostService.Instance.ModifyFee("00005002681889119293", 0.0063M, "3") + "\n\n";
             // result += SetDepositPostService.Instance.SetFeeForSft("39103661", "0.6300", "3") + "\n\n";
@@ -203,12 +203,26 @@ namespace MySystem.Controllers
             //{"status":1,"messge":null,"data":{"userId":1,"token":"eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImQyN2E2OGY0NzY0MjRiMzJiNjhhM2JlMTc1ZjQ4OGE3In0.xjKmh1Pu9_DvwI-zpML8Z3oqKs99PQW-9aBg-ru2i-xQZYC3yKEtJ_H1_bcw2byGNnMNXMPRlBoDegLpSebXDA","loginTime":1699331586502,"expireTime":1699417986502,"ipaddr":null,"loginLocation":null,"browser":null,"os":null,"user":null},"other":null,"code":"1","timestamp":null}
 
 
-            // List<string> ids = new List<string>();
-            // foreach(string id in ids)
+            // List<int> ids = new List<int>();
+            // DateTime now = DateTime.Now;
+            // foreach(int id in ids)
             // {
-            //     RedisDbconn.Instance.AddList("OpenRewardQueue", id);
-            //     RedisDbconn.Instance.AddList("LeaderPrizeQueue", id);
-            //     RedisDbconn.Instance.AddList("OperatePrizeQueue", id);
+            //     PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == id);
+            //     if(pos != null)
+            //     {
+            //         if(pos.BrandId == 14 && pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-30))
+            //         {
+            //             RedisDbconn.Instance.AddList("OpenRewardQueue", id);
+            //         }
+            //         if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > now.AddDays(-30))
+            //         {
+            //             RedisDbconn.Instance.AddList("LeaderPrizeQueue", id);
+            //         }
+            //         if (pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-30))
+            //         {
+            //             RedisDbconn.Instance.AddList("OperatePrizeQueue", id);
+            //         }
+            //     }
             // }
 
             // DataTable dt = CustomerSqlConn.dtable("select KqMerNo from PosMerchantInfo where Id in (select BindMerchantId from PosMachinesTwo where BrandId in (12,13) and DownFeeFlag=1 and DownFeeDate>'2023-11-10 00:00:00')", MysqlConn.SqlConnStr);
@@ -229,7 +243,7 @@ namespace MySystem.Controllers
             //     RedisDbconn.Instance.AddList("AddPosCouponPrizeQueue", dr["Id"].ToString());
             // }
 
-            WebCMSEntities db = new WebCMSEntities();
+            // WebCMSEntities db = new WebCMSEntities();
             // var poslist = db.PosMachinesTwo.Select(m => new { m.Id, m.BrandId, m.CardType, m.IsPurchase, m.PosSn }).Where(m => m.BrandId == 14 && m.CardType == 2 && m.IsPurchase == 1).ToList();
             // foreach(var pos in poslist)
             // {
@@ -250,9 +264,9 @@ namespace MySystem.Controllers
             // string info = "{\"RecordId\":\"65931\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"2\",\"OpMan\": \""+"系统"+"\"}";
             // RedisDbconn.Instance.AddList("SetDepositQueue", info);
 
-            StoreApplyHelper.Instance.DoSomething(db, 49690);
+            // StoreApplyHelper.Instance.DoSomething(db, 49690);
 
-            db.Dispose();
+            // db.Dispose();
 
             return result;
         }