Bläddra i källkod

盛付通420天费率加万2队列

lcl 9 månader sedan
förälder
incheckning
34b9689b27
2 ändrade filer med 33 tillägg och 7 borttagningar
  1. 32 7
      AppStart/Helper/SetSftFeeService.cs
  2. 1 0
      Startup.cs

+ 32 - 7
AppStart/Helper/SetSftFeeService.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 using System.Data;
 using System.Linq;
 using System.Threading;
-using MySystem.Models;
+using MySystem.PxcModels;
 using Library;
 
 namespace MySystem
@@ -38,12 +38,12 @@ namespace MySystem
                             function.WritePage("/SftFee/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
                             WebCMSEntities db = new WebCMSEntities();
                             var date = DateTime.Now.AddDays(-420);
-                            var checkDate = DateTime.Parse("2024-06-01 00:00:00").AddDays(-420);
+                            var checkDate = DateTime.Parse("2024-06-01 00:00:00").AddDays(-426);
                             bool op = true;
                             int StartId = 0;
                             while(op)
                             {
-                                var posList = db.PosMachinesTwo.Select(m => new { m.Id, m.Status, m.BindingState, m.BindingTime, m.UpFeeFlag, m.DownFeeFlag, m.BrandId }).Where(m => m.Id > StartId && m.Status > -1 && m.BindingTime <= date && m.BindingState == 1 && m.BrandId == 7 && m.BindingTime >= checkDate).OrderBy(m => m.Id).Take(100).ToList();
+                                var posList = db.PosMachinesTwo.Select(m => new { m.Id, m.Status, m.BindingState, m.BindingTime, m.UpFeeFlag, m.DownFeeFlag, m.DownFee, m.BrandId, m.IsSupplement }).Where(m => m.Id > StartId && m.Status > -1 && m.BindingTime <= date && m.BindingState == 1 && m.BrandId == 7 && m.IsSupplement == 0).OrderBy(m => m.Id).Take(100).ToList();
                                 function.WriteLog(DateTime.Now.ToString(), "420天盛付通费率加万2");
                                 function.WriteLog(posList.Count.ToString(), "420天盛付通费率加万2");
                                 if(posList.Count > 0)
@@ -52,10 +52,35 @@ namespace MySystem
                                     //统计需要推送消息的用户Id
                                     foreach (var item in posList)
                                     {
-                                        string Fee = "0.62";
-                                        function.WriteLog(item.Id.ToString(), "420天盛付通费率加万2");
-                                        string info = "{\"RecordId\":\"\",\"PosId\":\"" + item.Id + "\",\"Fee\": \"" + Fee + "\",\"Kind\": \"4\",\"OpMan\": \""+"系统"+"\"}";
-                                        RedisDbconn.Instance.AddList("SetDepositQueue", info);
+                                        if(item.BindingTime >= checkDate)
+                                        {
+                                            string Fee = "";
+                                            string AddRate = "";
+                                            if(item.UpFeeFlag == 1 && item.DownFeeFlag == 0)
+                                            {
+                                                Fee = "0.65";
+                                                AddRate = "3";
+                                            }
+                                            else if(item.UpFeeFlag == 1 && item.DownFeeFlag == 1 && item.DownFee == 0.63M)
+                                            {
+                                                Fee = "0.65";
+                                                AddRate = "0";
+                                            }
+                                            else if(item.UpFeeFlag == 1 && item.DownFeeFlag == 1 && item.DownFee == 0.6M)
+                                            {
+                                                Fee = "0.62";
+                                                AddRate = "0";
+                                            }
+                                            string info = "{\"RecordId\":\"\",\"PosId\":\"" + item.Id + "\",\"Fee\": \"" + Fee + "\",\"AddRate\": \"" + AddRate + "\",\"Kind\": \"4\",\"OpMan\": \"系统\"}";
+                                            function.WriteLog(info, "420天盛付通费率加万2");
+                                            RedisDbconn.Instance.AddList("SetDepositQueue", info);
+                                            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == item.Id);
+                                            if(pos != null)
+                                            {
+                                                pos.IsSupplement = 1;
+                                                db.SaveChanges();
+                                            }
+                                        }
                                         StartId = item.Id;
                                     }
                                 }

+ 1 - 0
Startup.cs

@@ -152,6 +152,7 @@ namespace MySystem
                 SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
                 SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
                 ChangePosFeeQueue.Instance.StartEverTime(); //设置服务费
+                SetSftFeeService.Instance.Start(); //盛付通420天费率加万2
             }
         }