Эх сурвалжийг харах

分段发送178天费率调升通知
盈利期交易打标记

lichunlei 2 жил өмнө
parent
commit
a343e309d6

+ 1 - 1
AppStart/Helper/SetDepositService.cs

@@ -43,7 +43,7 @@ namespace MySystem
                             RecordId = int.Parse(function.CheckInt(jsonObj["RecordId"].ToString()));
                         }
                         string OpMan = jsonObj["OpMan"].ToString();
-                        if(!string.IsNullOrEmpty(PosIds) && Kind > 0)
+                        if(!string.IsNullOrEmpty(PosIds))
                         {
                             List<int> ids = new List<int>();
                             string[] PosIdList = PosIds.Split(',');

+ 25 - 8
AppStart/Helper/SetFeeFlagService.cs

@@ -28,7 +28,7 @@ namespace MySystem
         {
             while (true)
             {
-                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 3)
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 4)
                 {
                     try
                     {
@@ -44,14 +44,31 @@ namespace MySystem
                             BrandIds.Add(4);
                             BrandIds.Add(5);
                             var date = DateTime.Now.AddDays(-178);
-                            var posList = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BindingTime <= date && m.BindingState == 1 && m.UpFeeFlag == 0 && BrandIds.Contains(m.BrandId)).ToList();
-                            //循环修改机具费率调升标记
-                            //统计需要推送消息的用户Id
-                            foreach (var item in posList)
+                            bool op = true;
+                            int StartId = 0;
+                            while(op)
                             {
-                                string info = "{\"RecordId\":\"\",\"PosId\":\"" + item.Id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"0\",\"OpMan\": \""+"系统"+"\"}";
-                                RedisDbconn.Instance.AddList("SetDepositQueue", info);
+                                var posList = db.PosMachinesTwo.Select(m => new { m.Id, m.Status, m.BindingState, m.BindingTime, m.UpFeeFlag, m.BrandId }).Where(m => m.Id > StartId && m.Status > -1 && m.BindingTime <= date && m.BindingState == 1 && m.UpFeeFlag == 0 && BrandIds.Contains(m.BrandId)).OrderBy(m => m.Id).Take(100).ToList();
+                                function.WriteLog(DateTime.Now.ToString(), "178天提前通知创客费率调升");
+                                function.WriteLog(posList.Count.ToString(), "178天提前通知创客费率调升");
+                                if(posList.Count > 0)
+                                {
+                                    //循环修改机具费率调升标记
+                                    //统计需要推送消息的用户Id
+                                    foreach (var item in posList)
+                                    {
+                                        function.WriteLog(item.Id.ToString(), "178天提前通知创客费率调升");
+                                        string info = "{\"RecordId\":\"\",\"PosId\":\"" + item.Id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"0\",\"OpMan\": \""+"系统"+"\"}";
+                                        RedisDbconn.Instance.AddList("SetDepositQueue", info);
+                                        StartId = item.Id;
+                                    }
+                                }
+                                else
+                                {
+                                    op = false;
+                                }
                             }
+                            db.Dispose();
                         }
                     }
                     catch (Exception ex)
@@ -59,7 +76,7 @@ namespace MySystem
                         function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "机具费率标记设置异常");
                     }
                 }
-                Thread.Sleep(1200000);
+                Thread.Sleep(800000);
             }
         }
     }

+ 5 - 6
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -196,12 +196,11 @@ namespace MySystem
                                         {
                                             ulong MerHelpFlag = 0;
                                             decimal DepositAmt = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                                            // if (pos.DownFeeFlag == 1)
-                                            // {
-                                            //     MerHelpFlag = 2;
-                                            // }
-                                            // else 
-                                            if (DepositAmt > 0 && pos.IsFirst == 1)
+                                            if (pos.DownFeeFlag == 1)
+                                            {
+                                                MerHelpFlag = 2;
+                                            }
+                                            else if (DepositAmt > 0 && pos.IsFirst == 1)
                                             {
                                                 int Days = int.Parse(RedisDbconn.Instance.Get<string>("pobjrule:" + pos.BrandId + ":HelpPolicy:Days")); //天数
                                                 if (pos.BindingTime != null)

+ 1 - 1
Startup.cs

@@ -211,7 +211,7 @@ namespace MySystem
             SetDepositService.Instance.Start(); //调整费率(通知、标记)
             SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
             SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
-            // SetFeeFlagService.Instance.Start(); //178天提前通知创客费率调升消息
+            SetFeeFlagService.Instance.Start(); //178天提前通知创客费率调升消息
 
             // StatService.Instance.StartPosActNum(); //实时统计激活数
             // StatService.Instance.StartNewUserNum(); //实时统计新增创客数