Browse Source

返运营中心额度备注调整

lcl 1 year ago
parent
commit
017720dd01
2 changed files with 24 additions and 7 deletions
  1. 19 6
      AppStart/Helper/AlipayPayBack2Service.cs
  2. 5 1
      Util/Utils.cs

+ 19 - 6
AppStart/Helper/AlipayPayBack2Service.cs

@@ -226,7 +226,7 @@ namespace MySystem
                             Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
                             if(pro.ProductId == 27)
                             {
-                                OperateReserveBackFor(db, user.Id, 40000, order.Id);
+                                OperateReserveBackFor(db, user.Id, 40000, order.Id, "购买大盟主");
                                 //自留券数量清除
                                 CancelStayCoupon(db, order.UserId, 7);
                                 //预设大盟主职级
@@ -245,7 +245,7 @@ namespace MySystem
                             Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
                             //自留券数量清除
                             CancelStayCoupon(db, order.UserId, 5);
-                            if (check) OperateReserveBackFor(db, user.Id, 10000, order.Id);
+                            if (check) OperateReserveBackFor(db, user.Id, 10000, order.Id, "购买小盟主");
                             //预设小盟主职级
                             LeaderPreUserLevel(db, order.UserId, 1);
                             AddLeader(db, order.UserId, 1);
@@ -375,8 +375,21 @@ namespace MySystem
                                 }
                                 if(TotalPrice > 0)
                                 {
-                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 2, 1, "商城购机", true, order.Id);
-                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 1, 2, "商城购机", true, order.Id);
+                                    // OperateAmountChange(opdb, LeaderUserId, TotalPrice, 2, 1, "商城购机", true, order.Id);
+                                    // OperateAmountChange(opdb, LeaderUserId, TotalPrice, 1, 2, "商城购机", true, order.Id);
+                                    OpAmountItem item = new OpAmountItem()
+                                    {
+                                        UserId = LeaderUserId,
+                                        OperateType = 0,
+                                        ChangeType = 14,
+                                        Remark = "购买小盟主",
+                                        UseAmount = TotalPrice,
+                                        UseValidForGetAmount = TotalPrice,
+                                        UseTotalAmt = TotalPrice,
+                                        DataType = 1,
+                                        DataId = order.Id,
+                                    };
+                                    RedisDbconn.Instance.AddList("OperateAmountRecordServiceQueue", item);
                                     LeaderUserId = 0;
                                     result = false;
                                 }
@@ -646,7 +659,7 @@ namespace MySystem
 
 
         //操作运营中心额度
-        public void OperateReserveBackFor(WebCMSEntities maindb, int UserId, decimal Money, int OrderId = 0)
+        public void OperateReserveBackFor(WebCMSEntities maindb, int UserId, decimal Money, int OrderId = 0, string Remark = "商城购机")
         {
             OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
             while(UserId > 0)
@@ -667,7 +680,7 @@ namespace MySystem
                                 UserId = UserId,
                                 OperateType = 0,
                                 ChangeType = 5,
-                                Remark = "商城购机",
+                                Remark = Remark,
                                 UseAmount = Money,
                                 UseValidForGetAmount = Money,
                                 UseTotalAmt = Money,

+ 5 - 1
Util/Utils.cs

@@ -218,9 +218,10 @@ namespace MySystem
         #endregion
 
 
-        #region 扣减/增加盟主储蓄金
+        #region 运营中心额度变更
         public void OperateAmountChange(OpModels.WebCMSEntities db, OpAmountItem param)
         {
+            function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(param), "运营中心额度变更测试");
             OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == param.UserId);
             if (account == null)
             {
@@ -255,6 +256,7 @@ namespace MySystem
                     }
                 }
             }
+            function.WriteLog("1", "运营中心额度变更测试");
             decimal AfterAmount = account.ValidForGetAmount + account.TotalAmt + account.ValidAmount;
             OpModels.AmountRecordNew add = db.AmountRecordNew.Add(new OpModels.AmountRecordNew()
             {
@@ -276,7 +278,9 @@ namespace MySystem
                 DataType = param.DataType,
                 DataId = param.DataId,
             }).Entity;
+            function.WriteLog("2", "运营中心额度变更测试");
             db.SaveChanges();
+            function.WriteLog("3\n\n", "运营中心额度变更测试");
         }
         #endregion
     }