Bläddra i källkod

修复返现逻辑

lcl 1 år sedan
förälder
incheckning
ada9340838
3 ändrade filer med 24 tillägg och 11 borttagningar
  1. 18 9
      AppStart/Helper/Profit/ProfitHelper.cs
  2. 2 2
      AppStart/RedisDbconn.cs
  3. 4 0
      Startup.cs

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

@@ -267,6 +267,7 @@ namespace MySystem
                                                 }
                                                 if (GetMoney > minProfit)
                                                 {
+                                                    decimal TmpCurDivi = suborder.CurDivi;
                                                     suborder.CurDivi += GetMoney;
                                                     if (DiffMoney > 0)
                                                     {
@@ -277,14 +278,14 @@ namespace MySystem
                                                     {
                                                         string RefundNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
                                                         int Status = 1;
-                                                        if(order.PayMode == 1)
-                                                        {
-                                                            string result = AlipayFunction.Instance.Refund(suborder.SeoTitle, RefundNo, Math.Round(GetMoney, 2).ToString(), "门店消费补贴", merchantAdd.AlipayAuthToken);
-                                                        }
-                                                        else
-                                                        {
-                                                            Dictionary<string, string> dic = WeChatFunction.Instance.Refund(merchantAdd.SubMchid, Math.Round(GetMoney, 2), suborder.PayMoney, suborder.OrderNo, RefundNo, "门店消费补贴");
-                                                        }
+                                                        // if(order.PayMode == 1)
+                                                        // {
+                                                        //     string result = AlipayFunction.Instance.Refund(suborder.SeoTitle, RefundNo, Math.Round(GetMoney, 2).ToString(), "门店消费补贴", merchantAdd.AlipayAuthToken);
+                                                        // }
+                                                        // else
+                                                        // {
+                                                        //     Dictionary<string, string> dic = WeChatFunction.Instance.Refund(merchantAdd.SubMchid, Math.Round(GetMoney, 2), suborder.PayMoney, suborder.OrderNo, RefundNo, "门店消费补贴");
+                                                        // }
                                                         if(Status == 1)
                                                         {
                                                             db.ConsumerProfit.Add(new ConsumerProfit()
@@ -314,7 +315,15 @@ namespace MySystem
                                                     }
                                                     else
                                                     {
-                                                        RedisDbconn.Instance.DelFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
+                                                        suborder.CurDivi = TmpCurDivi;
+                                                        RedisDbconn.Instance.RemoveFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);                                                        
+                                                        ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
+                                                        if (editOrder != null)
+                                                        {
+                                                            editOrder.ReturnFlag = 0;
+                                                            editOrder.CurDivi = editOrder.MaxDivi;
+                                                            db.SaveChanges();
+                                                        }
                                                         OutCount += 1;
                                                     }
                                                     RedisDbconn.Instance.AddList("ConsumerOrdersSetDivi", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");

+ 2 - 2
AppStart/RedisDbconn.cs

@@ -146,9 +146,9 @@ namespace MySystem
         #endregion
 
         #region 移除列表对象
-        public long DelFromList(string key, object value, int count = 1)
+        public long RemoveFromList(string key, object value, int count = 1)
         {
-            return RedisHelper.LRem(key, count, value);
+            return csredis.LRem(key, count, value);
         }
         #endregion
 

+ 4 - 0
Startup.cs

@@ -182,6 +182,10 @@ namespace MySystem
                 // ProfitHelper.Instance.ReturnStat("157192", 2);
                 // ProfitHelper.Instance.ReturnStat("157193", 2);
                 // ProfitHelper.Instance.ReturnStat("157194", 2);
+                // ProfitHelper.Instance.ReturnStat("157195", 2);
+                // ProfitHelper.Instance.ReturnStat("157196", 2);
+                // ProfitHelper.Instance.ReturnStat("157197", 2);
+                // ProfitHelper.Instance.ReturnStat("157198", 2);
             }
             if(Library.ConfigurationManager.EnvironmentFlag == 2)
             {