Bläddra i källkod

调整返现算法

lcl 1 år sedan
förälder
incheckning
79b69c4e46

+ 1 - 1
AppStart/Helper/AlipayPayBackService.cs

@@ -62,7 +62,7 @@ namespace MySystem
                                 order.MaxDivi = order.MaxDivi;
                                 db.SaveChanges();
                                 RedisDbconn.Instance.AddList("ConsumerOrders:Divi:1:List", order.Id.ToString());
-                                RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:1:" + order.MerchantId, order);
+                                // RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:1:" + order.MerchantId, order);
                                 // ConsumerOrdersStatService.Instance.Stat(order);
                             }
                         }

+ 9 - 4
AppStart/Helper/Profit/ProfitHelper.cs

@@ -199,6 +199,7 @@ namespace MySystem
                                 decimal DiviMoney = PayMoney * (1 - GetPercent - cusumerFeePercent - profitPercent);
                                 if (DiviMoney > 0)
                                 {
+                                    RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:" + PayMode + ":" + order.MerchantId, order);
                                     DiviMoney = DiviMoney / DiviPersons;
                                     List<int> deletes = new List<int>();
                                     long CurDiviPersons = DiviPersons;
@@ -209,15 +210,19 @@ namespace MySystem
                                     {
                                         CurDiviPersons = CurQueueCount;
                                     }
-                                    if(order.QueryCount < CurDiviPersons)
-                                    {
-                                        CurDiviPersons = order.QueryCount;
-                                    }
                                     if (DiviPersons < QueueCount)
                                     {
                                         QueueCount = DiviPersons;
                                     }
                                     decimal OtherMoney = 0; // 退款金额>最大退款金额-当前退款金额,次金额应归还给商户
+
+                                    // List<ConsumerOrders> orders = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId);
+                                    // foreach(ConsumerOrders sub in orders)
+                                    // {
+                                    //     function.WriteLog(sub.Id.ToString(), "返现队列");
+                                    // }
+                                    // function.WriteLog("\n\n", "返现队列");
+
                                     // 减去自己付的订单
                                     // CurDiviPersons = CurDiviPersons - 1;
                                     int OutCount = 0; // 出局人数

+ 1 - 1
AppStart/Helper/ProfitShareService.cs

@@ -58,7 +58,7 @@ namespace MySystem
                         if (order != null)
                         {
                             RedisDbconn.Instance.AddList("ConsumerOrders:Divi:" + order.PayMode + ":List", order.Id.ToString());
-                            RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:" + order.PayMode + ":" + order.MerchantId, order);
+                            // RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:" + order.PayMode + ":" + order.MerchantId, order);
                         }
                         db.Dispose();
                     }

+ 1 - 1
AppStart/Helper/WeChatPayBackService.cs

@@ -180,7 +180,7 @@ namespace MySystem
                                 else
                                 {
                                     RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:List", order.Id.ToString());
-                                    RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:2:" + order.MerchantId, order);
+                                    // RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:2:" + order.MerchantId, order);
                                 }
                             }
                         }

+ 15 - 8
Controllers/HomeController.cs

@@ -48,26 +48,33 @@ namespace MySystem.Controllers
             return View();
         }
 
-        public string test()
+        public string test(int id = 0)
         {
             string txt = "ok";
             // txt = WeChatFunction.Instance.QueryProfitShare("1646405429","4200001807202306098649105270","2023060910241258564572510");
             // ProfitHelper.Instance.ReturnStat(Id, 2);
             WebCMSEntities db = new WebCMSEntities();
             List<int> oids = new List<int>();
-            oids.Add(15);
-            oids.Add(16);
-            oids.Add(17);
-            oids.Add(18);
-            oids.Add(19);
-            oids.Add(20);
+            if(id > 0)
+            {
+                oids.Add(id);
+            }
+            else
+            {
+                oids.Add(15);
+                oids.Add(16);
+                oids.Add(17);
+                oids.Add(18);
+                oids.Add(19);
+                oids.Add(20);
+            }
             foreach(int oid in oids)
             {
                 ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == oid);
                 if(order != null)
                 {
                     RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:List", order.Id.ToString());
-                    RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:" + order.MerchantId, order);
+                    // RedisDbconn.Instance.AddList("ConsumerOrders:Divi:2:" + order.MerchantId, order);
                 }
             }
             db.Dispose();

+ 7 - 7
Startup.cs

@@ -171,14 +171,14 @@ namespace MySystem
             });
 
             //必须打开的
-            // MerchantConfirmService.Instance.Start(); //特约商户进件队列
-            // CheckWeChatSignService.Instance.Start(); //特约商户签约队列
-            // WeChatPayBackService.Instance.Start(); //微信支付回调队列
-            // WeChatPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
-            // ProfitHelper.Instance.StartActive(); //发放达标奖励队列
-            // ProfitHelper.Instance.StartListenTrade(); //支付宝返现队列
+            MerchantConfirmService.Instance.Start(); //特约商户进件队列
+            CheckWeChatSignService.Instance.Start(); //特约商户签约队列
+            WeChatPayBackService.Instance.Start(); //微信支付回调队列
+            WeChatPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
+            ProfitHelper.Instance.StartActive(); //发放达标奖励队列
+            ProfitHelper.Instance.StartListenTrade(); //支付宝返现队列
             ProfitHelper.Instance.StartListenWxTrade(); //微信返现队列
-            // ProfitShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现
+            ProfitShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现
             //必须打开的
         }
     }