Forráskód Böngészése

运营中心额度记录屏蔽老逻辑

lcl 1 éve
szülő
commit
fba9198594

+ 1 - 1
AppStart/Helper/AddActService.cs

@@ -75,7 +75,7 @@ namespace MySystem
                                 {
                                     RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
                                 }
-                                AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
+                                // AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
 
                                 //统计激活数
                                 RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");

+ 4 - 4
AppStart/Helper/AlipayPayBack2Service.cs

@@ -660,8 +660,8 @@ namespace MySystem
                         OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new OpModels.UserAccount();
                         if(account.TotalAmt >= Money)
                         {
-                            OperateAmountChange(db, UserId, Money, 2, 1, "商城购机", true, OrderId);
-                            OperateAmountChange(db, UserId, Money, 1, 2, "商城购机", true, OrderId);
+                            // OperateAmountChange(db, UserId, Money, 2, 1, "商城购机", true, OrderId);
+                            // OperateAmountChange(db, UserId, Money, 1, 2, "商城购机", true, OrderId);
                             OpAmountItem item = new OpAmountItem()
                             {
                                 UserId = UserId,
@@ -708,8 +708,8 @@ namespace MySystem
             }
             if(Money > 0)
             {
-                OperateAmountChange(db, UserId, Money, 2, 1, "商城购机", true, OrderId);
-                OperateAmountChange(db, UserId, Money, 1, 2, "商城购机", true, OrderId);
+                // OperateAmountChange(db, UserId, Money, 2, 1, "商城购机", true, OrderId);
+                // OperateAmountChange(db, UserId, Money, 1, 2, "商城购机", true, OrderId);
                 OpAmountItem item = new OpAmountItem()
                 {
                     UserId = UserId,

+ 42 - 42
AppStart/Helper/Operate/OperateAmountService.cs

@@ -39,50 +39,50 @@ namespace MySystem
                         int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString())); //1-机具,2-机具券
                         decimal Amount = decimal.Parse(function.CheckNum(jsonObj["Amount"].ToString()));
                         
-                        UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
-                        if (account == null)
-                        {
-                            account = db.UserAccount.Add(new UserAccount()
-                            {
-                                Id = UserId,
-                                UserId = UserId,
-                            }).Entity;
-                            db.SaveChanges();
-                        }
-                        decimal BeforeAmount = account.ValidAmount; //变更前总金额
-                        account.ValidAmount += Amount;
-                        decimal AfterAmount = account.ValidAmount; //变更后总金额
-                        AmountRecord add = db.AmountRecord.Add(new AmountRecord()
-                        {
-                            CreateDate = DateTime.Now,
-                            UpdateDate = DateTime.Now,
-                            OperateType = 1,
-                            AfterAmount = AfterAmount,
-                            AfterValidForGetAmount = account.ValidForGetAmount,
-                            AfterTotalAmt = account.TotalAmt,
-                            AfterValidAmount = account.ValidAmount,
-                            BeforeAmount = BeforeAmount,
-                            UseAmount = Amount,
-                            UserId = UserId,
-                            ApplyId = DataId,
-                            SeoDescription = Kind == 1 ? "机具激活返还" : "机具券兑换返还",
-                            Version = 3,
-                        }).Entity;
-                        db.SaveChanges();
+                        // UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+                        // if (account == null)
+                        // {
+                        //     account = db.UserAccount.Add(new UserAccount()
+                        //     {
+                        //         Id = UserId,
+                        //         UserId = UserId,
+                        //     }).Entity;
+                        //     db.SaveChanges();
+                        // }
+                        // decimal BeforeAmount = account.ValidAmount; //变更前总金额
+                        // account.ValidAmount += Amount;
+                        // decimal AfterAmount = account.ValidAmount; //变更后总金额
+                        // AmountRecord add = db.AmountRecord.Add(new AmountRecord()
+                        // {
+                        //     CreateDate = DateTime.Now,
+                        //     UpdateDate = DateTime.Now,
+                        //     OperateType = 1,
+                        //     AfterAmount = AfterAmount,
+                        //     AfterValidForGetAmount = account.ValidForGetAmount,
+                        //     AfterTotalAmt = account.TotalAmt,
+                        //     AfterValidAmount = account.ValidAmount,
+                        //     BeforeAmount = BeforeAmount,
+                        //     UseAmount = Amount,
+                        //     UserId = UserId,
+                        //     ApplyId = DataId,
+                        //     SeoDescription = Kind == 1 ? "机具激活返还" : "机具券兑换返还",
+                        //     Version = 3,
+                        // }).Entity;
+                        // db.SaveChanges();
 
-                        AmountChangeRecord amountChangeRecord = db.AmountChangeRecord.Add(new AmountChangeRecord()
-                        {
-                            AmountType = 2,//1 未使用额度 2 可提现额度 3 关联分仓额度
-                            CreateDate = DateTime.Now,
-                            Title = Kind == 1 ? "机具激活返还" : "机具券兑换返还",
-                            UserId = UserId, //运营中心Id
-                            BeforeAmount = BeforeAmount,//使用前剩余额度
-                            AfterAmount = AfterAmount,//使用后剩余额度
-                            ChangeAmount = Amount,//操作金额
-                            OperateType = 1,//操作类别
-                        }).Entity;
+                        // AmountChangeRecord amountChangeRecord = db.AmountChangeRecord.Add(new AmountChangeRecord()
+                        // {
+                        //     AmountType = 2,//1 未使用额度 2 可提现额度 3 关联分仓额度
+                        //     CreateDate = DateTime.Now,
+                        //     Title = Kind == 1 ? "机具激活返还" : "机具券兑换返还",
+                        //     UserId = UserId, //运营中心Id
+                        //     BeforeAmount = BeforeAmount,//使用前剩余额度
+                        //     AfterAmount = AfterAmount,//使用后剩余额度
+                        //     ChangeAmount = Amount,//操作金额
+                        //     OperateType = 1,//操作类别
+                        // }).Entity;
 
-                        db.Dispose();
+                        // db.Dispose();
 
                         OpAmountItem item = new OpAmountItem()
                         {

+ 4 - 4
AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs

@@ -185,10 +185,10 @@ namespace MySystem
                             {
                                 BackAccountFlag = true;
                                 decimal GetAmount = GetWithdrawMoney(parentUser) * order.BuyCount;
-                                //扣减备用金
-                                OperateAmountChange(opdb, parentUser.Id, GetAmount, 2, 1, "商城购机", true, order.Id);
-                                //返回到余额
-                                OperateAmountChange(opdb, parentUser.Id, GetAmount, 1, 2, "商城购机", true, order.Id);
+                                // //扣减备用金
+                                // OperateAmountChange(opdb, parentUser.Id, GetAmount, 2, 1, "商城购机", true, order.Id);
+                                // //返回到余额
+                                // OperateAmountChange(opdb, parentUser.Id, GetAmount, 1, 2, "商城购机", true, order.Id);
 
                                 OpAmountItem item = new OpAmountItem()
                                 {

+ 1 - 1
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -850,7 +850,7 @@ namespace MySystem
                 }
                 if(pos.CardType < 100)
                 {
-                    AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
+                    // AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
                     //统计激活数
                     RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
                     //运营中心额度变更

+ 26 - 26
AppStart/Helper/TimeOutPosChargeService.cs

@@ -250,29 +250,29 @@ namespace MySystem
                     {
                         if (opUserAccount.ValidForGetAmount >= record.ChargeAmount)
                         {
-                            var amoutRecord = opdb.AmountRecord.Add(new MySystem.OpModels.AmountRecord
-                            {
-                                CreateDate = DateTime.Now,
-                                UserId = items.UserId,
-                                SeoDescription = "运营中心预扣款",
-                                UseAmount = record.ChargeAmount,
-                                OperateType = 2,
-                                BeforeAmount = opUserAccount.ValidAmount + opUserAccount.TotalAmt + opUserAccount.ValidForGetAmount,
-                                AfterAmount = opUserAccount.ValidAmount + opUserAccount.TotalAmt + opUserAccount.ValidForGetAmount - record.ChargeAmount,
-                                Version = 2,
-                            }).Entity;
+                            // var amoutRecord = opdb.AmountRecord.Add(new MySystem.OpModels.AmountRecord
+                            // {
+                            //     CreateDate = DateTime.Now,
+                            //     UserId = items.UserId,
+                            //     SeoDescription = "运营中心预扣款",
+                            //     UseAmount = record.ChargeAmount,
+                            //     OperateType = 2,
+                            //     BeforeAmount = opUserAccount.ValidAmount + opUserAccount.TotalAmt + opUserAccount.ValidForGetAmount,
+                            //     AfterAmount = opUserAccount.ValidAmount + opUserAccount.TotalAmt + opUserAccount.ValidForGetAmount - record.ChargeAmount,
+                            //     Version = 2,
+                            // }).Entity;
 
-                            OpModels.AmountChangeRecord amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
-                            {
-                                AmountType = 2,
-                                CreateDate = DateTime.Now,
-                                Title = "运营中心预扣款",
-                                UserId = UserId, //运营中心Id
-                                BeforeAmount = opUserAccount.ValidForGetAmount,//使用前剩余额度
-                                AfterAmount = opUserAccount.ValidForGetAmount - record.ChargeAmount,//使用后剩余额度
-                                ChangeAmount = record.ChargeAmount,//操作金额
-                                OperateType = 2,//操作类别
-                            }).Entity;
+                            // OpModels.AmountChangeRecord amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
+                            // {
+                            //     AmountType = 2,
+                            //     CreateDate = DateTime.Now,
+                            //     Title = "运营中心预扣款",
+                            //     UserId = UserId, //运营中心Id
+                            //     BeforeAmount = opUserAccount.ValidForGetAmount,//使用前剩余额度
+                            //     AfterAmount = opUserAccount.ValidForGetAmount - record.ChargeAmount,//使用后剩余额度
+                            //     ChangeAmount = record.ChargeAmount,//操作金额
+                            //     OperateType = 2,//操作类别
+                            // }).Entity;
 
                             function.WriteLog("OperateToChargeAmount:" + userAccount.OperateToChargeAmount + ";ChargeAmount:" + record.ChargeAmount + ";", "扣款监听日志");
                             if (userAccount.OperateToChargeAmount >= record.ChargeAmount)
@@ -280,10 +280,10 @@ namespace MySystem
                                 function.WriteLog("ok", "扣款监听日志");
                                 userAccount.OperateToChargeAmount -= record.ChargeAmount;//扣减运营中心预扣款
                             }
-                            opUserAccount.ValidForGetAmount -= record.ChargeAmount;//扣减运营中心可提现余额
-                            amoutRecord.AfterValidForGetAmount = opUserAccount.ValidForGetAmount;
-                            amoutRecord.AfterTotalAmt = opUserAccount.TotalAmt;
-                            amoutRecord.AfterValidAmount = opUserAccount.ValidAmount;
+                            // opUserAccount.ValidForGetAmount -= record.ChargeAmount;//扣减运营中心可提现余额
+                            // amoutRecord.AfterValidForGetAmount = opUserAccount.ValidForGetAmount;
+                            // amoutRecord.AfterTotalAmt = opUserAccount.TotalAmt;
+                            // amoutRecord.AfterValidAmount = opUserAccount.ValidAmount;
 
                             OpAmountItem item = new OpAmountItem()
                             {