DuGuYang 2 лет назад
Родитель
Сommit
35f60ae88a
38 измененных файлов с 417 добавлено и 229 удалено
  1. 2 0
      AppStart/ExcelHelper.cs
  2. 5 3
      Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs
  3. 10 5
      Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs
  4. 16 3
      Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs
  5. 18 5
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  6. 24 0
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  7. 66 160
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  8. 25 16
      Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs
  9. 20 2
      Areas/Admin/Controllers/MainServer/UsersController.cs
  10. 3 0
      Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs
  11. 10 2
      Areas/Admin/Controllers/OperateServer/SysAdminOperateController.cs
  12. 4 1
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs
  13. 3 0
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperatesController.cs
  14. 2 2
      Areas/Admin/Views/MainServer/PosMerchantInfoList/FirstPosIndex.cshtml
  15. 13 2
      Areas/Admin/Views/MainServer/SysTools/SetPosFee.cshtml
  16. 1 1
      Areas/Admin/Views/MainServer/ToChargeBackRecord/Edit.cshtml
  17. 1 1
      Areas/Admin/Views/MainServer/ToChargeBackRecordSub/Edit.cshtml
  18. 3 2
      Areas/Admin/Views/MainServer/ToChargeByStage/Add.cshtml
  19. 1 1
      Areas/Admin/Views/MainServer/ToChargeByStage/Edit.cshtml
  20. 6 0
      Areas/Admin/Views/MainServer/Users/CancleUsers.cshtml
  21. 23 14
      Controllers/HomeController.cs
  22. 3 0
      OpModels/AmountRecord.cs
  23. 3 0
      OpModels/PosCoupons.cs
  24. 4 1
      OpModels/PosMachines.cs
  25. 3 0
      OpModels/StoreActMerDaySummary.cs
  26. 3 0
      OpModels/StoreActMerMonthSummary.cs
  27. 3 0
      OpModels/StoreMachineApply.cs
  28. 3 0
      OpModels/StoreSendDaySummary.cs
  29. 3 0
      OpModels/StoreSendMonthSummary.cs
  30. 1 1
      OpModels/SysAdmin.cs
  31. 4 4
      OpModels/UserAccount.cs
  32. 96 0
      OpModels/WebCMSEntities.cs
  33. 5 0
      global.json
  34. 1 1
      wwwroot/layuiadmin/modules_main/StoreHouseAmountRecord_Admin.js
  35. 5 0
      wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js
  36. 21 0
      wwwroot/layuiadmin/modules_main/UsersCancle_Admin.js
  37. 1 1
      wwwroot/layuiadmin/modules_main/Users_Admin.js
  38. 2 1
      wwwroot/layuiadmin/modules_operate/AmountRecord_Admin.js

+ 2 - 0
AppStart/ExcelHelper.cs

@@ -73,6 +73,7 @@ namespace MySystem
                                     if (machinefor == null)
                                     {
                                         int BrandId = int.Parse(function.CheckInt(BrandIdString));
+                                        int CardType = BrandId == 14 ? 2 : 0;
                                         KqProducts kqProduct = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
                                         if (kqProduct.Id > 0)
                                         {
@@ -89,6 +90,7 @@ namespace MySystem
                                                 DeviceName = DeviceName,
                                                 DeviceKind = DeviceKind,
                                                 SourceStoreId = storefor.StoreId, //源仓库
+                                                CardType = CardType,
                                             }).Entity;
                                             store.ProductName = kqProduct.Name;
                                             store.BrandId = BrandId.ToString();

+ 5 - 3
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -204,7 +204,8 @@ namespace MySystem.Areas.Admin.Controllers
                 //实际押金
                 string SeoKeyword = dic["SeoKeyword"].ToString();
                 var brand = db.KqProducts.FirstOrDefault(m => m.Id == BId) ?? new KqProducts();
-                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
@@ -499,7 +500,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         #endregion
 
-       #region 导入数据
+        #region 导入数据
 
         public IActionResult Import(string right)
         {
@@ -908,7 +909,8 @@ namespace MySystem.Areas.Admin.Controllers
                 //实际押金
                 string SeoKeyword = dic["SeoKeyword"].ToString();
                 var brand = db.KqProducts.FirstOrDefault(m => m.Id == BId) ?? new KqProducts();
-                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }

+ 10 - 5
Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

@@ -265,7 +265,8 @@ namespace MySystem.Areas.Admin.Controllers
                 //实际押金
                 string SeoKeyword = pos.SeoKeyword;
                 var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
-                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
@@ -297,7 +298,8 @@ namespace MySystem.Areas.Admin.Controllers
                     var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
                     if (!string.IsNullOrEmpty(pos.SeoKeyword))
                     {
-                        if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
+                        // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
+                        if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(pos.SeoKeyword))
                         {
                             ReturnAmount += (decimal.Parse(pos.SeoKeyword) / 100);
                         }
@@ -373,7 +375,8 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //实际押金
                 string SeoKeyword = pos.SeoKeyword;
-                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
@@ -550,7 +553,8 @@ namespace MySystem.Areas.Admin.Controllers
                     var PosSn = item["PosSn"].ToString();
                     var SeoKeyword = item["SeoKeyword"].ToString();
                     var brand = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
-                    if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                    // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                    if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                     {
                         SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                     }
@@ -641,7 +645,8 @@ namespace MySystem.Areas.Admin.Controllers
                     var PosSn = item["PosSn"].ToString();
                     var SeoKeyword = item["SeoKeyword"].ToString();
                     var brand = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
-                    if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                    // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                    if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(SeoKeyword))
                     {
                         SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                     }

+ 16 - 3
Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs

@@ -334,15 +334,18 @@ namespace MySystem.Areas.Admin.Controllers
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             string condition = " where 1=1 and a.PayMode=1 and a.Sort=3";
+            string conditions = " and PayMode=1 and Sort=3";
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
                 condition += " and a.UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
+                conditions += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
                 condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                conditions += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             if (!string.IsNullOrEmpty(CreateDateData))
             {
@@ -350,15 +353,24 @@ namespace MySystem.Areas.Admin.Controllers
                 string start = datelist[0];
                 string end = datelist[1];
                 condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
+                conditions += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
             //状态
             if (!string.IsNullOrEmpty(StatusSelect))
             {
-                condition += " and a.Status=" + StatusSelect;
+                if (StatusSelect == "0")
+                {
+                    condition += " and a.Status=2";
+                }
+                else
+                {
+                    condition += " and a.Status=" + StatusSelect;
+                }
+                conditions += " and Status=" + StatusSelect;
             }
 
             var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreAmountRecord", Fields, "Id desc", "0", 1, 20000000, condition, "", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreAmountRecord", Fields, "Id desc", "0", 1, 20000000, conditions, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -368,12 +380,13 @@ namespace MySystem.Areas.Admin.Controllers
             }
             Ids = Ids.TrimEnd(',');
 
+            OtherMySqlConn.op("UPDATE PreAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
+            
             var Sql = "SELECT a.Id '记录ID',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现申请时间',(CASE WHEN a.Status=0 THEN '待处理' WHEN a.Status=2 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=-1 THEN '失败' ELSE '' end) '提现结果',b.RealName '创客真实姓名',b.MakerCode '创客编号',a.UseAmount '申请提现临额',b.CertId '身份证号',b.SettleBankCardNo '银行卡号',b.SettleBankName '银行名称',b.Mobile '手机号',(CASE WHEN a.AmountType=1 THEN '临额提现' ELSE '' end) '交易类型',null '是否成功(是、否)' FROM PreAmountRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
             var FileName = "小分仓临额提现提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
-            OtherMySqlConn.op("UPDATE PreAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
             AddSysLog(Ids, "PreAmountRecord", "ExportExcel");
             return "success";
         }

+ 18 - 5
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -642,7 +642,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
-         #region 快捷导出Excel
+        #region 快捷导出Excel
         public IActionResult QuickExportExcel(string right)
         {
             ViewBag.RightInfo = RightInfo;
@@ -657,15 +657,18 @@ namespace MySystem.Areas.Admin.Controllers
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             string condition = " where 1=1 and a.PayMode=1 and a.Sort=3";
+            string conditions = " and PayMode=1 and Sort=3";
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
                 condition += " and a.UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
+                conditions += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
                 condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                conditions += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             if (!string.IsNullOrEmpty(CreateDateData))
             {
@@ -673,15 +676,24 @@ namespace MySystem.Areas.Admin.Controllers
                 string start = datelist[0];
                 string end = datelist[1];
                 condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
+                conditions += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
             //状态
             if (!string.IsNullOrEmpty(StatusSelect))
             {
-                condition += " and a.Status=" + StatusSelect;
+                if (StatusSelect == "0")
+                {
+                    condition += " and a.Status=2";
+                }
+                else
+                {
+                    condition += " and a.Status=" + StatusSelect;
+                }
+                conditions += " and Status=" + StatusSelect;
             }
 
             var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000000, condition, "", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000000, conditions, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -691,12 +703,13 @@ namespace MySystem.Areas.Admin.Controllers
             }
             Ids = Ids.TrimEnd(',');
 
-            var Sql = "SELECT a.Id '记录ID',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现申请时间',(CASE WHEN a.Status=0 THEN '待处理' WHEN a.Status=2 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=-1 THEN '失败' ELSE '' end) '提现结果',b.RealName '创客真实姓名',b.MakerCode '创客编号',a.UseAmount '申请提现临额',b.CertId '身份证号',b.SettleBankCardNo '银行卡号',b.SettleBankName '银行名称',b.Mobile '手机号',(CASE WHEN a.AmountType=1 THEN '临额提现' ELSE '' end) '交易类型',null '是否成功(是、否)' FROM StoreHouseAmountRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
+            OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
+
+            var Sql = "SELECT a.Id '记录ID',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现申请时间',(CASE WHEN a.Status=0 THEN '待处理' WHEN a.Status=2 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=-1 THEN '失败' ELSE '' end) '提现结果',b.RealName '创客真实姓名',b.MakerCode '创客编号',FORMAT(a.UseAmount/2,2) '申请提现临额',b.CertId '身份证号',b.SettleBankCardNo '银行卡号',b.SettleBankName '银行名称',b.Mobile '手机号',(CASE WHEN a.AmountType=1 THEN '临额提现' ELSE '' end) '交易类型',null '是否成功(是、否)' FROM StoreHouseAmountRecord a LEFT JOIN Users b ON a.UserId=b.Id" + condition + "";
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
             var FileName = "分仓临额提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
-            OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
             AddSysLog(Ids, "StoreHouseAmountRecord", "QuickExportExcel");
             return "success";
         }

+ 24 - 0
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -565,6 +565,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = newdeposit - olddeposit,
                                 BeforeAmount = amount.ValidAmount,
                                 AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
+                                AfterTotalAmt = amount.TotalAmt,
+                                AfterValidForGetAmount = amount.ValidForGetAmount,
+                                AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit,
                             }).Entity;
                         }
                         if (newdeposit < olddeposit)
@@ -578,6 +581,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = olddeposit - newdeposit,
                                 BeforeAmount = amount.ValidAmount,
                                 AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
+                                AfterTotalAmt = amount.TotalAmt,
+                                AfterValidForGetAmount = amount.ValidForGetAmount,
+                                AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
                             }).Entity;
                         }
                         amount.ValidAmount -= sto.Deposit;
@@ -632,6 +638,9 @@ namespace MySystem.Areas.Admin.Controllers
                             UseAmount = newdeposit - olddeposit,
                             BeforeAmount = amount.ValidAmount,
                             AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
+                            AfterTotalAmt = amount.TotalAmt,
+                            AfterValidForGetAmount = amount.ValidForGetAmount,
+                            AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
                         }).Entity;
                     }
                     if (newdeposit < olddeposit)
@@ -645,6 +654,9 @@ namespace MySystem.Areas.Admin.Controllers
                             UseAmount = olddeposit - newdeposit,
                             BeforeAmount = amount.ValidAmount,
                             AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
+                            AfterTotalAmt = amount.TotalAmt,
+                            AfterValidForGetAmount = amount.ValidForGetAmount,
+                            AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
                         }).Entity;
                     }
                     amount.ValidAmount -= sto.Deposit;
@@ -2122,6 +2134,9 @@ namespace MySystem.Areas.Admin.Controllers
                                     UseAmount = deposit - tamount,
                                     BeforeAmount = TotalAmount,
                                     AfterAmount = TotalAmount + deposit - tamount,
+                                    AfterTotalAmt = userAmount.TotalAmt,
+                                    AfterValidForGetAmount = userAmount.ValidForGetAmount,
+                                    AfterValidAmount = userAmount.ValidAmount,
                                 }).Entity;
                             }
                             if (deposit < tamount)
@@ -2135,6 +2150,9 @@ namespace MySystem.Areas.Admin.Controllers
                                     UseAmount = tamount - deposit,
                                     BeforeAmount = TotalAmount,
                                     AfterAmount = TotalAmount + deposit - tamount,
+                                    AfterTotalAmt = userAmount.TotalAmt,
+                                    AfterValidForGetAmount = userAmount.ValidForGetAmount,
+                                    AfterValidAmount = userAmount.ValidAmount,
                                 }).Entity;
                             }
                             opdb.SaveChanges();
@@ -2342,6 +2360,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = deposit - tamount,
                                 BeforeAmount = TotalAmount,
                                 AfterAmount = TotalAmount - deposit + tamount,
+                                AfterTotalAmt = userAmount.TotalAmt,
+                                AfterValidForGetAmount = userAmount.ValidForGetAmount,
+                                AfterValidAmount = userAmount.ValidAmount,
                             }).Entity;
                         }
                         if (deposit < tamount)
@@ -2355,6 +2376,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = tamount - deposit,
                                 BeforeAmount = TotalAmount,
                                 AfterAmount = TotalAmount - deposit + tamount,
+                                AfterTotalAmt = userAmount.TotalAmt,
+                                AfterValidForGetAmount = userAmount.ValidForGetAmount,
+                                AfterValidAmount = userAmount.ValidAmount,
                             }).Entity;
                         }
                         opdb.SaveChanges();

+ 66 - 160
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -142,51 +142,12 @@ namespace MySystem.Areas.Admin.Controllers
             }
             decimal CreditTrade = 0;
             string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
-            string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
-            int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
-            bool check = spdb.TradeRecord.Any(m => m.Id > StartId && m.TradeSnNo == pos.PosSn);
+            string TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
+            int StartId = int.Parse(function.CheckInt(TradeRecordId));
+            bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
             if (check)
             {
-                if (pos.BrandId == 1)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 2)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 3)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 4 || pos.BrandId == 5)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 6)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 7)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "7" && m.TradeStatus == "00").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 8)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 9)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 10 || pos.BrandId == 11)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 12 || pos.BrandId == 13)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
-                }
+                CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
             }
@@ -414,48 +375,13 @@ namespace MySystem.Areas.Admin.Controllers
                 }
             }
             decimal CreditTrade = 0;
-            bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
+            string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
+            string TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
+            int StartId = int.Parse(function.CheckInt(TradeRecordId));
+            bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
             if (check)
             {
-                string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
-                string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
-                int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
-                if (pos.BrandId == 1)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 2)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 3)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 4 || pos.BrandId == 5)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 6)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 8)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 9)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 10 || pos.BrandId == 11)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 12 || pos.BrandId == 13)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
-                }
+                CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
             }
@@ -639,51 +565,12 @@ namespace MySystem.Areas.Admin.Controllers
             }
             decimal CreditTrade = 0;
             string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
-            string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
-            int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
-            bool check = spdb.TradeRecord.Any(m => m.Id > StartId && m.TradeSnNo == pos.PosSn);
+            string TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
+            int StartId = int.Parse(function.CheckInt(TradeRecordId));
+            bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
             if (check)
             {
-                if (pos.BrandId == 1)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 2)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 3)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 4 || pos.BrandId == 5)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 6)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 7)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "7" && m.TradeStatus == "00").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 8)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 9)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
-                }
-                else if (pos.BrandId == 10 || pos.BrandId == 11)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
-                }
-                else if (pos.BrandId == 12 || pos.BrandId == 13)
-                {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
-                }
+                CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
             }
@@ -903,7 +790,8 @@ namespace MySystem.Areas.Admin.Controllers
                         }
                         List<decimal> prizes = new List<decimal>();
                         decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                        if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 6 || pos.BrandId == 8 || pos.BrandId == 9)
+                        KqProducts product = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
+                        if (product.NoticeMoneyUnit == 2)
                         {
                             ActPrize = ActPrize / 100;
                         }
@@ -1417,7 +1305,8 @@ namespace MySystem.Areas.Admin.Controllers
             string tradeAmount = pos.CreditTrade.ToString();
             decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
             var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
-            if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(Deposit.ToString()))
+            // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(Deposit.ToString()))
+            if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(Deposit.ToString()))
             {
                 Deposit = Deposit / 100;
             }
@@ -1788,6 +1677,9 @@ namespace MySystem.Areas.Admin.Controllers
                             UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
                             BeforeAmount = TotalAmount,
                             AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
+                            AfterTotalAmt = opUserAccount.TotalAmt,
+                            AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
+                            AfterValidAmount = opUserAccount.ValidAmount,
                         }).Entity;
 
                         oldpos.OpReserve1 = 0;
@@ -1813,6 +1705,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = newpos.OpReserve3 + newpos.OpReserve2 + newpos.OpReserve1,
                                 BeforeAmount = TotalAmount,
                                 AfterAmount = TotalAmount + newpos.OpReserve3 + newpos.OpReserve2 + newpos.OpReserve1,
+                                AfterTotalAmt = opUserAccount.TotalAmt,
+                                AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
+                                AfterValidAmount = opUserAccount.ValidAmount,
                             }).Entity;
 
                             newpos.OpReserve1 = 0;
@@ -2047,6 +1942,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
                                 BeforeAmount = TotalAmount,
                                 AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
+                                AfterTotalAmt = opUserAccount.TotalAmt,
+                                AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
+                                AfterValidAmount = opUserAccount.ValidAmount,
                             }).Entity;
                         }
                         if (newpos.OpId == 0)
@@ -2306,6 +2204,9 @@ namespace MySystem.Areas.Admin.Controllers
                                 UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
                                 BeforeAmount = TotalAmount,
                                 AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
+                                AfterTotalAmt = opUserAccount.TotalAmt,
+                                AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
+                                AfterValidAmount = opUserAccount.ValidAmount,
                             }).Entity;
                         }
                         if (newpos.OpId == 0)
@@ -2554,6 +2455,9 @@ namespace MySystem.Areas.Admin.Controllers
                             UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
                             BeforeAmount = TotalAmount,
                             AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
+                            AfterTotalAmt = opUserAccount.TotalAmt,
+                            AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
+                            AfterValidAmount = opUserAccount.ValidAmount,
                         }).Entity;
                     }
                     if (newpos.OpId == 0)
@@ -4123,28 +4027,22 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
-        public string SetPosFeeDo(string PosSn, string FeeType)
+        public string SetPosFeeDo(string PosSn, int FeeType, int RecordFlag = 0)
         {
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
             }
-            if (string.IsNullOrEmpty(FeeType))
+            if (FeeType == 0)
             {
                 return "请输入选择费率";
             }
-            if (FeeType == "0")
+            string Fee = "0.63";
+            if(FeeType == 3)
             {
-                FeeType = "0.6";
+                Fee = "0.6";
             }
-            if (FeeType == "1")
-            {
-                FeeType = "0.63";
-            }
-
             string[] PosSnList = PosSn.Replace("\r", "").Split('\n');
-            var PosId = "";
-            var RecordId = "";
             var error = "";
             foreach (var item in PosSnList)
             {
@@ -4152,21 +4050,30 @@ namespace MySystem.Areas.Admin.Controllers
                 var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.SnId) ?? new PosMachinesTwo();
                 if (posInfo.Id > 0)
                 {
-                    var query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                    string RecordId = "";
+                    if(RecordFlag == 1)
                     {
-                        Sort = posInfo.BrandId,
-                        CreateDate = DateTime.Now,
-                        PosId = posInfo.Id,
-                        PosSn = posInfo.PosSn,
-                        PosUserId = posInfo.UserId,
-                        MerchantId = posInfo.BindMerchantId,
-                        UserId = posInfo.UserId,
-                        ChangeFee = decimal.Parse(FeeType),
-
-                    }).Entity;
-                    db.SaveChanges();
-                    PosId += posInfo.Id + ",";
-                    RecordId += query.Id + ",";
+                        decimal ChangeFee = decimal.Parse(Fee);
+                        PosMachinesFeeChangeRecord query = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == posInfo.Id && m.ChangeFee == ChangeFee && m.Status == 0);
+                        if(query == null)
+                        {
+                            query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                            {
+                                Sort = posInfo.BrandId,
+                                CreateDate = DateTime.Now,
+                                PosId = posInfo.Id,
+                                PosSn = posInfo.PosSn,
+                                PosUserId = posInfo.UserId,
+                            }).Entity;
+                            db.SaveChanges();
+                        }
+                        query.MerchantId = posInfo.BindMerchantId;
+                        query.UserId = posInfo.UserId;
+                        query.ChangeFee = ChangeFee;
+                        RecordId = query.Id.ToString();
+                    }
+                    string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + posInfo.Id + "\",\"Fee\": \"" + Fee + "\",\"Kind\": \"" + FeeType + "\",\"OpMan\": \"系统\"}";
+                    RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
                 }
                 else
                 {
@@ -4177,11 +4084,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "Warning|" + error;
             }
-            PosId = PosId.TrimEnd(',');
-            function.WriteLog(DateTime.Now.ToString() + ":请求参数," + PosId + ":" + SysUserName + "-" + SysRealName, "根据机具号设置费率");
-
-            string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + PosId + "\",\"Fee\": \"" + FeeType + "\",\"Kind\": \"2\",\"OpMan\": \"系统\"}";
-            RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
             return "success";
         }
         #endregion
@@ -5676,7 +5578,9 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and tb.BrandId=" + BrandId;
             }
 
-            DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
+            // DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
+
+            DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select NoticeMoneyUnit from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
             foreach (DataRow item in dt.Rows)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
@@ -5761,7 +5665,9 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and tb.BrandId=" + BrandId;
             }
-            var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
+            // var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
+
+            var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select NoticeMoneyUnit from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + "  and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
 
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
             var FileName = MakerCode + RealName + "直营团队数据记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

+ 25 - 16
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -120,6 +120,15 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //扣款状态
                 int Status = int.Parse(dic["Status"].ToString());
+                if (!string.IsNullOrEmpty(dic["UpdateDate"].ToString()))
+                {
+                    var updateDate = DateTime.Parse(dic["UpdateDate"].ToString());
+                    if (updateDate >= DateTime.Parse("2023-12-26 00:48:00") && updateDate <= DateTime.Parse("2023-12-26 00:48:59"))
+                    {
+                        Status = 4;
+                        if (Status == 4) dic["StatusName"] = "未实扣";
+                    }
+                }
                 if (Status == 0) dic["StatusName"] = "待扣款";
                 if (Status == 1) dic["StatusName"] = "已扣款";
                 if (Status == 2) dic["StatusName"] = "已退还";
@@ -247,28 +256,28 @@ namespace MySystem.Areas.Admin.Controllers
         public string Edit(ToChargeBackRecord data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
+            var editInfo = "";
             var info = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == data.Id) ?? new ToChargeBackRecord();
             if (info.ChargeAmount != data.ChargeAmount)
             {
-                if (info.Kind != data.Kind)
+                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == info.UserId) ?? new UserAccount();
+                editInfo = "变更前:" + "\n" + "创客预扣款:" + userAccount.ToChargeAmount + " " + "盟主预扣款:" + userAccount.LeaderToChargeAmount + " " + "合伙人预扣款:" + userAccount.OperateToChargeAmount + "\n";
+                if (info.ChargeAmount > data.ChargeAmount)
                 {
-                    var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == info.UserId) ?? new UserAccount();
-                    if (info.ChargeAmount > data.ChargeAmount)
-                    {
-                        if (data.Kind == 0) userAccount.ToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
-                        if (data.Kind == 1) userAccount.LeaderToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
-                        if (data.Kind == 2) userAccount.OperateToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
-                    }
-                    if (info.ChargeAmount < data.ChargeAmount)
-                    {
-                        if (data.Kind == 0) userAccount.ToChargeAmount += data.ChargeAmount - info.ChargeAmount;
-                        if (data.Kind == 1) userAccount.LeaderToChargeAmount += data.ChargeAmount - info.ChargeAmount;
-                        if (data.Kind == 2) userAccount.OperateToChargeAmount += data.ChargeAmount - info.ChargeAmount;
-                    }
+                    if (info.Kind == 0) userAccount.ToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
+                    if (info.Kind == 1) userAccount.LeaderToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
+                    if (info.Kind == 2) userAccount.OperateToChargeAmount -= info.ChargeAmount - data.ChargeAmount;
+                }
+                if (info.ChargeAmount < data.ChargeAmount)
+                {
+                    if (info.Kind == 0) userAccount.ToChargeAmount += data.ChargeAmount - info.ChargeAmount;
+                    if (info.Kind == 1) userAccount.LeaderToChargeAmount += data.ChargeAmount - info.ChargeAmount;
+                    if (info.Kind == 2) userAccount.OperateToChargeAmount += data.ChargeAmount - info.ChargeAmount;
                 }
+                editInfo = "变更后:" + "\n" + "创客预扣款:" + userAccount.ToChargeAmount + " " + "盟主预扣款:" + userAccount.LeaderToChargeAmount + " " + "合伙人预扣款:" + userAccount.OperateToChargeAmount + "\n";
             }
             Fields.Add("ChargeAmount", data.ChargeAmount); //待扣金额
-            Fields.Add("Kind", data.Kind); //待扣金额
+            // Fields.Add("Kind", data.Kind); //待扣金额
             Fields.Add("SeoTitle", SysUserName + "_" + SysRealName);
             Fields.Add("SeoDescription", data.SeoDescription);
             if (info.ChargeType != 124)
@@ -276,7 +285,7 @@ namespace MySystem.Areas.Admin.Controllers
                 Fields.Add("Remark", data.SeoDescription);
             }
             new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("ToChargeBackRecord", Fields, data.Id);
-            AddSysLog(data.Id.ToString(), "ToChargeBackRecord", "update");
+            AddSysLog(data.Id.ToString() + "\n" + editInfo, "ToChargeBackRecord", "update");
             db.SaveChanges();
 
             return "success";

+ 20 - 2
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -2638,7 +2638,8 @@ namespace MySystem.Areas.Admin.Controllers
                             var ThirdRealName = ""; //次次顶级创客姓名
                             var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId) ?? new PosMerchantInfo();
                             var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
-                            if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
+                            // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                            if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(pos.SeoKeyword))
                             {
                                 SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
                             }
@@ -2722,7 +2723,8 @@ namespace MySystem.Areas.Admin.Controllers
                             var ThirdRealName = ""; //次次顶级创客姓名
                             var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == mer.KqSnNo) ?? new PosMachinesTwo();
                             var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
-                            if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
+                            // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
+                            if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(pos.SeoKeyword))
                             {
                                 SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
                             }
@@ -2852,5 +2854,21 @@ namespace MySystem.Areas.Admin.Controllers
         }
         #endregion
 
+
+
+        #region 注销时间提前
+
+        public string SetLogoutDate(int Id)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            Fields.Add("LogOutDate", DateTime.Now.AddDays(-31));
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("Users", Fields, Id);
+            AddSysLog(Id, "Users", "SetLogoutDate");
+            return "success";
+        } 
+
+        #endregion
+
+
     }
 }

+ 3 - 0
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -403,6 +403,9 @@ namespace MySystem.Areas.Admin.Controllers
                         OperateType = 1,//增加
                         BeforeAmount = users.ValidAmount + users.TotalAmt + users.ValidForGetAmount,
                         AfterAmount = users.ValidAmount + users.TotalAmt + users.ValidForGetAmount + query.UseAmount,
+                        AfterTotalAmt = users.TotalAmt + TotalAmt,
+                        AfterValidForGetAmount = users.ValidForGetAmount + ValidForGetAmount,
+                        AfterValidAmount = users.ValidAmount + ValidAmount,
                         UseAmount = query.UseAmount,
                         UserId = query.UserId,
                         ApplyId = query.Id,

+ 10 - 2
Areas/Admin/Controllers/OperateServer/SysAdminOperateController.cs

@@ -96,8 +96,8 @@ namespace MySystem.Areas.Admin.Controllers
                 if (userInfo.UserType == 2) dic["Kind"] = "黄金合伙人";
                 if (userInfo.UserType == 3) dic["Kind"] = "钻石合伙人";
                 if (userInfo.UserType == 4) dic["Kind"] = "战略合伙人";
-                dic["MakerCode"] = sysAdmin.MakerCode;
-                dic["MakerName"] = sysAdmin.MakerName;
+                dic["MakerCode"] = userInfo.MakerCode;
+                dic["RealName"] = userInfo.RealName;
 
                 //登陆地址
                 dic["LoginUrl"] = OpHost + "Admin/" + dbconn.Encrypt3DES(sysAdmin.Sort.ToString(), "kxs12345").Replace("/", "%2F") + "/Login";
@@ -622,12 +622,16 @@ namespace MySystem.Areas.Admin.Controllers
             AmountRecord amountRecord = opdb.AmountRecord.Add(new AmountRecord()
             {
                 CreateDate = DateTime.Now,
+                SeoKeyword = Note,
                 SeoDescription = description,
                 UserId = sysAdmin.UserId, //运营中心Id
                 CreateMan = SysUserName + "-" + SysRealName,
                 UseAmount = decimal.Parse(OperationAmount),//操作金额
                 BeforeAmount = BeforeAmount,//使用前剩余额度
                 AfterAmount = AfterAmount,//使用后剩余额度
+                AfterTotalAmt = account.TotalAmt,
+                AfterValidForGetAmount = account.ValidForGetAmount,
+                AfterValidAmount = account.ValidAmount,
                 OperateType = OperateType,//操作类别
             }).Entity;
             opdb.SaveChanges();
@@ -686,12 +690,16 @@ namespace MySystem.Areas.Admin.Controllers
             AmountRecord amountRecord = opdb.AmountRecord.Add(new AmountRecord()
             {
                 CreateDate = DateTime.Now,
+                SeoKeyword = Note,
                 SeoDescription = description,
                 UserId = sysAdmin.UserId, //运营中心Id
                 CreateMan = SysUserName + "-" + SysRealName,
                 UseAmount = decimal.Parse(OperationAmount),//操作金额
                 BeforeAmount = BeforeAmount,//使用前剩余额度
                 AfterAmount = AfterAmount,//使用后剩余额度
+                AfterTotalAmt = account.TotalAmt,
+                AfterValidForGetAmount = account.ValidForGetAmount,
+                AfterValidAmount = account.ValidAmount,
                 OperateType = OperateType,//操作类别
             }).Entity;
             opdb.SaveChanges();

+ 4 - 1
Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs

@@ -348,7 +348,7 @@ namespace MySystem.Areas.Admin.Controllers
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);//设置提现记录为成功
                 Fields.Add("SeoTitle", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
-                new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("UserCashRecord", Fields, id);                
+                new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("UserCashRecord", Fields, id);
             }
             opdb.SaveChanges();
             return "success";
@@ -546,6 +546,9 @@ namespace MySystem.Areas.Admin.Controllers
                         UseAmount = TradeAmount, //变更金额
                         BeforeAmount = BeforeAmount, //变更前总金额
                         AfterAmount = AfterAmount, //变更后总金额
+                        AfterTotalAmt = account.TotalAmt,
+                        AfterValidForGetAmount = account.ValidForGetAmount,
+                        AfterValidAmount = account.ValidAmount,
                         OperateType = 1,
                     });
                     opdb.SaveChanges();

+ 3 - 0
Areas/Admin/Controllers/OperateServer/UserCashRecordOperatesController.cs

@@ -604,6 +604,9 @@ namespace MySystem.Areas.Admin.Controllers
                         UseAmount = TradeAmount, //变更金额
                         BeforeAmount = BeforeTotalAmount, //变更前总金额
                         AfterAmount = AfterTotalAmount, //变更后总金额
+                        AfterTotalAmt = account.TotalAmt,
+                        AfterValidForGetAmount = account.ValidForGetAmount,
+                        AfterValidAmount = account.ValidAmount,
                     });
                     opdb.SaveChanges();
                 }

+ 2 - 2
Areas/Admin/Views/MainServer/PosMerchantInfoList/FirstPosIndex.cshtml

@@ -63,12 +63,12 @@
             <div class="layui-card-body">
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                 <script type="text/html" id="table-list-tools">
-                    @if (RightInfo.Contains("," + right + "_open,"))
+                    @* @if (RightInfo.Contains("," + right + "_open,"))
                     {
                         @("{{#if (d.IsFirst == 0){ }}")
                         <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="SetFirstPos"><i class="layui-icon layui-icon-edit"></i>设为首台</a>
                         @("{{#} }}")
-                    }
+                    } *@
                 </script>
             </div>
         </div>

+ 13 - 2
Areas/Admin/Views/MainServer/SysTools/SetPosFee.cshtml

@@ -40,8 +40,19 @@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">费率类</label>
                                     <div class="layui-input-inline">
-                                        <select id="FeeType" name="FeeType" lay-search="" lay-filter="FeeType">
-                                            <option value="0" selected="selected">0.6</option>
+                                        <select id="FeeType" name="FeeType" lay-search="">
+                                            <option value="1" selected="selected">0.63+3</option>
+                                            <option value="2">0.63+0</option>
+                                            <option value="3">0.60+0</option>
+                                        </select>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">是否加记录</label>
+                                    <div class="layui-input-inline">
+                                        <select id="RecordFlag" name="RecordFlag" lay-search="">
+                                            <option value="0" selected="selected">否</option>
+                                            <option value="1">是</option>
                                         </select>
                                     </div>
                                 </div>

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeBackRecord/Edit.cshtml

@@ -66,7 +66,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">待扣类别</label>
                                 <div class="layui-input-inline">
-                                    <select id="Kind" name="Kind" lay-search="" readonly>
+                                    <select id="Kind" name="Kind" disabled>
                                         <option value="0">创客预扣款</option>
                                         <option value="1">盟主预扣款</option>
                                         <option value="2">运营中心预扣款</option>

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeBackRecordSub/Edit.cshtml

@@ -55,7 +55,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">扣款开始时间</label>
                                 <div class="layui-input-inline">
-                                    <input class="layui-input" type="text" id="StartDate" name="StartDate" readonly
+                                    <input class="layui-input" type="text" id="StartDate" name="StartDate" disabled
                                         value="@(editData.StartDate == null ? "" : editData.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss"))"
                                         lay-verify="" autocomplete="off" placeholder="请输入扣款开始时间">
                                 </div>

+ 3 - 2
Areas/Admin/Views/MainServer/ToChargeByStage/Add.cshtml

@@ -163,7 +163,7 @@
                 else {
                     $('#ChargeAmounts' + nums).val(leaveAmount);
                 }
-                var time = $('#StartDate').val() + '-20 00:00:00';
+                var time = $('#StartDate').val() + '-01 00:00:00';
 
                 var dateTime = new Date(time);
                 dateTime = dateTime.setMonth(dateTime.getMonth() + nums - 1);
@@ -218,7 +218,7 @@
                 else {
                     $('#ChargeAmounts' + nums).val(leaveAmount);
                 }
-                var time = $('#StartDate').val() + '-20 00:00:00';
+                var time = $('#StartDate').val() + '-01 00:00:00';
 
                 var dateTime = new Date(time);
                 dateTime = dateTime.setMonth(dateTime.getMonth() + nums - 1);
@@ -377,6 +377,7 @@
             laydate.render({
                 elem: '#StartDate',
                 type: 'month',
+                min: '@(DateTime.Now.AddMonths(1).ToString("yyyy-MM-01"))',
                 trigger: 'click'
             });
 

+ 1 - 1
Areas/Admin/Views/MainServer/ToChargeByStage/Edit.cshtml

@@ -46,7 +46,7 @@
                             <div class="layui-form-item">
                                 <label class="layui-form-label">待扣类别</label>
                                 <div class="layui-input-inline">
-                                    <select id="Kind" name="Kind" lay-search="" readonly>
+                                    <select id="Kind" name="Kind" disabled>
                                         <option value="0">创客预扣款</option>
                                         <option value="1">盟主预扣款</option>
                                         <option value="2">运营中心预扣款</option>

+ 6 - 0
Areas/Admin/Views/MainServer/Users/CancleUsers.cshtml

@@ -95,6 +95,12 @@
                 </div>
 
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">                
+                    @if (RightInfo.Contains("," + right + "_SetLogoutDate,"))
+                    {
+                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="SetLogoutDate"><i class="layui-icon layui-icon-edit"></i>注销时间提前</a>
+                    }
+                </script>
             </div>
         </div>
     </div>

+ 23 - 14
Controllers/HomeController.cs

@@ -179,20 +179,29 @@ namespace MySystem.Controllers
         public string test(string p)
         {
             
-            BsModels.WebCMSEntities db = new BsModels.WebCMSEntities();
-            var sysadmins = db.SysAdmin.ToList();
-            foreach(var sysadmin in sysadmins)
-            {
-                BsModels.SysAdmin edit = db.SysAdmin.FirstOrDefault(m => m.Id == sysadmin.Id);
-                if(edit != null)
-                {
-                    string pwd = function.get_Random(8);
-                    edit.Password = function.MD5_32(pwd);
-                    db.SaveChanges();
-                    function.WriteLog(edit.AdminName + ":" + pwd, "pwd");
-                }
-            }
-            db.Dispose();
+            // BsModels.WebCMSEntities db = new BsModels.WebCMSEntities();
+            // var sysadmins = db.SysAdmin.ToList();
+            // foreach(var sysadmin in sysadmins)
+            // {
+            //     BsModels.SysAdmin edit = db.SysAdmin.FirstOrDefault(m => m.Id == sysadmin.Id);
+            //     if(edit != null)
+            //     {
+            //         string pwd = function.get_Random(8);
+            //         edit.Password = function.MD5_32(pwd);
+            //         db.SaveChanges();
+            //         function.WriteLog(edit.AdminName + ":" + pwd, "pwd");
+            //     }
+            // }
+            // db.Dispose();
+
+            // WebCMSEntities db = new WebCMSEntities();
+            // List<string> nos = new List<string>();
+            // nos.Add("BC2024010814562964923941884");
+            // List<UserCashRecord> list = db.UserCashRecord.Where(m => nos.Contains(m.CashOrderNo)).ToList();
+            // foreach (UserCashRecord edit in list)
+            // {
+            //     RedisDbconn.Instance.AddList("JkCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
+            // }
             return "ok";
         }
 

+ 3 - 0
OpModels/AmountRecord.cs

@@ -23,5 +23,8 @@ namespace MySystem.OpModels
         public decimal UseAmount { get; set; }
         public int ApplyId { get; set; }
         public int UserId { get; set; }
+        public decimal AfterValidForGetAmount { get; set; }
+        public decimal AfterTotalAmt { get; set; }
+        public decimal AfterValidAmount { get; set; }
     }
 }

+ 3 - 0
OpModels/PosCoupons.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 4 - 1
OpModels/PosMachines.cs

@@ -9,13 +9,16 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
         public int PosId { get; set; }
         public int OpId { get; set; }
-        public int BrandId { get; set; }
     }
 }

+ 3 - 0
OpModels/StoreActMerDaySummary.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
OpModels/StoreActMerMonthSummary.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
OpModels/StoreMachineApply.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
OpModels/StoreSendDaySummary.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
OpModels/StoreSendMonthSummary.cs

@@ -9,8 +9,11 @@ namespace MySystem.OpModels
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 1 - 1
OpModels/SysAdmin.cs

@@ -17,6 +17,7 @@ namespace MySystem.OpModels
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
+        public int TotalMachineCount { get; set; }
         public string HeadPhoto { get; set; }
         public string OpCode { get; set; }
         public int StoreCount { get; set; }
@@ -30,6 +31,5 @@ namespace MySystem.OpModels
         public string RealName { get; set; }
         public string Password { get; set; }
         public string AdminName { get; set; }
-        public int TotalMachineCount { get; set; }
     }
 }

+ 4 - 4
OpModels/UserAccount.cs

@@ -17,16 +17,16 @@ namespace MySystem.OpModels
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
+        public decimal ValidForGetAmount { get; set; }
+        public decimal PosCouponApplyAmount { get; set; }
         public decimal WithdrawingAmount { get; set; }
         public decimal ValidAmount { get; set; }
-        public decimal TotalAmount { get; set; }
+        public decimal TotalAmt { get; set; }
         public decimal WithdrawAmount { get; set; }
         public int AccountStatus { get; set; }
         public decimal BalanceAmount { get; set; }
         public decimal FreezeAmount { get; set; }
-        public decimal TotalAmt { get; set; }
+        public decimal TotalAmount { get; set; }
         public int UserId { get; set; }
-        public decimal PosCouponApplyAmount { get; set; }
-        public decimal ValidForGetAmount { get; set; }
     }
 }

+ 96 - 0
OpModels/WebCMSEntities.cs

@@ -249,6 +249,18 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.AfterAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.AfterTotalAmt)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("使用后未使用额度");
+
+                entity.Property(e => e.AfterValidAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("使用后关联分仓额度");
+
+                entity.Property(e => e.AfterValidForGetAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("使用后可提现额度");
+
                 entity.Property(e => e.ApplyId).HasColumnType("int(11)");
 
                 entity.Property(e => e.BeforeAmount).HasColumnType("decimal(18,2)");
@@ -1582,6 +1594,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosCouponId).HasColumnType("int(11)");
@@ -1608,6 +1625,13 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<PosMachines>(entity =>
@@ -1618,6 +1642,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosId).HasColumnType("int(11)");
@@ -1644,6 +1673,13 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<PublicAccountSet>(entity =>
@@ -1987,6 +2023,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -2016,6 +2057,13 @@ namespace MySystem.OpModels
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreActMerMonthSummary>(entity =>
@@ -2028,6 +2076,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -2057,6 +2110,13 @@ namespace MySystem.OpModels
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreForOperate>(entity =>
@@ -2120,6 +2180,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.ErpCode)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -2160,9 +2225,16 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreSendDaySummary>(entity =>
@@ -2173,6 +2245,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -2204,6 +2281,13 @@ namespace MySystem.OpModels
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreSendMonthSummary>(entity =>
@@ -2214,6 +2298,11 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -2245,6 +2334,13 @@ namespace MySystem.OpModels
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<SysAdmin>(entity =>

+ 5 - 0
global.json

@@ -0,0 +1,5 @@
+{
+  "sdk": {
+    "version": "3.0.100"
+  }
+}

+ 1 - 1
wwwroot/layuiadmin/modules_main/StoreHouseAmountRecord_Admin.js

@@ -64,7 +64,7 @@ layui.config({
     $('#ExcelFile').change(function (e) {
         var files = e.target.files;
         excel.importExcel(files, {}, function (data) {
-            ExcelData = data[0].sheet1;
+            ExcelData = data[0].Sheet1;
         });
     });
 

+ 5 - 0
wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js

@@ -124,6 +124,11 @@ layui.config({
                     width: 200,
                     title: '提现单号',
                     sort: true
+                }, {
+                    field: 'UserId',
+                    width: 200,
+                    title: '创客Id',
+                    sort: true
                 }, {
                     field: 'MakerCode',
                     width: 200,

+ 21 - 0
wwwroot/layuiadmin/modules_main/UsersCancle_Admin.js

@@ -114,7 +114,9 @@ layui.config({
             , { field: 'AuthFlagName', width: 200, title: '实名状态', sort: true }
             , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
             , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
+            , { field: 'LogOutDate', width: 200, title: '注销时间', sort: true }
 
+            , { title: '操作', width: 200, align: 'left', toolbar: '#table-list-tools' }
         ]]
         , where: {
         }
@@ -130,6 +132,25 @@ layui.config({
     //监听工具条
     table.on('tool(LAY-list-manage)', function (obj) {
         var data = obj.data;
+        if (obj.event === 'SetLogoutDate') {
+            var index = layer.confirm('是否确定提前31天' + data.MakerCode + ',' + data.RealName + '的注销时间?', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/Users/SetLogoutDate?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == 'success') {
+                            parent.layer.msg('设置成功');
+                            table.reload('LAY-list-manage'); //数据刷新
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        }
     });
 
 

+ 1 - 1
wwwroot/layuiadmin/modules_main/Users_Admin.js

@@ -150,7 +150,7 @@ layui.config({
             , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
             , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
 
-            , { title: '操作', width: 2000, align: 'left', toolbar: '#table-list-tools' }
+            , { title: '操作', width: 2200, align: 'left', toolbar: '#table-list-tools' }
         ]]
         , where: {
             SelfId: SelfId,

+ 2 - 1
wwwroot/layuiadmin/modules_operate/AmountRecord_Admin.js

@@ -94,7 +94,8 @@ layui.config({
             , { field: 'OpCode', width: 105, title: '运营中心编号', sort: true }
             , { field: 'MakerCode', width: 105, title: '创客编号', sort: true }
             , { field: 'MakerName', width: 105, title: '创客姓名', sort: true }
-            , { field: 'SeoDescription', width: 100, title: '备注', sort: true }
+            , { field: 'SeoKeyword', width: 100, title: '备注', sort: true }
+            , { field: 'SeoDescription', width: 100, title: '描述', sort: true }
             , { field: 'UseAmount', width: 110, title: '交易金额', sort: true }
             , { field: 'BeforeAmount', width: 130, title: '交易前总金额', sort: true }
             , { field: 'AfterAmount', width: 130, title: '交易后总金额', sort: true }