瀏覽代碼

发放激活奖励,如果商户号为空则赋值为随机商户号,不影响后面的机具奖励发放
广电卡奖励发放,也要有30分钟缓冲

lcl 1 年之前
父節點
當前提交
e52f5c1a6e
共有 2 個文件被更改,包括 12 次插入52 次删除
  1. 8 48
      AppStart/Helper/StatService.cs
  2. 4 4
      AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

+ 8 - 48
AppStart/Helper/StatService.cs

@@ -764,7 +764,12 @@ namespace MySystem
 
         public void doActiveReward(WebCMSEntities db, PosMerchantInfo merchant, PosMachinesTwo pos, int GetUserId, string ParentNav, int TopUserId, decimal ActPrize, int ChangeType = 0, int ActType = 0)
         {
-            bool check = db.ActiveReward.Any(m => m.KqMerNo == merchant.KqMerNo && m.RewardAmount == ActPrize && m.ActType == ActType);
+            string MerNo = merchant.KqMerNo;
+            if(string.IsNullOrEmpty(MerNo))
+            {
+                MerNo = "n" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
+            }
+            bool check = db.ActiveReward.Any(m => m.KqMerNo == MerNo && m.RewardAmount == ActPrize && m.ActType == ActType);
             bool check1 = db.ActiveReward.Any(m => m.KqSnNo == pos.PosSn && m.RewardAmount == ActPrize && m.ActType == ActType);
             if (!check && !check1)
             {
@@ -781,7 +786,7 @@ namespace MySystem
                     BrandId = pos.BrandId, //品牌
                     UserNav = ParentNav, //创客父级
                     DirectBuddyNo = merchant.UserId, //商户直属创客
-                    KqMerNo = merchant.KqMerNo, //渠道商户编号
+                    KqMerNo = MerNo, //渠道商户编号
                     KqSnNo = pos.PosSn, //渠道SN号
                     SnType = pos.PosSnType, //机具类型
                     SnApplyUserId = pos.BuyUserId, //机具申请创客
@@ -975,31 +980,6 @@ namespace MySystem
                                 AfterBalanceAmount = AfterBalanceAmount, //变更后余额
                             }).Entity;
                             db.SaveChanges();
-
-                            string dateString = pos.ActivationTime.Value.ToString("yyyyMMdd");
-                            string monthString = pos.ActivationTime.Value.ToString("yyyyMM");
-                            // 激活奖励列表
-                            List<string> dates = RedisDbconn.Instance.GetList<string>("ActiveRewardDay:" + GetUserId + ":" + pos.BrandId);
-                            if (!dates.Contains(dateString))
-                            {
-                                RedisDbconn.Instance.AddList("ActiveRewardDay:" + GetUserId + ":" + pos.BrandId, dateString);
-                            }
-                            RedisDbconn.Instance.AddNumber("ActiveRewardAmt:" + GetUserId + ":" + pos.BrandId + ":" + dateString, ActPrize);
-
-                            List<string> months = RedisDbconn.Instance.GetList<string>("ActiveRewardMonth:" + GetUserId + ":" + pos.BrandId);
-                            if (!months.Contains(monthString))
-                            {
-                                RedisDbconn.Instance.AddList("ActiveRewardMonth:" + GetUserId + ":" + pos.BrandId, monthString);
-                            }
-                            RedisDbconn.Instance.AddNumber("ActiveRewardAmt:" + GetUserId + ":" + pos.BrandId + ":" + monthString, ActPrize);
-
-                            // 激活奖励详情
-                            List<int> actPrizeList = RedisDbconn.Instance.GetList<int>("ActiveRewardDetail:" + GetUserId + ":" + pos.BrandId + ":" + dateString);
-                            if (!actPrizeList.Contains(pos.BindMerchantId))
-                            {
-                                RedisDbconn.Instance.AddList("ActiveRewardDetail:" + GetUserId + ":" + pos.BrandId + ":" + dateString, pos.BindMerchantId);
-                            }
-                            RedisDbconn.Instance.AddNumber("ActiveRewardAmt:mer:" + pos.BindMerchantId + ":" + pos.BrandId + ":" + dateString, ActPrize);
                         }
                     }
                 }
@@ -1151,26 +1131,6 @@ namespace MySystem
                                                 }).Entity;
                                                 db.SaveChanges();
 
-                                                string dateString = yesterday.ToString("yyyyMMdd");
-                                                string monthString = yesterday.ToString("yyyyMM");
-                                                // 开机奖励列表
-                                                List<string> dates = RedisDbconn.Instance.GetList<string>("OpenRewardDay:" + puser.Id + ":" + pos.BrandId);
-                                                if (!dates.Contains(dateString))
-                                                {
-                                                    RedisDbconn.Instance.AddList("OpenRewardDay:" + puser.Id + ":" + pos.BrandId, dateString);
-                                                }
-                                                RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + dateString, Prize);
-
-                                                List<string> months = RedisDbconn.Instance.GetList<string>("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId);
-                                                if (!months.Contains(monthString))
-                                                {
-                                                    RedisDbconn.Instance.AddList("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId, monthString);
-                                                }
-                                                RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + monthString, Prize);
-
-                                                // 开机奖励详情
-                                                RedisDbconn.Instance.AddList("OpenRewardDetail:" + puser.Id + ":" + pos.BrandId + ":" + dateString, detail);
-
                                                 Prize = 0;
                                             }
                                         }
@@ -1306,7 +1266,7 @@ namespace MySystem
                         int PosId = int.Parse(content);
                         Thread.Sleep(1000);
                         WebCMSEntities db = new WebCMSEntities();
-                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && m.CreditTrade >= 10000);
+                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && m.CreditTrade >= 10000 && m.BrandId != 14);
                         if (pos != null)
                         {
                             function.WriteLog("sn:" + pos.PosSn, "盟主开机奖励发放日志");

+ 4 - 4
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -788,10 +788,10 @@ namespace MySystem
             }
             DateTime TransferTime = pos.TransferTime == null ? DateTime.Now : pos.TransferTime.Value;
             int minute = 30;
-            if(pos.BrandId == 14)
-            {
-                minute = 0;
-            }
+            // if(pos.BrandId == 14)
+            // {
+            //     minute = 0;
+            // }
             if (pos.CreditTrade >= CheckMoney && pos.BuyUserId > 0 && pos.ActivationState == 0 && TransferTime.AddMinutes(-minute) < pos.BindingTime)
             {
                 pos.ActivationState = 1;