Browse Source

1. 广电卡奖励先屏蔽
2. 立刷奖励下线(0返50、40元交易奖励、30元加码奖励)
3. 职级重置下线
4. 分润统计下线
5. 补贴统计下线

lcl 1 year ago
parent
commit
3937a2fc63

+ 1 - 1
AppStart/Helper/StatService.cs

@@ -89,7 +89,7 @@ namespace MySystem
                 {
                     function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理0押激活奖励");
                     activePrizeWithoutDeposit();
-                    activePrizeWithoutDeposit6();
+                    // activePrizeWithoutDeposit6();
                     function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理0押激活奖励");
                 }
                 catch (Exception ex)

+ 2 - 2
AppStart/Helper/SycnSpServer/SycnSpBindService.cs

@@ -180,7 +180,7 @@ namespace MySystem
                     PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
                     DateTime start = DateTime.Now.AddDays(-5);
                     int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/BindRecordId.txt")));
-                    var Binds = spdb.BindRecord.Select(m => new { m.Id, m.CreateTime, m.Status, m.MerNo, m.MerSnNo, m.ProductType, m.Remark, m.Field1, m.Field2, m.Field3, m.Field5, m.SeoTitle }).Where(m => m.Id >= StartId && m.CreateTime >= start && m.ProductType == "14" && m.Status == 1).OrderByDescending(m => m.Id).ToList();
+                    var Binds = spdb.BindRecord.Select(m => new { m.Id, m.CreateTime, m.Status, m.MerNo, m.MerSnNo, m.ProductType, m.Remark, m.Field1, m.Field2, m.Field3, m.Field5, m.SeoTitle, m.SeoKeyword }).Where(m => m.Id >= StartId && m.CreateTime >= start && m.ProductType == "14" && m.Status == 1).OrderByDescending(m => m.Id).ToList();
                     foreach (var Bind in Binds)
                     {
                         try
@@ -264,7 +264,7 @@ namespace MySystem
                                     {
                                         PrizeFlag = false;
                                     }
-                                    SycnSpTradeService.Instance.ActPos(db, pos, 0, 30, PrizeFlag);
+                                    SycnSpTradeService.Instance.ActPos(db, pos, 0, 30, PrizeFlag, Bind.SeoKeyword);
                                 }
                                 db.SaveChanges();
                             }

+ 22 - 17
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -420,15 +420,15 @@ namespace MySystem
                                             RedisDbconn.Instance.AddList("StatMerTradeAmountQueue", "{\"TradeDate\":\"" + TradeDate + "\",\"TradeAmount\":\"" + TradeAmount + "\",\"MerchantId\":\"" + pos.BindMerchantId + "\",\"BrandId\":\"" + BrandId + "\"}");
                                         }
                                         // 立刷60天内刷满10000,再返40
-                                        if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0&& pos.CreditTrade >= 10000 && pos.ActivationState == 1  && pos.BindingTime > DateTime.Now.AddDays(-60))
-                                        {
-                                            LiShuaActPrize(db, pos, 40);
-                                        }
+                                        // if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0&& pos.CreditTrade >= 10000 && pos.ActivationState == 1  && pos.BindingTime > DateTime.Now.AddDays(-60))
+                                        // {
+                                        //     LiShuaActPrize(db, pos, 40);
+                                        // }
                                         //9月1日-9月30日立刷机具刷5000激活时额外奖励30元立刷活动奖
-                                        if(pos.BrandId == 6 && pos.CreditTrade >= 5000M && pos.ActivationTime >= DateTime.Parse("2023-08-31 00:00:00") && pos.ActivationTime < DateTime.Parse("2023-11-01 00:00:00"))
-                                        {
-                                            LiShuaActPrize(db, pos, 30);
-                                        }
+                                        // if(pos.BrandId == 6 && pos.CreditTrade >= 5000M && pos.ActivationTime >= DateTime.Parse("2023-08-31 00:00:00") && pos.ActivationTime < DateTime.Parse("2023-11-01 00:00:00"))
+                                        // {
+                                        //     LiShuaActPrize(db, pos, 30);
+                                        // }
                                         db.SpOrderNos.Add(new PxcModels.SpOrderNos()
                                         {
                                             OrderNo = trade.TradeSerialNo
@@ -464,19 +464,24 @@ namespace MySystem
         }
 
         //机具激活逻辑
-        public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true)
+        public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true, string ActivationTime = "")
         {
             DateTime now = DateTime.Now;
+            if(!string.IsNullOrEmpty(ActivationTime))
+            {
+                now = DateTime.Parse(ActivationTime);
+            }
             DateTime TransferTime = pos.TransferTime == null ? DateTime.Now : pos.TransferTime.Value;
             int minute = 30;
             if(pos.BrandId == 14)
             {
                 minute = 0;
+                PrizeFlag = false;
             }
             if (pos.CreditTrade >= CheckMoney && pos.BuyUserId > 0 && pos.ActivationState == 0 && TransferTime.AddMinutes(-minute) < pos.BindingTime)
             {
                 pos.ActivationState = 1;
-                pos.ActivationTime = DateTime.Now;
+                pos.ActivationTime = now;
                 function.WriteLog("机具" + pos.PosSn, "开机奖励在激活中监控");
                 function.WriteLog("PrizeFlag:" + PrizeFlag, "开机奖励在激活中监控");
                 PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
@@ -484,33 +489,33 @@ namespace MySystem
                 {
                     function.WriteLog("查询到商户", "开机奖励在激活中监控");
                     merchant.ActiveStatus = 1;
-                    merchant.MerStandardDate = DateTime.Now;
+                    merchant.MerStandardDate = now;
                     db.SaveChanges();
 
                     function.WriteLog("商户" + merchant.KqMerNo, "开机奖励在激活中监控");
 
                     //发放开机奖励
                     function.WriteLog("首台" + pos.IsFirst, "开机奖励在激活中监控");
-                    if(pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
+                    if(pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
                     {
                         function.WriteLog("开机奖发放", "开机奖励在激活中监控");
                         RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
                     }
                 }
-                else if(pos.BrandId == 14 && pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
+                else if(pos.BrandId == 14 && pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
                 {
                     function.WriteLog("开机奖发放", "开机奖励在激活中监控");
                     RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
                 }
                 //发放大盟主奖励
-                function.WriteLog("大盟主---PrizeFlag:" + PrizeFlag + ";LeaderUserId:" + pos.LeaderUserId + ";pos.IsFirst:" + pos.IsFirst + ";pos.BindingTime:" + pos.BindingTime + ";DateTime.Now.AddDays(-CheckDays):" + DateTime.Now.AddDays(-CheckDays) + ";", "开机奖励在激活中监控");
-                if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
+                function.WriteLog("大盟主---PrizeFlag:" + PrizeFlag + ";LeaderUserId:" + pos.LeaderUserId + ";pos.IsFirst:" + pos.IsFirst + ";pos.BindingTime:" + pos.BindingTime + ";now.AddDays(-CheckDays):" + now.AddDays(-CheckDays) + ";", "开机奖励在激活中监控");
+                if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
                 {
                     function.WriteLog("大盟主奖发放", "开机奖励在激活中监控");
                     RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
                 }
                 //发放运营中心奖励
-                if (pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
+                if (pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
                 {
                     function.WriteLog("运营中心奖发放", "开机奖励在激活中监控");
                     RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
@@ -518,7 +523,7 @@ namespace MySystem
                 AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
 
                 //统计激活数
-                RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
+                RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
             }
         }
 

+ 1 - 1
Startup.cs

@@ -167,7 +167,7 @@ namespace MySystem
             if(Library.ConfigurationManager.EnvironmentFlag == 2)
             {
                 SycnSpBindService.Instance.Start(); //同步SP绑定数据
-                SycnSpBindService.Instance.StartSim(); //同步SP广电卡绑定数据
+                // SycnSpBindService.Instance.StartSim(); //同步SP广电卡绑定数据
                 SycnSpMerchantService.Instance.Start(); //同步SP商户数据
                 SycnSpActiveService.Instance.Start(); //同步SP激活数据
                 SycnSpTradeService.Instance.Start(); //同步SP交易数据