Browse Source

Merge branch 'feature-dgy-创客预扣款导出' into feature-dgy-后台测试

# Conflicts:
#	Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
DuGuYang 3 years ago
parent
commit
431fdde1fa
42 changed files with 639 additions and 2024 deletions
  1. 18 17
      Areas/Admin/Controllers/BsServer/AdvertismentController.cs
  2. 5 0
      Areas/Admin/Controllers/MainServer/ActiveRewardController.cs
  3. 6 119
      Areas/Admin/Controllers/MainServer/OrdersController.cs
  4. 2 64
      Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs
  5. 14 9
      Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs
  6. 0 115
      Areas/Admin/Controllers/MainServer/SetMerchantTypeRecordController.cs
  7. 3 63
      Areas/Admin/Controllers/MainServer/StoreBalanceController.cs
  8. 1 63
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  9. 60 122
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  10. 74 128
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  11. 67 1
      Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs
  12. 5 0
      Areas/Admin/Controllers/MainServer/TradeRecordController.cs
  13. 31 18
      Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
  14. 31 248
      Areas/Admin/Controllers/MainServer/UserCashRecordController.cs
  15. 5 0
      Areas/Admin/Controllers/OperateServer/AmountRecordOperateController.cs
  16. 7 2
      Areas/Admin/Controllers/OperateServer/UserAccountRecordOperateController.cs
  17. 5 0
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs
  18. 5 0
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperatesController.cs
  19. 1 1
      Areas/Admin/Controllers/SpServer/SpTradeRecordController.cs
  20. 5 6
      Areas/Admin/Views/BsServer/Advertisment/Add.cshtml
  21. 4 5
      Areas/Admin/Views/BsServer/Advertisment/Edit.cshtml
  22. 0 17
      Areas/Admin/Views/BsServer/Advertisment/Index.cshtml
  23. 26 0
      Areas/Admin/Views/MainServer/LeaderReserveRecord/Index.cshtml
  24. 0 3
      Areas/Admin/Views/MainServer/Orders/Return.cshtml
  25. 0 134
      Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml
  26. 26 24
      Areas/Admin/Views/MainServer/StoreHouse/Stat.cshtml
  27. 19 31
      Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml
  28. 21 25
      Areas/Admin/Views/MainServer/SysTools/SetMerAgent.cshtml
  29. 0 9
      Areas/Admin/Views/MainServer/SysTools/TransferPosCoupon.cshtml
  30. 3 0
      Areas/Admin/Views/MainServer/ToChargeBackRecord/Index.cshtml
  31. 1 1
      Areas/Admin/Views/MainServer/UserAccountRecord/Index.cshtml
  32. 11 35
      wwwroot/layuiadmin/modules/Advertisment_Admin.js
  33. 9 34
      wwwroot/layuiadmin/modules_main/Orders_Admin.js
  34. 10 35
      wwwroot/layuiadmin/modules_main/PreCardAmountRecord_Admin.js
  35. 0 409
      wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js
  36. 77 102
      wwwroot/layuiadmin/modules_main/StoreBalance_Admin.js
  37. 10 35
      wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js
  38. 10 35
      wwwroot/layuiadmin/modules_main/StoreHouseStat_Admin.js
  39. 40 12
      wwwroot/layuiadmin/modules_main/ToChargeBackRecord_Admin.js
  40. 9 34
      wwwroot/layuiadmin/modules_main/UserAccountRecord_Admin.js
  41. 9 34
      wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js
  42. 9 34
      wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

+ 18 - 17
Areas/Admin/Controllers/BsServer/AdvertismentController.cs

@@ -32,12 +32,11 @@ namespace MySystem.Areas.Admin.Controllers
         /// 根据条件查询广告位列表
         /// </summary>
         /// <returns></returns>
-        public IActionResult Index(Advertisment data, string right, string CurColId)
+        public IActionResult Index(Advertisment data, string right)
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
             ViewBag.SysUserName = SysUserName;
-            ViewBag.CurColId = CurColId;
 
             string Condition = "";
             Condition += "Title:\"" + data.Title + "\",";
@@ -59,22 +58,17 @@ namespace MySystem.Areas.Admin.Controllers
         /// 广告位列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(Advertisment data, string CurColId, int page = 1, int limit = 30)
+        public JsonResult IndexData(Advertisment data, int page = 1, int limit = 30)
         {
-            Dictionary<string, string> ColDic = new DictionaryClass().getColDic(CurColId);
+            Dictionary<string, string> ColDic = new DictionaryClass().getColDic("003");
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("Title", "2"); //标题
-            string condition = " and ColId like '" + CurColId + "%'";
-            // Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit, condition);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
                 dic["ColId"] = new DictionaryClass().getDictionaryNameByKey(ColDic, dic["ColId"].ToString());
-                int Status = int.Parse(dic["Status"].ToString());
-                if (Status == 0) dic["StatusName"] = "已下架";
-                if (Status == 1) dic["StatusName"] = "已上架";
             }
             return Json(obj);
         }
@@ -87,12 +81,11 @@ namespace MySystem.Areas.Admin.Controllers
         /// 增加或修改广告位信息
         /// </summary>
         /// <returns></returns>
-        public IActionResult Add(string right, string CurColId)
+        public IActionResult Add()
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.SysUserName = SysUserName;
-            ViewBag.CurColId = CurColId;
 
             return View();
         }
@@ -106,7 +99,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpPost]
-        public string Add(Advertisment data, string CurColId = "")
+        public string Add(Advertisment data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Fields.Add("Title", data.Title); //标题
@@ -121,6 +114,8 @@ namespace MySystem.Areas.Admin.Controllers
             AddSysLog(data.Id.ToString(), "Advertisment", "add");
             bsdb.SaveChanges();
 
+            SetRedis(data.ColId, Id);
+
             return "success";
         }
 
@@ -132,12 +127,11 @@ namespace MySystem.Areas.Admin.Controllers
         /// 增加或修改广告位信息
         /// </summary>
         /// <returns></returns>
-        public IActionResult Edit(string right, string CurColId, int Id = 0)
+        public IActionResult Edit(int Id = 0)
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.SysUserName = SysUserName;
-            ViewBag.CurColId = CurColId;
 
             Advertisment editData = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id) ?? new Advertisment();
             ViewBag.data = editData;
@@ -153,7 +147,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpPost]
-        public string Edit(Advertisment data, string CurColId = "")
+        public string Edit(Advertisment data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Fields.Add("Title", data.Title); //标题
@@ -167,6 +161,8 @@ namespace MySystem.Areas.Admin.Controllers
             AddSysLog(data.Id.ToString(), "Advertisment", "update");
             bsdb.SaveChanges();
 
+            SetRedis(data.ColId, data.Id);
+
             return "success";
         }
 
@@ -187,11 +183,12 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 string ColId = "";
                 Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == id);
-                if (ad != null)
+                if(ad != null)
                 {
                     ColId = ad.ColId;
                 }
                 new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Delete("Advertisment", id);
+                SetRedis(ColId);
             }
             bsdb.SaveChanges();
 
@@ -257,6 +254,10 @@ namespace MySystem.Areas.Admin.Controllers
 
             AddSysLog(Id.ToString(), "Advertisment", "sort");
             Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id);
+            if(ad != null)
+            {
+                SetRedis(ad.ColId);
+            }
             return "success";
         }
         #endregion

+ 5 - 0
Areas/Admin/Controllers/MainServer/ActiveRewardController.cs

@@ -163,6 +163,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/ActiveReward/", "ActiveReward" + BrandId + ".txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/ActiveReward/", "ActiveReward" + BrandId + ".txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

+ 6 - 119
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -793,7 +793,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SnNos", "2"); //SN编号
             Fields.Add("TopUserId", "0");
 
-            string condition = " and Status>=-1";
+            string condition = " and Status>-1";
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
@@ -812,12 +812,12 @@ namespace MySystem.Areas.Admin.Controllers
             //仓库编号
             if (!string.IsNullOrEmpty(StoreIdStoreNo))
             {
-                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+                condition += " and StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
             }
             //仓库名称
             if (!string.IsNullOrEmpty(StoreIdStoreName))
             {
-                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
+                condition += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
             }
             //退款状态
             if (!string.IsNullOrEmpty(RefundStatusSelect))
@@ -1062,7 +1062,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SnNos", "2"); //SN编号
             Fields.Add("TopUserId", "0");
 
-            string condition = " and Status>=-1";
+            string condition = " and Status>-1";
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
@@ -1081,12 +1081,12 @@ namespace MySystem.Areas.Admin.Controllers
             //仓库编号
             if (!string.IsNullOrEmpty(StoreIdStoreNo))
             {
-                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+                condition += " and StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
             }
             //仓库名称
             if (!string.IsNullOrEmpty(StoreIdStoreName))
             {
-                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
+                condition += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
             }
             //退款状态
             if (!string.IsNullOrEmpty(RefundStatusSelect))
@@ -1276,119 +1276,6 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
-        #region 快捷导出Excel
-        public IActionResult QuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string QuickExportExcelDo(string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData)
-        {
-
-            string SqlString = " where 1=1 and a.Status>=-1";
-            //创客编号
-            if (!string.IsNullOrEmpty(UserIdMakerCode))
-            {
-                SqlString += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-            }
-            //创客真实姓名
-            if (!string.IsNullOrEmpty(UserIdRealName))
-            {
-                SqlString += " and a.UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
-            }
-            //支付方式
-            if (!string.IsNullOrEmpty(PayModeSelect))
-            {
-                SqlString += " and a.PayMode=" + PayModeSelect;
-            }
-            //仓库编号
-            if (!string.IsNullOrEmpty(StoreIdStoreNo))
-            {
-                SqlString += " and a.StoreId in (select StoreId from StoreForCode where StoreNo='" + StoreIdStoreNo + "')";
-            }
-            //仓库名称
-            if (!string.IsNullOrEmpty(StoreIdStoreName))
-            {
-                SqlString += " and a.StoreId in (select Id from StoreHouse where StoreName='" + StoreIdStoreName + "')";
-            }
-            //退款状态
-            if (!string.IsNullOrEmpty(RefundStatusSelect))
-            {
-                SqlString += " and a.RefundStatus=" + RefundStatusSelect;
-            }
-            //提货类型
-            if (!string.IsNullOrEmpty(DeliveryTypeSelect))
-            {
-                SqlString += " and a.DeliveryType=" + DeliveryTypeSelect;
-            }
-            //发货状态
-            if (!string.IsNullOrEmpty(SendStatusSelect))
-            {
-                SqlString += " and a.SendStatus=" + SendStatusSelect;
-            }
-            //商品名称
-            if (!string.IsNullOrEmpty(ProductIdSelect))
-            {
-                SqlString += " and a.ProductId=" + ProductIdSelect;
-            }
-            //仓库类型
-            if (!string.IsNullOrEmpty(StoreTypeSelect))
-            {
-                SqlString += " and a.StoreType=" + StoreTypeSelect;
-            }
-            //仓库归属创客编号
-            if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
-            {
-                SqlString += " and a.StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
-            }
-            //仓库归属创客真实姓名
-            if (!string.IsNullOrEmpty(StoreUserIdRealName))
-            {
-                SqlString += " and a.StoreUserId in (select StoreUserId from UserForRealName where RealName='" + StoreUserIdRealName + "')";
-            }
-            //支付状态
-            if (!string.IsNullOrEmpty(PayStatusSelect))
-            {
-                SqlString += " and a.PayStatus=" + PayStatusSelect;
-            }
-            //支付时间
-            if (!string.IsNullOrEmpty(PayDateData))
-            {
-                string[] datelist = PayDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                SqlString += " and a.PayDate>='" + start + " 00:00:00' and a.PayDate<='" + end + " 23:59:59'";
-            }
-            //下单时间
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                SqlString += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
-            }
-            //发货时间
-            if (!string.IsNullOrEmpty(SendDateData))
-            {
-                string[] datelist = SendDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                SqlString += " and a.SendDate>='" + start + " 00:00:00' and a.SendDate<='" + end + " 23:59:59'";
-            }
-            var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客真实姓名',a.OrderNo '订单号',a.Mobile '手机号',a.RealName '姓名',a.TotalPrice '总价',a.Areas '所在地区',a.Address '详细地址',a.ErpName '物流名称',a.ErpCode '运单号',DATE_FORMAT(a.SendDate,'%Y-%m-%d %H:%i:%s') '发货时间',(CASE WHEN a.PayMode=1 THEN '支付宝' WHEN a.PayMode=2 THEN '微信' WHEN a.PayMode=3 THEN '账户余额' ELSE '' end) '支付方式',DATE_FORMAT(a.PayDate,'%Y-%m-%d %H:%i:%s') '支付时间',a.TradeNo '支付交易号',c.StoreNo '仓库编号',c.StoreName '仓库名称',(CASE WHEN a.RefundStatus=0 THEN '未退款' WHEN a.RefundStatus=1 THEN '已退款' end) '退款状态',(CASE WHEN a.DeliveryType=1 THEN '邮寄到付' WHEN a.DeliveryType=2 THEN '上门自提' ELSE '' end) '提货类型',(CASE WHEN a.SendStatus=0 THEN '未发货' WHEN a.SendStatus=1 THEN '已发货' WHEN a.SendStatus=2 THEN '已退货' ELSE '' end) '发货状态',d.ProductName '商品名称',a.BuyCount '下单数量',d.TotalPrice '商品单价',d.NormDetail '商品规格',a.StoreContact '仓库联系人',(CASE WHEN a.StoreType=0 THEN '总仓' WHEN a.StoreType=1 THEN '分仓' ELSE '' end) '仓库类型',e.MakerCode '仓库归属创客编号',e.RealName '仓库归属创客姓名',(CASE WHEN a.PayStatus=0 THEN '未支付' WHEN a.PayStatus=1 THEN '支付成功' WHEN a.PayStatus=2 THEN '支付失败' WHEN a.PayStatus=3 THEN '支付锁定中' WHEN a.PayStatus=4 THEN '支付处理中' ELSE '' end) '支付状态',a.Remark '订单备注' FROM Orders a LEFT JOIN Users b ON a.UserId=b.Id LEFT JOIN StoreHouse c ON a.StoreId=c.Id LEFT JOIN OrderProduct d ON a.Id=d.OrderId LEFT JOIN Users e ON a.StoreUserId=e.Id" + SqlString + "";
-            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);
-            return "success";
-        }
-        #endregion
-
-
         #region 查询直推奖励100
 
         public Dictionary<string, string> Prize100(int Id)

+ 2 - 64
Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs

@@ -312,7 +312,7 @@ namespace MySystem.Areas.Admin.Controllers
 
             result.Add("Fields", ReturnFields);
             OtherMySqlConn.op("UPDATE PreAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
-            AddSysLog(Ids, "PreAmountRecord", "ExportExcel");
+            AddSysLog("0", "PreAmountRecord", "ExportExcel");
             return Json(result);
         }
 
@@ -320,68 +320,6 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
-         #region 快捷导出Excel
-        public IActionResult QuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string QuickExportExcelDo(string UserIdRealName, string UserIdMakerCode, string CreateDateData, string StatusSelect)
-        {
-
-            Dictionary<string, string> Fields = new Dictionary<string, string>();
-            string condition = " where 1=1 and a.PayMode=1 and a.Sort=3";
-            //创客真实姓名
-            if (!string.IsNullOrEmpty(UserIdRealName))
-            {
-                condition += " and a.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 + "')";
-            }
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
-            }
-            //状态
-            if (!string.IsNullOrEmpty(StatusSelect))
-            {
-                condition += " and a.Status=" + StatusSelect;
-            }
-
-            var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreAmountRecord", Fields, "Id desc", "0", 1, 20000000, condition, "", false);
-            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
-            foreach (Dictionary<string, object> dic in diclist)
-            {
-                //记录Id
-                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
-                Ids += Id + ",";
-            }
-            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) '交易类型' 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";
-        }
-        #endregion
-
-
-
         #region 小分仓银行卡临额提现记录结果导入Excel
         /// <summary>
         /// 小分仓银行卡临额提现记录结果导入Excel
@@ -438,7 +376,7 @@ namespace MySystem.Areas.Admin.Controllers
                     db.SaveChanges();
                 }
             }
-            AddSysLog("0", "PreCardAmountRecord", "QuickExportExcel");
+            AddSysLog("0", "PreCardAmountRecord", "Import");
             return "success";
         }
         #endregion

+ 14 - 9
Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs

@@ -96,34 +96,39 @@ namespace MySystem.Areas.Admin.Controllers
             if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                var start = Convert.ToDateTime(datelist[0]).ToString("yyyyMMdd");
-                var end = Convert.ToDateTime(datelist[1]).ToString("yyyyMMdd");
-                var check = db.ProfitRewardRecord.Any(m => Convert.ToInt32(m.SeoTitle) >= Convert.ToInt32(start) && m.BrandId == Convert.ToInt32(BrandId));
-                var checks = db.ProfitRewardRecord.Any(m => Convert.ToInt32(m.SeoTitle) <= Convert.ToInt32(end) && m.BrandId == Convert.ToInt32(BrandId));
+                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
+                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
+                var check = db.ProfitRewardRecord.Any(m => m.CreateDate >= start && m.BrandId == Convert.ToInt32(BrandId));
+                var checks = db.ProfitRewardRecord.Any(m => m.CreateDate <= end && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {
-                    var sId = db.ProfitRewardRecord.Where(m => Convert.ToInt32(m.SeoTitle) >= Convert.ToInt32(start)  && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
+                    var sId = db.ProfitRewardRecord.Where(m => m.CreateDate >= start  && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
                     condition += "  and Id >=" + sId;
                 }
                 if (checks)
                 {
-                    var eId = db.ProfitRewardRecord.Where(m => Convert.ToInt32(m.SeoTitle) <= Convert.ToInt32(end) && m.BrandId == Convert.ToInt32(BrandId)).Max(m => m.Id);
+                    var eId = db.ProfitRewardRecord.Where(m => m.CreateDate <= end && m.BrandId == Convert.ToInt32(BrandId)).Max(m => m.Id);
                     condition += " and Id <=" + eId;
                 }
             }
             else
             {
-                var start = DateTime.Now.AddMonths(-1).ToString("yyyyMM") + "01";
-                var check = db.ProfitRewardRecord.Any(m => Convert.ToInt32(m.SeoTitle) >= Convert.ToInt32(start) && m.BrandId == Convert.ToInt32(BrandId));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
+                var check = db.ProfitRewardRecord.Any(m => m.CreateDate >= start && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {
-                    var minId = db.ProfitRewardRecord.Where(m => Convert.ToInt32(m.SeoTitle) >= Convert.ToInt32(start) && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
+                    var minId = db.ProfitRewardRecord.Where(m => m.CreateDate >= start && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
                     var Info = function.ReadInstance("/WritePage/ProfitRewardRecord/ProfitRewardRecord" + BrandId + ".txt");
                     if (string.IsNullOrEmpty(Info.ToString()))
                     {
                         function.WritePage("/WritePage/ProfitRewardRecord/", "ProfitRewardRecord" + BrandId + ".txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/ProfitRewardRecord/", "ProfitRewardRecord" + BrandId + ".txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

+ 0 - 115
Areas/Admin/Controllers/MainServer/SetMerchantTypeRecordController.cs

@@ -1,115 +0,0 @@
-/*
- * 设置商户型创客记录
- */
-
-using System;
-using System.Web;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-using MySystem.Models;
-using Library;
-using LitJson;
-using MySystemLib;
-
-namespace MySystem.Areas.Admin.Controllers
-{
-    [Area("Admin")]
-    [Route("Admin/[controller]/[action]")]
-    public class SetMerchantTypeRecordController : BaseController
-    {
-        public SetMerchantTypeRecordController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
-        {
-            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
-        }
-
-        #region 设置商户型创客记录
-
-        /// <summary>
-        /// 根据条件查询设置商户型创客记录
-        /// </summary>
-        /// <returns></returns>
-        public IActionResult Index(StoreSwapSn data, string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        #endregion
-
-        #region 根据条件查询设置商户型创客记录
-
-        /// <summary>
-        /// 设置商户型创客记录
-        /// </summary>
-        /// <returns></returns>
-        public JsonResult IndexData(SetMerchantTypeRecord data, string PosSn, string MerUserTypeMakerCode, string PosFromMakerCode, string OperateTypeSelect, string CreateDateData, int page = 1, int limit = 30)
-        {
-
-            Dictionary<string, string> Fields = new Dictionary<string, string>();
-
-            Fields.Add("PosSn", "1"); //SN号
-
-            string condition = " and Status>-1";
-            //商户型创客编号
-            if (!string.IsNullOrEmpty(MerUserTypeMakerCode))
-            {
-                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MerUserTypeMakerCode + "')";
-            }
-            //机具所属创客编号
-            if (!string.IsNullOrEmpty(PosFromMakerCode))
-            {
-                condition += " and UserId in (select UserId from UserForRealName where RealName='" + PosFromMakerCode + "')";
-            }
-            //操作类型
-            if(!string.IsNullOrEmpty(OperateTypeSelect))
-            {
-                condition += " and OperateType=" + OperateTypeSelect;
-            }
-            //操作时间
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
-            }
-
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SetMerchantTypeRecord", Fields, "Id desc", "0", page, limit, condition);
-            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
-            foreach (Dictionary<string, object> dic in diclist)
-            {
-                // dic["BrandName"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
-
-                //商户型创客信息
-                int ToUserId = int.Parse(dic["ToUserId"].ToString());
-                Users tuser = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
-                dic["MerUserTypeMakerCode"] = tuser.MakerCode;
-                dic["MerUserTypeName"] = tuser.RealName;
-
-                //机具所属创客信息
-                int FromUserId = int.Parse(dic["FromUserId"].ToString());
-                Users fuser = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
-                dic["PosFromMakerCode"] = fuser.MakerCode;
-                dic["PosFromName"] = fuser.RealName;
-                
-                //业务状态
-                int OperateType = int.Parse(dic["OperateType"].ToString());
-                if(OperateType == 1) dic["OperateTypeName"] = "设置";
-                if(OperateType == 2) dic["OperateTypeName"] = "取消";
-
-            }
-            return Json(obj);
-        }
-
-        #endregion
-
-    }
-}

+ 3 - 63
Areas/Admin/Controllers/MainServer/StoreBalanceController.cs

@@ -71,7 +71,7 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and StoreId in (select StoreId from StoreForStoreName where Name='" + StoreIdStoreName + "')";
             }
             //操作时间
-            if (!string.IsNullOrEmpty(CreateDateData))
+            if(!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
                 string start = datelist[0];
@@ -349,10 +349,10 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult ExportExcel(StoreBalance data, string StoreIdStoreNo, string StoreIdStoreName, string TransTypeSelect, string CreateDateData, string BrandIdSelect)
+        public JsonResult ExportExcel(StoreBalance data, string StoreIdStoreNo, string StoreIdStoreName, string TransTypeSelect, string BrandIdSelect)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
-            // Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("CreateDate", "3"); //时间
             Fields.Add("TransRecordNo", "1"); //交易流水编号
 
 
@@ -367,14 +367,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and StoreId in (select StoreId from StoreForStoreName where StoreName='" + StoreIdStoreName + "')";
             }
-            //操作时间
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
-            }
             //交易类型
             if (!string.IsNullOrEmpty(TransTypeSelect))
             {
@@ -438,57 +430,5 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
-
-        #region 快捷导出Excel
-        public IActionResult QuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string QuickExportExcelDo(string StoreIdStoreNo, string StoreIdStoreName, string TransTypeSelect, string CreateDateData, string BrandIdSelect, string TransRecordNo)
-        {
-
-            string condition = " WhERE 1=1 and a.Status>-1";
-            //仓库编号
-            if (!string.IsNullOrEmpty(StoreIdStoreNo))
-            {
-                condition += " and a.StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
-            }
-            //仓库名称
-            if (!string.IsNullOrEmpty(StoreIdStoreName))
-            {
-                condition += " and a.StoreId in (select StoreId from StoreForStoreName where Name='" + StoreIdStoreName + "')";
-            }
-            //操作时间
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
-            }
-            //交易类型
-            if (!string.IsNullOrEmpty(TransTypeSelect))
-            {
-                condition += " and a.TransType=" + TransTypeSelect;
-            }
-            //产品类型
-            if (!string.IsNullOrEmpty(BrandIdSelect))
-            {
-                condition += " and a.BrandId=" + BrandIdSelect;
-            }
-            var Sql = "SELECT b.StoreNo '仓库编号',b.StoreName '仓库名称',a.TransRecordNo '交易流水编号',(CASE WHEN a.TransType=0 THEN '入库' WHEN a.TransType=1 THEN '调拨' WHEN a.TransType=2 THEN '出货' ELSE '' end) '交易类型',c.`Name` '产品类型',a.OpStoreNum '操作库存数',a.OpSymbol '操作符',a.BeforeTotalNum '操作前总库存数',a.AfterTotalNum '操作后总库存数',a.BeforeLaveNum '操作前剩余库存数',a.AfterLaveNum '操作后剩余库存数',a.BeforeOutNum '操作前出库数',a.AfterOutNum '操作后出库数' FROM StoreBalance a LEFT JOIN StoreHouse b ON a.StoreId=b.Id LEFT JOIN KqProducts c ON a.BrandId=c.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);
-            return "success";
-        }
-        #endregion
-
     }
 }

+ 1 - 63
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -634,75 +634,13 @@ namespace MySystem.Areas.Admin.Controllers
 
             result.Add("Fields", ReturnFields);
             OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
-            AddSysLog(Ids, "StoreHouseAmountRecord", "ExportExcel");
+            AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");
             return Json(result);
         }
 
         #endregion
 
 
-
-        #region 快捷导出Excel
-        public IActionResult QuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string QuickExportExcelDo(string UserIdRealName, string UserIdMakerCode, string CreateDateData, string StatusSelect)
-        {
-
-            Dictionary<string, string> Fields = new Dictionary<string, string>();
-            string condition = " where 1=1 and a.PayMode=1 and a.Sort=3";
-            //创客真实姓名
-            if (!string.IsNullOrEmpty(UserIdRealName))
-            {
-                condition += " and a.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 + "')";
-            }
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                string start = datelist[0];
-                string end = datelist[1];
-                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
-            }
-            //状态
-            if (!string.IsNullOrEmpty(StatusSelect))
-            {
-                condition += " and a.Status=" + StatusSelect;
-            }
-
-            var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000000, condition, "", false);
-            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
-            foreach (Dictionary<string, object> dic in diclist)
-            {
-                //记录Id
-                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
-                Ids += Id + ",";
-            }
-            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) '交易类型' 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";
-        }
-        #endregion
-
-
         #region 
 
         /// <summary>

+ 60 - 122
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -1454,7 +1454,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 仓库列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult StatDo(string MakerCode, string StoreNo, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult StatDo(string CreateDateData, int page = 1, int limit = 30)
         {
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["StatSqlConnStr"].ToString();
             string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
@@ -1475,15 +1475,6 @@ namespace MySystem.Areas.Admin.Controllers
 
                 return Json(nodata);
             }
-            var condtion = "";
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                condtion += "and MakerCode='" + MakerCode + "'";
-            }
-            if (!string.IsNullOrEmpty(StoreNo))
-            {
-                condtion += "and StoreNo='" + StoreNo + "'";
-            }
             string minId = "0";
             string maxId = "0";
             string minPosId = "0";
@@ -1514,35 +1505,33 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                 }
             }
-            // DataTable startPosDt = OtherMySqlConn.dtable("select min(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            // if (startPosDt.Rows.Count > 0)
-            // {
-            //     minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
-            //     if (minPosId == "0")
-            //     {
-            //         startPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-            //         if (startPosDt.Rows.Count > 0)
-            //         {
-            //             minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
-            //         }
-            //     }
-            // }
-            // DataTable endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
-            // if (endPosDt.Rows.Count > 0)
-            // {
-            //     maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
-            //     if (maxPosId == "0")
-            //     {
-            //         endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
-            //         if (endPosDt.Rows.Count > 0)
-            //         {
-            //             maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
-            //         }
-            //     }
-            // }
-            // DataTable list = OtherMySqlConn.dtable("select * from (select s.StoreName,s.StoreNo,u.RealName,u.Mobile,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2,(select count(Id) from PosMachinesTwo where Id>=" + minPosId + " and Id<=" + maxPosId + " and ActivationState=1 and ActivationTime>='" + sCreateDate + "' and ActivationTime<='" + eCreateDate + "' and StoreId=s.Id) as c3 from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id) tb where (c1>0 or c2>0 or c3>0) " + condtion);
-
-            DataTable list = OtherMySqlConn.dtable("select * from (select s.StoreName,s.StoreNo,u.MakerCode,u.RealName,u.Mobile,s.ManageMobile,s.Address,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1, (select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2, (select ActCount from KxsStatServer.StoreAct202211 where StoreId=s.Id) as c3, ua.FixedAmount, ua.ValidAmount, ua.TempAmount, (select sum(PromissAmount) from StoreHouseAmountPromiss where ToUserId=s.UserId and `Status`=1) as PromissAmount from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id left join UserAccount ua on s.UserId=ua.Id) tb where (c1>0 or c2>0 or c3>0)" + condtion + "");
+            DataTable startPosDt = OtherMySqlConn.dtable("select min(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
+            if (startPosDt.Rows.Count > 0)
+            {
+                minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
+                if (minPosId == "0")
+                {
+                    startPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
+                    if (startPosDt.Rows.Count > 0)
+                    {
+                        minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
+                    }
+                }
+            }
+            DataTable endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
+            if (endPosDt.Rows.Count > 0)
+            {
+                maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
+                if (maxPosId == "0")
+                {
+                    endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
+                    if (endPosDt.Rows.Count > 0)
+                    {
+                        maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
+                    }
+                }
+            }
+            DataTable list = OtherMySqlConn.dtable("select * from (select s.StoreName,s.StoreNo,u.RealName,u.Mobile,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2,(select count(Id) from PosMachinesTwo where Id>=" + minPosId + " and Id<=" + maxPosId + " and ActivationState=1 and ActivationTime>='" + sCreateDate + "' and ActivationTime<='" + eCreateDate + "' and StoreId=s.Id) as c3 from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id) tb where c1>0 or c2>0 or c3>0");
 
             int recordcount = list.Rows.Count;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
@@ -1578,7 +1567,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult StatExportExcel(string MakerCode, string StoreNo, string CreateDateData)
+        public JsonResult StatExportExcel(string CreateDateData)
         {
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["StatSqlConnStr"].ToString();
             string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
@@ -1601,7 +1590,7 @@ namespace MySystem.Areas.Admin.Controllers
                 NoDataReturnFields.Add("Mobile", "仓库所属人手机号");
                 NoDataReturnFields.Add("RealName", "仓库所属人名称");
                 NoDataReturnFields.Add("MakerCode", "仓库所属人编码");
-                // NoDataReturnFields.Add("ManageMakerCode", "仓库管理员编码");
+                NoDataReturnFields.Add("ManageMakerCode", "仓库管理员编码");
                 NoDataReturnFields.Add("Name", "品牌");
                 NoDataReturnFields.Add("LaveNum", "当前库存");
                 NoDataReturnFields.Add("c1", "出库(调拨)量");
@@ -1610,16 +1599,6 @@ namespace MySystem.Areas.Admin.Controllers
                 nodata.Add("Fields", NoDataReturnFields);
                 return Json(nodata);
             }
-
-            var condtion = "";
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                condtion += "and MakerCode='" + MakerCode + "'";
-            }
-            if (!string.IsNullOrEmpty(StoreNo))
-            {
-                condtion += "and StoreNo='" + StoreNo + "'";
-            }
             string minId = "0";
             string maxId = "0";
             string minPosId = "0";
@@ -1650,7 +1629,34 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                 }
             }
-            DataTable list = OtherMySqlConn.dtable("select * from (select s.StoreName,s.StoreNo,u.MakerCode,u.RealName,u.Mobile,s.ManageMobile,s.Address,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1, (select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2, (select ActCount from KxsStatServer.StoreAct202211 where StoreId=s.Id) as c3, ua.FixedAmount, ua.ValidAmount, ua.TempAmount, (select sum(PromissAmount) from StoreHouseAmountPromiss where ToUserId=s.UserId and `Status`=1) as PromissAmount from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id left join UserAccount ua on s.UserId=ua.Id) tb where (c1>0 or c2>0 or c3>0)" + condtion + "");
+            DataTable startPosDt = OtherMySqlConn.dtable("select min(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
+            if (startPosDt.Rows.Count > 0)
+            {
+                minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
+                if (minPosId == "0")
+                {
+                    startPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
+                    if (startPosDt.Rows.Count > 0)
+                    {
+                        minPosId = function.CheckInt(startPosDt.Rows[0][0].ToString());
+                    }
+                }
+            }
+            DataTable endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo where ActivationTime>='" + sCreateDate + "'");
+            if (endPosDt.Rows.Count > 0)
+            {
+                maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
+                if (maxPosId == "0")
+                {
+                    endPosDt = OtherMySqlConn.dtable("select max(Id) from PosMachinesTwo");
+                    if (endPosDt.Rows.Count > 0)
+                    {
+                        maxPosId = function.CheckInt(endPosDt.Rows[0][0].ToString());
+                    }
+                }
+            }
+            DataTable list = OtherMySqlConn.dtable("select * from (select s.StoreName,s.StoreNo,u.RealName,u.Mobile,u.MakerCode,(select MakerCode from Users where Id=s.ManageUserId) as ManageMakerCode,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2,(select count(Id) from PosMachinesTwo where Id>=" + minPosId + " and Id<=" + maxPosId + " and ActivationState=1 and ActivationTime>='" + sCreateDate + "' and ActivationTime<='" + eCreateDate + "' and StoreId=s.Id) as c3 from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id) tb where c1>0 or c2>0 or c3>0");
+
             int recordcount = list.Rows.Count;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
             foreach (DataRow sub in list.Rows)
@@ -1661,7 +1667,7 @@ namespace MySystem.Areas.Admin.Controllers
                 row.Add("Mobile", sub["Mobile"].ToString());
                 row.Add("RealName", sub["RealName"].ToString());
                 row.Add("MakerCode", sub["MakerCode"].ToString());
-                // row.Add("ManageMakerCode", sub["ManageMakerCode"].ToString());
+                row.Add("ManageMakerCode", sub["ManageMakerCode"].ToString());
                 row.Add("Name", sub["Name"].ToString());
                 row.Add("LaveNum", sub["LaveNum"].ToString());
                 row.Add("c1", sub["c1"].ToString());
@@ -1680,7 +1686,7 @@ namespace MySystem.Areas.Admin.Controllers
             ReturnFields.Add("Mobile", "仓库所属人手机号");
             ReturnFields.Add("RealName", "仓库所属人名称");
             ReturnFields.Add("MakerCode", "仓库所属人编码");
-            // ReturnFields.Add("ManageMakerCode", "仓库管理员编码");
+            ReturnFields.Add("ManageMakerCode", "仓库管理员编码");
             ReturnFields.Add("Name", "品牌");
             ReturnFields.Add("LaveNum", "当前库存");
             ReturnFields.Add("c1", "出库(调拨)量");
@@ -1694,74 +1700,6 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
-        #region 快捷导出Excel
-        public IActionResult StatQuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string StatQuickExportExcelDo(string MakerCode, string StoreNo, string CreateDateData)
-        {
-
-            string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
-            string eCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59";
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                sCreateDate = datelist[0] + " 00:00:00";
-                eCreateDate = datelist[1] + " 23:59:59";
-            }
-            var condtion = "";
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                condtion += "and MakerCode='" + MakerCode + "'";
-            }
-            if (!string.IsNullOrEmpty(StoreNo))
-            {
-                condtion += "and StoreNo='" + StoreNo + "'";
-            }
-            string minId = "0";
-            string maxId = "0";
-            DataTable startDt = OtherMySqlConn.dtable("select min(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if (startDt.Rows.Count > 0)
-            {
-                minId = function.CheckInt(startDt.Rows[0][0].ToString());
-                if (minId == "0")
-                {
-                    startDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if (startDt.Rows.Count > 0)
-                    {
-                        minId = function.CheckInt(startDt.Rows[0][0].ToString());
-                    }
-                }
-            }
-            DataTable endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange where CreateDate>='" + sCreateDate + "'");
-            if (endDt.Rows.Count > 0)
-            {
-                maxId = function.CheckInt(endDt.Rows[0][0].ToString());
-                if (minId == "0")
-                {
-                    endDt = OtherMySqlConn.dtable("select max(Id) from StoreStockChange");
-                    if (endDt.Rows.Count > 0)
-                    {
-                        maxId = function.CheckInt(endDt.Rows[0][0].ToString());
-                    }
-                }
-            }
-            var Sql = "select StoreName '仓库名称',StoreNo '仓库编号',MakerCode '仓库所属人编码',RealName '仓库所属人名称',Mobile '仓库所属人手机号',ManageMobile '仓库管理员手机号',Address '地址',Name '品牌',LaveNum '当前库存',c1 '出库(调拨)量',c2 '出货(发货到创客)量',c3 '激活量' from (select s.StoreName,s.StoreNo,u.MakerCode,u.RealName,u.Mobile,s.ManageMobile,s.Address,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1, (select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2, (select ActCount from KxsStatServer.StoreAct202211 where StoreId=s.Id) as c3, ua.FixedAmount, ua.ValidAmount, ua.TempAmount, (select sum(PromissAmount) from StoreHouseAmountPromiss where ToUserId=s.UserId and `Status`=1) as PromissAmount from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id left join UserAccount ua on s.UserId=ua.Id) tb where (c1>0 or c2>0 or c3>0)" + condtion + "";
-            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);
-            return "success";
-        }
-        #endregion
-
-
         #region 同步数据
 
         /// <summary>

+ 74 - 128
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -842,7 +842,6 @@ namespace MySystem.Areas.Admin.Controllers
             db.SetMerchantTypeRecord.Add(new SetMerchantTypeRecord()
             {
                 CreateDate = DateTime.Now,
-                SeoTitle = SysUserName + "_" + SysRealName,
                 IsRecyc = (ulong)pos.IsPurchase,
                 CreditAmount = pos.CreditTrade,
                 PosSnType = pos.PosSnType,
@@ -855,8 +854,6 @@ namespace MySystem.Areas.Admin.Controllers
                 Note = "后台设置商户型创客",
                 ToUserId = user.Id,
                 FromUserId = pos.BuyUserId,
-                OperateType = 1,
-                BuyUserId = pos.BuyUserId,
             });
             db.SaveChanges();
             string text = string.Format("设置商户代理,创客编号: " + MakerCode + ",机具SN:" + PosSn + ",商户:" + MerNo + ",操作人:" + SysRealName + ",Time:" + DateTime.Now + "");
@@ -878,7 +875,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
-        public string CancelMerAgentDo(string MakerCode, string PosSn, string MerNo, int IsSend = 0)
+        public string CancelMerAgentDo(string MakerCode, string PosSn, int IsSend = 0)
         {
             if (string.IsNullOrEmpty(MakerCode))
             {
@@ -888,10 +885,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "请输入机具SN";
             }
-            if (string.IsNullOrEmpty(MerNo))
-            {
-                return "请输入商户编号";
-            }
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
             KqProducts kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId);
             if (pos == null)
@@ -903,59 +896,30 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "创客编号不存在";
             }
-            PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == MerNo);
-            if (merchant == null)
-            {
-                return "商户编号不存在";
-            }
-            else if (merchant.MerUserType == 1 && merchant.UserId == user.Id)
+            PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == PosSn);
+            pos.UserId = pos.BuyUserId;
+            merchant.UserId = pos.BuyUserId;
+            merchant.MerUserType = 0;
+            user.MerchantType = 0;
+            db.SaveChanges();
+            if (pos.BindMerchantId == 0)
             {
-                pos.UserId = pos.BuyUserId;
-                merchant.UserId = pos.BuyUserId;
-                merchant.MerUserType = 0;
-                user.MerchantType = 0;
-                db.SetMerchantTypeRecord.Add(new SetMerchantTypeRecord()
-                {
-                    CreateDate = DateTime.Now,
-                    SeoTitle = SysUserName + "_" + SysRealName,
-                    IsRecyc = (ulong)pos.IsPurchase,
-                    CreditAmount = pos.CreditTrade,
-                    PosSnType = pos.PosSnType,
-                    ActDate = pos.ActivationTime,
-                    BindDate = pos.BindingTime,
-                    ActStatus = (ulong)pos.ActivationState,
-                    BindStatus = (ulong)pos.BindingState,
-                    MerNo = MerNo,
-                    PosSn = pos.PosSn,
-                    Note = "后台取消商户型创客",
-                    ToUserId = user.Id,
-                    FromUserId = pos.BuyUserId,
-                    OperateType = 2,
-                    BuyUserId = pos.BuyUserId,
-                });
-                db.SaveChanges();
-                if (pos.BindMerchantId == 0)
+                pos.BindMerchantId = merchant.Id;
+                if (IsSend == 1)
                 {
-                    pos.BindMerchantId = merchant.Id;
-                    if (IsSend == 1)
+                    RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
                     {
-                        RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
-                        {
-                            UserId = pos.BuyUserId, //接收创客
-                            MsgType = 2,
-                            Title = "商户型代理取消成功", //标题
-                            Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已给下级代理" + user.RealName + "" + MakerCode + "取消成功",
-                            CreateDate = DateTime.Now,
-                        }));
-                    }
+                        UserId = pos.BuyUserId, //接收创客
+                        MsgType = 2,
+                        Title = "商户型代理取消成功", //标题
+                        Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已给下级代理" + user.RealName + "" + MakerCode + "取消成功",
+                        CreateDate = DateTime.Now,
+                    }));
                 }
-                string text = string.Format("取消商户代理,创客编号: " + user.MakerCode + ",机具SN:" + pos.PosSn + ",操作人:" + SysRealName + ",Time:" + DateTime.Now + "");
-                function.WriteLog(text, "CancelMerAgent");//取消商户型代理日志
-            }
-            else
-            {
-                return "未找到相关信息";
             }
+            string text = string.Format("取消商户代理,创客编号: " + user.MakerCode + ",机具SN:" + pos.PosSn + ",操作人:" + SysRealName + ",Time:" + DateTime.Now + "");
+            function.WriteLog(text, "CancelMerAgent");//取消商户型代理日志
+
             return "success";
         }
 
@@ -4009,29 +3973,29 @@ namespace MySystem.Areas.Admin.Controllers
                         SourceStoreId = posInfo.SourceStoreId, //源仓库
                         ToUserId = tUserId.Id,//收货创客
                     });
-                    UserStoreChange userstore = db.UserStoreChange.Add(new UserStoreChange()
-                    {
-                        CreateDate = DateTime.Now,
-                        UserId = fUserId.Id, //创客
-                        BrandId = posInfo.BrandId, //产品类型
-                        ChangeRecordNo = ChangeRecordNo, //变更记录单号
-                        TransType = 0, //交易类型
-                        SnNo = posInfo.PosSn, //SN编号
-                        SnType = posInfo.PosSnType, //SN机具类型
-                        StockOpDirect = 0, //库存操作方向
-                        DeviceVendor = posInfo.DeviceName, //设备厂商
-                        DeviceType = posInfo.DeviceKind, //设备类型
-                        DeviceModel = posInfo.DeviceType, //设备型号
-                        ToUserId = tUserId.Id, //收货创客
-                        ToDate = DateTime.Now, //入库时间
-                        SourceStoreId = posInfo.SourceStoreId, //源仓库
-                        SnStatus = 1, //SN状态
-                        BindStatus = (int)posInfo.BindingState, //绑定状态
-                        BindMerchantId = posInfo.BindMerchantId, //绑定商户
-                        ActiveStatus = (int)posInfo.ActivationState, //激活状态
-                        ActRewardUserId = posInfo.BuyUserId, //激活奖励创客
-                        BrandType = posInfo.DeviceType, //品牌类型
-                    }).Entity;
+                    // UserStoreChange userstore = db.UserStoreChange.Add(new UserStoreChange()
+                    // {
+                    //     CreateDate = DateTime.Now,
+                    //     UserId = fUserId.Id, //创客
+                    //     BrandId = posInfo.BrandId, //产品类型
+                    //     ChangeRecordNo = ChangeRecordNo, //变更记录单号
+                    //     TransType = 0, //交易类型
+                    //     SnNo = posInfo.PosSn, //SN编号
+                    //     SnType = posInfo.PosSnType, //SN机具类型
+                    //     StockOpDirect = 0, //库存操作方向
+                    //     DeviceVendor = posInfo.DeviceName, //设备厂商
+                    //     DeviceType = posInfo.DeviceKind, //设备类型
+                    //     DeviceModel = posInfo.DeviceType, //设备型号
+                    //     ToUserId = tUserId.Id, //收货创客
+                    //     ToDate = DateTime.Now, //入库时间
+                    //     SourceStoreId = posInfo.SourceStoreId, //源仓库
+                    //     SnStatus = 1, //SN状态
+                    //     BindStatus = (int)posInfo.BindingState, //绑定状态
+                    //     BindMerchantId = posInfo.BindMerchantId, //绑定商户
+                    //     ActiveStatus = (int)posInfo.ActivationState, //激活状态
+                    //     ActRewardUserId = posInfo.BuyUserId, //激活奖励创客
+                    //     BrandType = posInfo.DeviceType, //品牌类型
+                    // }).Entity;
                 }
                 var query = SnIds + ";" + FromMakerCode + ";" + ToMakerCode;
                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
@@ -4306,59 +4270,39 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "机具券" + PosCouponCode + "已使用";
                 }
-                if (item.QueryCount != int.Parse(Kind))
-                {
-                    return "机具券" + PosCouponCode + "类型和您选择的类型不同";
-                }
                 item.UserId = tUserId.Id;
                 if (LeaderUserId > 0 && item.LeaderUserId == 0)
                 {
                     item.LeaderUserId = LeaderUserId;
                 }
-                PosCouponRecord posCouponRecord = db.PosCouponRecord.Add(new PosCouponRecord()
-                {
-                    QueryCount = item.QueryCount,//券类型(1 电签 2 大POS)
-                    CreateDate = DateTime.Now,
-                    ChangeKind = 1,//类型(0购买,1划拨,2使⽤,3申请机具循环驳回)
-                    OrderNo = ChangeRecordNo,
-                    ToUserId = tUserId.Id,
-                    FromUserId = fUserId.Id,
-                    PosCouponId = item.Id,
-                }).Entity;
-            }
-            int CouponCount = PosCouponList.Length;
-            PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
-            {
-                QueryCount = int.Parse(Kind),
-                CreateDate = DateTime.Now,
-                ChangeKind = 2,
-                ChangeCount = CouponCount,
-                // AfterOut = AfterOut,
-                // AfterTotal = AfterTotal,
-                // AfterStock = AfterStock,
-                // BeforeOut = BeforeOut,
-                // BeforeTotal = BeforeTotal,
-                // BeforeStock = BeforeStock,
-                OrderNo = ChangeRecordNo,
-                ToUserId = tUserId.Id,
-                FromUserId = fUserId.Id,
-            }).Entity;
-            PosCouponOrders tostat = db.PosCouponOrders.Add(new PosCouponOrders()
-            {
-                QueryCount = int.Parse(Kind),
-                CreateDate = DateTime.Now,
-                ChangeKind = 1,
-                ChangeCount = CouponCount,
-                // AfterOut = AfterOut,
-                // AfterTotal = AfterTotal,
-                // AfterStock = AfterStock,
-                // BeforeOut = BeforeOut,
-                // BeforeTotal = BeforeTotal,
-                // BeforeStock = BeforeStock,
-                OrderNo = ChangeRecordNo,
-                ToUserId = fUserId.Id,
-                FromUserId = tUserId.Id,
-            }).Entity;
+                // PosCouponRecord posCouponRecord = db.PosCouponRecord.Add(new PosCouponRecord()
+                // {
+                //     QueryCount = item.QueryCount,//券类型(1 电签 2 大POS)
+                //     CreateDate = DateTime.Now,
+                //     ChangeKind = 1,//类型(0购买,1划拨,2使⽤,3申请机具循环驳回)
+                //     OrderNo = ChangeRecordNo,
+                //     ToUserId = tUserId.Id,
+                //     FromUserId = fUserId.Id,
+                //     PosCouponId = item.Id,
+                // }).Entity;
+            }
+            // int CouponCount = PosCouponList.Length;
+            // PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
+            // {
+            //     QueryCount = 2,
+            //     CreateDate = DateTime.Now,
+            //     ChangeKind = 2,
+            //     ChangeCount = CouponCount,
+            //     // AfterOut = AfterOut,
+            //     // AfterTotal = AfterTotal,
+            //     // AfterStock = AfterStock,
+            //     // BeforeOut = BeforeOut,
+            //     // BeforeTotal = BeforeTotal,
+            //     // BeforeStock = BeforeStock,
+            //     OrderNo = ChangeRecordNo,
+            //     ToUserId = tUserId.Id,
+            //     FromUserId = fUserId.Id,
+            // }).Entity;
             db.SaveChanges();
             db.Dispose();
 
@@ -5009,6 +4953,7 @@ namespace MySystem.Areas.Admin.Controllers
         {
             string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            var RealName = "";
             string condition = " where 1=1";
             var UserId = 0;
             var bstart = "";
@@ -5019,6 +4964,7 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 var user = db.Users.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new Users();
                 UserId = user.Id;
+                RealName = user.RealName;
             }
             if (!string.IsNullOrEmpty(BindingTime))
             {
@@ -5052,7 +4998,7 @@ namespace MySystem.Areas.Admin.Controllers
             var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn',(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') '激活时间' from (select (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 BrandId not in(2,7,10,11) 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 = "直营团队数据记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            var FileName = MakerCode + RealName + "直营团队数据记录" + 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);
             return "success";

+ 67 - 1
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -112,8 +113,22 @@ namespace MySystem.Areas.Admin.Controllers
                 if (Status == 1) dic["StatusName"] = "已扣款";
                 if (Status == 2) dic["StatusName"] = "已退还";
                 if (Status == 3) dic["StatusName"] = "暂停扣款";
-
             }
+            Dictionary<string, object> other = new Dictionary<string, object>();
+            string SuccessAmount = "0.00";//已扣款总金额
+            string WaitAmount = "0.00";//待扣款总金额
+            string StopAmount = "0.00";//暂停扣款总金额
+            DataTable dt = OtherMySqlConn.dtable("SELECT SUM(if(Status=1,ChargeAmount,0)),SUM(if(Status=0,ChargeAmount,0)),SUM(if(Status=3,ChargeAmount,0)) FROM ToChargeBackRecord WHERE 1=1 " + condition);
+            if (dt.Rows.Count > 0)
+            {
+                SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+                WaitAmount = decimal.Parse(function.CheckNum(dt.Rows[0][1].ToString())).ToString("f2");
+                StopAmount = decimal.Parse(function.CheckNum(dt.Rows[0][2].ToString())).ToString("f2");
+            }
+            other.Add("SuccessAmount", SuccessAmount);
+            other.Add("WaitAmount", WaitAmount);
+            other.Add("StopAmount", StopAmount);
+            obj.Add("other", other);
             return Json(obj);
         }
 
@@ -653,6 +668,57 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
+
+        #region 快捷导出Excel
+        public IActionResult QuickExportExcel(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string QuickExportExcelDo(string UserIdMakerCode, string PosSn, string CreateDateData, string ChargeTypeSelect, string StatusSelect)
+        {
+
+            string SqlString = " where 1=1 and a.Status>-1";
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                SqlString += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
+            }
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                SqlString += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(PosSn))
+            {
+                SqlString += " and a.Remark=" + PosSn;
+            }
+            //待扣类型
+            if (!string.IsNullOrEmpty(ChargeTypeSelect))
+            {
+                SqlString += " and a.ChargeType=" + ChargeTypeSelect;
+            }
+            //扣款状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                SqlString += " and a.Status=" + StatusSelect;
+            }
+            var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客真实姓名',b.Mobile '手机号',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',a.ChargeAmount '扣款金额',(CASE WHEN a.ChargeType=124 THEN '过期机具扣款' WHEN a.ChargeType=1 THEN '创客预扣款' WHEN a.ChargeType=2 THEN '分期预扣款' ELSE '' end) '扣款类型',DATE_FORMAT(a.UpdateDate,'%Y-%m-%d %H:%i:%s') '扣款/更新时间',(CASE WHEN a.`Status`=0 THEN '待扣款' WHEN a.`Status`=1 THEN '已扣款' WHEN a.`Status`=2 THEN '已退还' WHEN a.`Status`=3 THEN '暂停扣款'  ELSE '' end) '扣款状态',a.Remark '机具Sn',a.SeoDescription '备注',a.SeoTitle '操作人' FROM ToChargeBackRecord a LEFT JOIN Users b ON a.UserId=b.Id " + SqlString + "";
+            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);
+            return "success";
+        }
+        #endregion
+
+
         #region 分期扣款
 
         public IActionResult ChangeInfoDo(string right)

+ 5 - 0
Areas/Admin/Controllers/MainServer/TradeRecordController.cs

@@ -144,6 +144,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/TradeRecord/", "TradeRecord" + BrandId + ".txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/TradeRecord/", "TradeRecord" + BrandId + ".txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

+ 31 - 18
Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs

@@ -116,6 +116,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/UsersAccountRecord/", "UsersAccountRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/UsersAccountRecord/", "UsersAccountRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);
@@ -131,10 +136,22 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 if (int.Parse(ChangeType) > 0)
                 {
+                    // if (ChangeType == 0)
+                    // {
+                    //     condition += " and ChangeType in(0,12)";
+                    // }
                     if (int.Parse(ChangeType) == 1)
                     {
                         condition += " and (ChangeType=" + int.Parse(ChangeType) + " or (ChangeType in(112,1) and ProductType=101))";
                     }
+                    else if (int.Parse(ChangeType) == 30)
+                    {
+                        condition += " and ChangeType=31 and Remark='开机抢红包活动'";
+                    }
+                    else if (int.Parse(ChangeType) == 31)
+                    {
+                        condition += " and (ChangeType=" + int.Parse(ChangeType) + " and (Remark!='开机抢红包活动' or Remark IS NULL))";
+                    }
                     else if (int.Parse(ChangeType) == 112)
                     {
                         condition += " and ChangeType=112 and ProductType=0";
@@ -502,7 +519,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult ExportExcel(UserAccountRecord data, string ChangeType, int ProductType, string TransRecordNo, string MakerCode, string RealName, string CreateDateData, int TopUserId, int UserId)
+        public JsonResult ExportExcel(UserAccountRecord data, int ChangeType, int ProductType, string TransRecordNo, string MakerCode, string RealName, string CreateDateData, int TopUserId, int UserId)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             // Fields.Add("ChangeType", "1"); //交易类型
@@ -529,26 +546,23 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and UserId=" + UserId;
             }
-            if (!string.IsNullOrEmpty(ChangeType))
+            if (ChangeType > 0)
             {
-                if (int.Parse(ChangeType) > 0)
+                if (ChangeType == 1)
                 {
-                    if (int.Parse(ChangeType) == 1)
-                    {
-                        condition += " and (ChangeType=" + int.Parse(ChangeType) + " or (ChangeType in(112,1) and ProductType=101))";
-                    }
-                    else if (int.Parse(ChangeType) == 112)
-                    {
-                        condition += " and ChangeType=112 and ProductType=0";
-                    }
-                    else
-                    {
-                        condition += " and ChangeType=" + int.Parse(ChangeType);
-                    }
+                    condition += " and (ChangeType=" + ChangeType + " or (ChangeType in(112,1) and ProductType=101))";
                 }
-                if (int.Parse(ChangeType) == 0)
+                else if (ChangeType == 30)
                 {
-                    condition += " and ChangeType in(0,12)";
+                    condition += " and ChangeType=31 and Remark='开机抢红包活动'";
+                }
+                else if (ChangeType == 31)
+                {
+                    condition += " and (ChangeType=" + ChangeType + " and (Remark!='开机抢红包活动' or Remark IS NULL))";
+                }
+                else
+                {
+                    condition += " and ChangeType=" + ChangeType;
                 }
             }
             if (ProductType > 0)
@@ -784,6 +798,5 @@ namespace MySystem.Areas.Admin.Controllers
             return "success";
         }
         #endregion
-
     }
 }

+ 31 - 248
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -96,7 +96,7 @@ namespace MySystem.Areas.Admin.Controllers
             //提交到代付状态
             if (!string.IsNullOrEmpty(QueryCountSelect))
             {
-                if (QueryCountSelect == "0")
+                if(QueryCountSelect == "0")
                 {
                     condition += " and QueryCount=" + QueryCountSelect;
                 }
@@ -137,6 +137,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);
@@ -528,7 +533,7 @@ namespace MySystem.Areas.Admin.Controllers
             //提交到代付状态
             if (!string.IsNullOrEmpty(QueryCountSelect))
             {
-                if (QueryCountSelect == "0")
+                if(QueryCountSelect == "0")
                 {
                     condition += " and QueryCount=" + QueryCountSelect;
                 }
@@ -569,6 +574,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);
@@ -610,7 +620,7 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("CashOrderNo", "提现单号");
             ReturnFields.Add("MakerCode", "创客编号");
-            ReturnFields.Add("RealName", "创客姓名");
+            ReturnFields.Add("RealName", "灵工姓名");
             ReturnFields.Add("Mobile", "手机号");
             ReturnFields.Add("IdCardNo", "身份证号");
             ReturnFields.Add("SettleBankName", "开户行名称");
@@ -629,111 +639,6 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
-        #region 快捷导出Excel
-        public IActionResult UserQuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string UserQuickExportExcelDo(string TradeType, string CashOrderNo, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData)
-        {
-
-            string condition = " where 1=1 and a.Status>-1 and a.TradeType<3";
-            //创客编号
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
-            }
-            //创客名称
-            if (!string.IsNullOrEmpty(RealName))
-            {
-                condition += " and a.UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
-            }
-            //提现状态
-            if (!string.IsNullOrEmpty(StatusSelect))
-            {
-                condition += " and a.Status=" + StatusSelect;
-            }
-            if (!string.IsNullOrEmpty(CashOrderNo))
-            {
-                condition += " and a.CashOrderNo='" + CashOrderNo + "'";
-            }
-            if (!string.IsNullOrEmpty(TradeType))
-            {
-                condition += " and a.TradeType=" + TradeType;
-            }
-            //提交到代付状态
-            if (!string.IsNullOrEmpty(QueryCountSelect))
-            {
-                if (QueryCountSelect == "0")
-                {
-                    condition += " and a.QueryCount=" + QueryCountSelect;
-                }
-                else
-                {
-                    condition += " and a.QueryCount>0";
-                }
-            }
-
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
-                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
-                if (check)
-                {
-                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    condition += "  and a.Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
-                    condition += " and a.Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                if (check)
-                {
-                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecord.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and a.Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
-            }
-            var Sql = "SELECT a.CashOrderNo '提现单号',b.MakerCode '创客编号',b.RealName '创客姓名',b.Mobile '手机号',a.IdCardNo '身份证号',a.SettleBankName '开户行名称',a.SettleBankCardNo '开户行卡号',a.ActualTradeAmount '发佣金额(单位:元)',(CASE WHEN a.QueryCount=0 THEN '待提交' WHEN a.QueryCount>0 THEN '已提交' ELSE '' end) '代付标记',(CASE WHEN a.Status=0 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=2 THEN '失败' ELSE '' end) '状态',a.Remark '备注',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间' FROM UserCashRecord 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);
-            return "success";
-        }
-        #endregion
-
 
 
         #region 盟主提现记录列表
@@ -769,7 +674,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 盟主提现记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -799,6 +704,11 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and TradeType=" + data.TradeType;
             }
+            //提交到代付状态
+            if (!string.IsNullOrEmpty(QueryCountSelect))
+            {
+                condition += " and QueryCount=" + QueryCountSelect;
+            }
             if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
@@ -830,6 +740,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);
@@ -886,11 +801,11 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus,string CreateDateData)
+        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("CashOrderNo", "1"); //提现单号
-            // Fields.Add("CreateDate", "3"); //创建时间
+            Fields.Add("CreateDate", "3"); //创建时间
 
             string condition = " and Status>-1 and TradeType=3";
             //创客编号
@@ -918,47 +833,6 @@ namespace MySystem.Areas.Admin.Controllers
                 }
                 condition += " and QueryCount=" + QueryCount;
             }
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
-                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
-                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType == 3);
-                if (check)
-                {
-                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType == 3).Min(m => m.Id);
-                    condition += "  and Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType == 3).Max(m => m.Id);
-                    condition += " and Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
-                if (check)
-                {
-                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType == 3).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/LeaderUserCashRecord.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and a.Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
-            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -991,7 +865,7 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("CashOrderNo", "提现单号");
             ReturnFields.Add("MakerCode", "创客编号");
-            ReturnFields.Add("RealName", "创客姓名");
+            ReturnFields.Add("RealName", "灵工姓名");
             ReturnFields.Add("Mobile", "手机号");
             ReturnFields.Add("IdCardNo", "身份证号");
             ReturnFields.Add("SettleBankName", "开户行名称");
@@ -1010,97 +884,6 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
-
-        #region 快捷导出Excel
-        public IActionResult LeaderQuickExportExcel(string right)
-        {
-            ViewBag.RightInfo = RightInfo;
-            ViewBag.right = right;
-
-            return View();
-        }
-
-        [HttpPost]
-        public string LeaderQuickExportExcelDo(string CashOrderNo, string MakerCode, string RealName, string StatusSelect, string CreateDateData)
-        {
-
-            string condition = " where 1=1 and a.Status>-1 and a.TradeType=3";
-            //创客编号
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
-            }
-            //创客名称
-            if (!string.IsNullOrEmpty(RealName))
-            {
-                condition += " and a.UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
-            }
-            //提现状态
-            if (!string.IsNullOrEmpty(StatusSelect))
-            {
-                condition += " and a.Status=" + StatusSelect;
-            }
-            if (!string.IsNullOrEmpty(CashOrderNo))
-            {
-                condition += " and a.CashOrderNo='" + CashOrderNo + "'";
-            }
-
-            if (!string.IsNullOrEmpty(CreateDateData))
-            {
-                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
-                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
-                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
-                if (check)
-                {
-                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    condition += "  and a.Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
-                    condition += " and a.Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
-                if (check)
-                {
-                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/LeaderUserCashRecord.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "LeaderUserCashRecord.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
-            }
-            var Sql = "SELECT a.CashOrderNo '提现单号',b.MakerCode '创客编号',b.RealName '创客姓名',b.Mobile '手机号',a.IdCardNo '身份证号',a.SettleBankName '开户行名称',a.SettleBankCardNo '开户行卡号',a.ActualTradeAmount '发佣金额(单位:元)',(CASE WHEN a.QueryCount=0 THEN '待提交' WHEN a.QueryCount>0 THEN '已提交' ELSE '' end) '代付标记',(CASE WHEN a.Status=0 THEN '处理中' WHEN a.Status=1 THEN '成功' WHEN a.Status=2 THEN '失败' ELSE '' end) '状态',a.Remark '备注',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间' FROM UserCashRecord 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);
-            return "success";
-        }
-        #endregion
-
-
         #region 助利宝提现记录列表
 
         /// <summary>
@@ -1327,7 +1110,7 @@ namespace MySystem.Areas.Admin.Controllers
             AddSysLog(Id, "UserCashRecord", "cash");
             db.SaveChanges();
             CustomTagSet set = db.CustomTagSet.FirstOrDefault(m => m.Tags == "CashWithoutUser") ?? new CustomTagSet();
-            string MakerCodeString = "," + set.Contents + ",";
+            string IdString = "," + set.Contents + ",";
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
@@ -1335,16 +1118,16 @@ namespace MySystem.Areas.Admin.Controllers
                 if (edit != null)
                 {
                     Users user = db.Users.FirstOrDefault(m => m.Id == edit.UserId) ?? new Users();
-                    if (!MakerCodeString.Contains("," + user.MakerCode + ","))
+                    if (!IdString.Contains("," + user.Id + ","))
                     {
                         edit.QueryCount = Channel;
                         edit.UpdateDate = DateTime.Now;
                         db.SaveChanges();
-                        if (Channel == 1)
+                        if(Channel == 1)
                         {
                             RedisDbconn.Instance.AddList("CashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
                         }
-                        else if (Channel == 2)
+                        else if(Channel == 2)
                         {
                             RedisDbconn.Instance.AddList("JkCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
                         }

+ 5 - 0
Areas/Admin/Controllers/OperateServer/AmountRecordOperateController.cs

@@ -101,6 +101,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/AmountRecordOperate/", "AmountRecordOperate.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/AmountRecordOperate/", "AmountRecordOperate.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

+ 7 - 2
Areas/Admin/Controllers/OperateServer/UserAccountRecordOperateController.cs

@@ -98,10 +98,15 @@ namespace MySystem.Areas.Admin.Controllers
                 if (check)
                 {
                     var minId = db.UserAccountRecord.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UsersAccountRecord/UsersAccountRecord.txt");
+                    var Info = function.ReadInstance("/WritePage/OpUsersAccountRecord/UsersAccountRecord.txt");
                     if (string.IsNullOrEmpty(Info.ToString()))
                     {
-                        function.WritePage("/WritePage/UsersAccountRecord/", "UsersAccountRecord.txt", minId.ToString());
+                        function.WritePage("/WritePage/OpUsersAccountRecord/", "UsersAccountRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/OpUsersAccountRecord/", "UsersAccountRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
                     else

+ 5 - 0
Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs

@@ -120,6 +120,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/OpUserCashRecord/", "OpUserCashRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/OpUserCashRecord/", "OpUserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

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

@@ -119,6 +119,11 @@ namespace MySystem.Areas.Admin.Controllers
                         function.WritePage("/WritePage/OpUserCashRecord/", "OpUserCashRecord.txt", minId.ToString());
                         condition += " and Id >=" + minId;
                     }
+                    else if (minId != int.Parse(Info))
+                    {
+                        function.WritePage("/WritePage/OpUserCashRecord/", "OpUserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
                     else
                     {
                         condition += " and Id >=" + Convert.ToInt32(Info);

+ 1 - 1
Areas/Admin/Controllers/SpServer/SpTradeRecordController.cs

@@ -57,7 +57,7 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
             Fields.Add("MerNo", "1"); //商户编号
-            Fields.Add("MerSnNo", "1"); //机具号
+            Fields.Add("TradeSnNo", "1"); //机具号
             Fields.Add("ChannelSerial", "1"); //渠道流水号
 
 

+ 5 - 6
Areas/Admin/Views/BsServer/Advertisment/Add.cshtml

@@ -2,7 +2,6 @@
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
     string SysUserName = ViewBag.SysUserName as string;
-    string CurColId = ViewBag.CurColId as string;
 }
 <!DOCTYPE html>
 <html>
@@ -29,16 +28,16 @@
                     <div class="layui-form-item">
                         <label class="layui-form-label">标题</label>
                         <div class="layui-input-block">
-                            <input class="layui-input" type="text" id="Title" name="Title" maxlength="50" lay-verify="required|" autocomplete="off" placeholder="请输入标题">
+                            <input class="layui-input" type="text" id="Title" name="Title" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入标题">
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <div class="layui-inline">
                             <label class="layui-form-label">分类</label>
                             <div class="layui-input-inline">
-                                <select id="ColId" name="ColId" lay-search="" lay-verify="required|" placeholder="请选择分类">
+                                <select id="ColId" name="ColId" lay-search="">
                                     <option value="">请选择</option>
-                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic(CurColId);}
+                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic("003");}
                                     @foreach (string key in ColDic.Keys)
                                     {
                                         string kg = "";
@@ -56,7 +55,7 @@
                         <label class="layui-form-label">图片</label>
                         <div class="layui-input-block">
                             <div class="layui-upload">
-                                <input type="hidden" id="PicPath" name="PicPath" value="" lay-verify="required|">
+                                <input type="hidden" id="PicPath" name="PicPath" value="">
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <div class="layui-inline layui-word-aux"></div>
                             </div>
@@ -67,7 +66,7 @@
                     <div class="layui-form-item layui-form-text">
                         <label class="layui-form-label">内容</label>
                         <div class="layui-input-block">
-                            <textarea class="layui-textarea" id="Contents" name="Contents" style="width:100%;height:500px;"></textarea>
+                            <textarea class="layui-textarea" id="Contents" name="Contents" placeholder="请输入内容" style="width:100%;height:500px;"></textarea>
                         </div>
                     </div>
                     <div class="layui-form-item">

+ 4 - 5
Areas/Admin/Views/BsServer/Advertisment/Edit.cshtml

@@ -4,7 +4,6 @@
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
     string SysUserName = ViewBag.SysUserName as string;
-    string CurColId = ViewBag.CurColId as string;
 }
 <!DOCTYPE html>
 <html>
@@ -32,16 +31,16 @@
                     <div class="layui-form-item">
                         <label class="layui-form-label">标题</label>
                         <div class="layui-input-block">
-                            <input class="layui-input" type="text" id="Title" name="Title" value="@editData.Title" maxlength="50" lay-verify="required|" autocomplete="off" placeholder="请输入标题">
+                            <input class="layui-input" type="text" id="Title" name="Title" value="@editData.Title" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入标题">
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <div class="layui-inline">
                             <label class="layui-form-label">分类</label>
                             <div class="layui-input-inline">
-                                <select id="ColId" name="ColId" lay-search="" lay-verify="required|" placeholder="请选择分类">
+                                <select id="ColId" name="ColId" lay-search="">
                                     <option value="">请选择</option>
-                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic(CurColId);}
+                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic("003");}
                                     @foreach (string key in ColDic.Keys)
                                     {
                                         string kg = "";
@@ -60,7 +59,7 @@
                         <label class="layui-form-label">图片</label>
                         <div class="layui-input-block">
                             <div class="layui-upload">
-                                <input type="hidden" id="PicPath" name="PicPath" value="@editData.PicPath" lay-verify="required|" placeholder="请输入图片">
+                                <input type="hidden" id="PicPath" name="PicPath" value="@editData.PicPath">
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <div class="layui-inline layui-word-aux"></div>
                             </div>

+ 0 - 17
Areas/Admin/Views/BsServer/Advertisment/Index.cshtml

@@ -1,7 +1,6 @@
 @{
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
-    string CurColId = ViewBag.CurColId as string;
 }
 <!DOCTYPE html>
 <html>
@@ -67,18 +66,6 @@
                     {
                         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
                     }
-                    @if (RightInfo.Contains("," + right + "_open,"))
-                    {
-                        @Html.Raw("{{#if (d.Status == 0){ }}")
-                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open"><i class="layui-icon layui-icon-up"></i>上架</a>
-                        @("{{#} }}")
-                    }
-                    @if (RightInfo.Contains("," + right + "_close,"))
-                    {
-                        @("{{#if (d.Status == 1){ }}")
-                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="close"><i class="layui-icon layui-icon-down"></i>下架</a>
-                        @("{{#} }}")
-                    }
                 </script>
             </div>
         </div>
@@ -105,9 +92,5 @@
 
     <script src="/layuiadmin/layui/layui.js"></script>
     <script src="/layuiadmin/modules/Advertisment_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
-    <script>
-        var CurColId = '@CurColId';
-        var right = '@right';
-    </script>
 </body>
 </html>

+ 26 - 0
Areas/Admin/Views/MainServer/LeaderReserveRecord/Index.cshtml

@@ -99,6 +99,32 @@
                         </div>
                     </div>
                 </div>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="layui-card-body">
+                    <div style="padding-bottom: 10px;">
+                        @* @if (RightInfo.Contains("," + right + "_add,"))
+                        {
+                            <button class="layui-btn" data-type="add"><i
+                                    class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>新增</button>
+                        }
+                        @if (RightInfo.Contains("," + right + "_delete,"))
+                        {
+                            <button class="layui-btn" data-type="batchdel"><i
+                                    class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                        }
+                        @if (RightInfo.Contains("," + right + "_edit,"))
+                        {
+                            <button class="layui-btn" data-type="ExportExcel"><i
+                                    class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                        } *@
+                    </div>
+
+                    <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                    <script type="text/html" id="table-list-tools">
 
                 <div class="layui-card-body">
                     <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>

+ 0 - 3
Areas/Admin/Views/MainServer/Orders/Return.cshtml

@@ -32,8 +32,6 @@
                                 <input class="layui-input" type="text" readonly value="@editData.TotalPrice">
                             </div>
                         </div>
-                        @if(editData.PayMode == 3)
-                        {
                         <div class="layui-form-item">
                             <label class="layui-form-label">*退款金额</label>
                             <div class="layui-input-inline">
@@ -41,7 +39,6 @@
                                     lay-verify="required|number|" autocomplete="off" placeholder="请输入退款金额">
                             </div>
                         </div>
-                        }
                         <div class="layui-form-item">
                             <label class="layui-form-label">*退货原因</label>
                             <div class="layui-input-inline">

+ 0 - 134
Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml

@@ -1,134 +0,0 @@
-@{
-    string RightInfo = ViewBag.RightInfo as string;
-    string right = ViewBag.right as string;
-
-}
-<!DOCTYPE html>
-<html>
-
-<head>
-    <meta charset="utf-8">
-    <title>设置商户型创客记录</title>
-    <meta name="renderer" content="webkit">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport"
-        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
-    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
-    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
-    <script src="/admin/js/jquery-1.10.1.min.js"></script>
-    <style>
-        .layui-input-inline{
-            width: 175px !important;
-        }
-        .layui-form-label{
-            width: 115px !important;
-        }
-        .layui-inline{
-            margin-right: 0px !important;
-        }
-        .w100{
-            width: 100px !important;
-        }
-        .ml50{
-            margin-left: 50px !important;
-        }
-        tbody .layui-table-cell{
-            height: 60px !important;
-        }
-    </style>
-</head>
-
-<body>
-    <div class="layui-fluid">
-        <div class="layui-card">
-            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
-                <div class="layui-form-item">
-                    <div class="layui-inline">
-                        <label class="layui-form-label">机具SN</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="PosSn" placeholder="" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">商户型创客编号</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="MerUserTypeMakerCode" placeholder=""
-                                autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">机具所属创客编号</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="PosFromMakerCode" placeholder=""
-                                autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">操作类别</label>
-                        <div class="layui-input-inline">
-                            <select id="OperateTypeSelect" name="OperateTypeSelect" lay-search="">
-                                <option value="">全部...</option>
-                                <option value="1">设置</option>
-                                <option value="2">取消</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">创建时间</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
-                                placeholder="" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline ml50">
-                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
-                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
-                        </button>
-                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
-                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
-                        </button>
-                    </div>
-                </div>
-            </div>
-
-            <div class="layui-card-body">
-                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
-                <script type="text/html" id="table-list-tools">
-                </script>
-            </div>
-        </div>
-    </div>
-    <div id="excelForm" style="display:none; padding:20px;">
-        <div class="layui-tab-item layui-show">
-            <div class="layui-form-item">
-                <label class="layui-form-label">模板下载</label>
-                <div class="layui-form-mid layui-word-aux" id="excelTemp">
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label">excel文件</label>
-                <div class="layui-form-mid layui-word-aux">
-                    <div class="layui-upload">
-                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
-                    </div>
-                    <div class="mt10" id="ExcelFileList">
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="layui-form-item ml10">
-            <div class="layui-input-block">
-                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
-            </div>
-        </div>
-    </div>
-
-    <script src="/layuiadmin/layui/layui.js"></script>
-    <script
-        src="/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
-    <script>
-
-    </script>
-</body>
-
-</html>

+ 26 - 24
Areas/Admin/Views/MainServer/StoreHouse/Stat.cshtml

@@ -3,66 +3,70 @@
     string right = ViewBag.right as string;
     string MakerCode = ViewBag.MakerCode as string;
 
-
+    
 }
 <!DOCTYPE html>
 <html>
-
 <head>
     <meta charset="utf-8">
     <title>仓库</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport"
-        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
     <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
     <script src="/admin/js/jquery-1.10.1.min.js"></script>
     <style>
-        .layui-input-inline {
+        .layui-input-inline{
             width: 175px !important;
         }
-
-        .layui-form-label {
+        .layui-form-label{
             width: 128px !important;
         }
-
-        .layui-inline {
+        .layui-inline{
             margin-right: 0px !important;
         }
-
-        .w100 {
+        .w100{
             width: 100px !important;
         }
-
-        .ml50 {
+        .ml50{
             margin-left: 50px !important;
         }
     </style>
 </head>
-
 <body>
     <div class="layui-fluid">
         <div class="layui-card">
             <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                 <div class="layui-form-item">
                     <div class="layui-inline">
-                        <label class="layui-form-label">创客编号</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="MakerCode" value="@MakerCode"
-                                autocomplete="off">
+                            <label class="layui-form-label">创客编号</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" name="MakerCode" value="@MakerCode" autocomplete="off">
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">创客名称</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" name="RealName" autocomplete="off">
+                            </div>
                         </div>
-                    </div>
                     <div class="layui-inline">
                         <label class="layui-form-label">仓库编号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="StoreNo" placeholder="" autocomplete="off">
                         </div>
                     </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="StoreName" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
                     <div class="layui-inline">
                         <label class="layui-form-label">创建时间</label>
                         <div class="layui-input-inline">
-                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate" lay-verify="required|"
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
                                 placeholder="" autocomplete="off">
                         </div>
                     </div>
@@ -79,9 +83,8 @@
 
             <div class="layui-card-body">
                 <div style="padding-bottom: 10px;">
-                    <button class="layui-btn" data-type="ExportExcel"><i
-                            class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
-                </div>
+                    <button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+                </div>                
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
             </div>
         </div>
@@ -93,5 +96,4 @@
         var MakerCode = '@MakerCode';
     </script>
 </body>
-
 </html>

+ 19 - 31
Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml

@@ -1,23 +1,20 @@
 @{
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
-
+    
 }
 <!DOCTYPE html>
 <html>
-
 <head>
     <meta charset="utf-8">
     <title>设置商户型创客</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport"
-        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
     <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
     <script src="/admin/js/jquery-1.10.1.min.js"></script>
     <script src="/admin/js/LAreaData2.js"></script>
 </head>
-
 <body>
 
     <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
@@ -41,15 +38,9 @@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
-                                            lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
-                                    </div>
-                                </div>
-                                <div class="layui-form-item">
-                                    <label class="layui-form-label">商户编号</label>
-                                    <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="MerNo" name="MerNo" maxlength="50"
-                                            lay-verify="required|" autocomplete="off" placeholder="请输入商户编号">
+                                        <input class="layui-input" type="text" id="PosSn"
+                                            name="PosSn" maxlength="50" lay-verify="required|"
+                                            autocomplete="off" placeholder="请输入机具SN">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
@@ -74,8 +65,7 @@
     </div>
 
     <script src="/layuiadmin/layui/layui.js"></script>
-    <script
-        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
     <script src="/other/mybjq/kindeditor-min.js"></script>
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
@@ -86,25 +76,24 @@
             var userdata = $("#confirmFrm").serialize();
             $.ajax({
                 type: "POST",
-                url: "/Admin/SysTools/CancelMerAgentDo?r=" + Math.random(1),
+                url: "/Admin/SysTools/SetMerAgentDo?r=" + Math.random(1),
                 data: userdata,
                 dataType: "text",
                 success: function (data) {
                     layer.close(index); //关闭弹层
                     if (data == "success") {
-                        layer.msg("取消成功");
-                        window.location.reload();
+                        layer.msg("重置成功");
                     } else {
                         layer.msg(data);
                     }
                 }
             });
         }
-
-
+        
+                    
         //编辑器
         KindEditor.ready(function (K) {
-
+            
         });
 
         var ids = "";
@@ -210,7 +199,7 @@
             });
         }
 
-
+        
         var tree;
         var element;
         var upload;
@@ -230,31 +219,30 @@
             tree = layui.tree;
             element = layui.element;
             upload = layui.upload;
-
+        
             //Hash地址的定位
             var layid = location.hash.replace(/^#test=/, '');
             element.tabChange('test', layid);
             element.on('tab(test)', function (elem) {
                 location.hash = 'test=' + $(this).attr('lay-id');
             });
-
+    
             //日期
-
+            
 
             //上传文件
-
+            
 
             //穿梭框
-
+            
 
             //TreeView,比如权限管理
-
+            
 
             //省市区
-
+            
         })
 
     </script>
 </body>
-
 </html>

+ 21 - 25
Areas/Admin/Views/MainServer/SysTools/SetMerAgent.cshtml

@@ -1,23 +1,20 @@
 @{
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
-
+    
 }
 <!DOCTYPE html>
 <html>
-
 <head>
     <meta charset="utf-8">
     <title>设置商户型创客</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport"
-        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
     <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
     <script src="/admin/js/jquery-1.10.1.min.js"></script>
     <script src="/admin/js/LAreaData2.js"></script>
 </head>
-
 <body>
 
     <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
@@ -41,15 +38,17 @@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
-                                            lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
+                                        <input class="layui-input" type="text" id="PosSn"
+                                            name="PosSn" maxlength="50" lay-verify="required|"
+                                            autocomplete="off" placeholder="请输入机具SN">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">商户编号</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="MerNo" name="MerNo" maxlength="50"
-                                            lay-verify="required|" autocomplete="off" placeholder="请输入商户编号">
+                                        <input class="layui-input" type="text" id="MerNo"
+                                            name="MerNo" maxlength="50" lay-verify="required|"
+                                            autocomplete="off" placeholder="请输入商户编号">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
@@ -74,8 +73,7 @@
     </div>
 
     <script src="/layuiadmin/layui/layui.js"></script>
-    <script
-        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
     <script src="/other/mybjq/kindeditor-min.js"></script>
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
@@ -92,19 +90,18 @@
                 success: function (data) {
                     layer.close(index); //关闭弹层
                     if (data == "success") {
-                        layer.msg("设置成功");
-                        window.location.reload();
+                        layer.msg("重置成功");
                     } else {
                         layer.msg(data);
                     }
                 }
             });
         }
-
-
+        
+                    
         //编辑器
         KindEditor.ready(function (K) {
-
+            
         });
 
         var ids = "";
@@ -210,7 +207,7 @@
             });
         }
 
-
+        
         var tree;
         var element;
         var upload;
@@ -230,31 +227,30 @@
             tree = layui.tree;
             element = layui.element;
             upload = layui.upload;
-
+        
             //Hash地址的定位
             var layid = location.hash.replace(/^#test=/, '');
             element.tabChange('test', layid);
             element.on('tab(test)', function (elem) {
                 location.hash = 'test=' + $(this).attr('lay-id');
             });
-
+    
             //日期
-
+            
 
             //上传文件
-
+            
 
             //穿梭框
-
+            
 
             //TreeView,比如权限管理
-
+            
 
             //省市区
-
+            
         })
 
     </script>
 </body>
-
 </html>

+ 0 - 9
Areas/Admin/Views/MainServer/SysTools/TransferPosCoupon.cshtml

@@ -30,15 +30,6 @@
                         </ul>
                         <div class="layui-tab-content mt20">
                             <div class="layui-tab-item layui-show">
-                                <div class="layui-form-item">
-                                    <label class="layui-form-label">券类型</label>
-                                    <div class="layui-input-inline">
-                                        <select id="Kind" name="Kind" lay-search="">
-                                            <option value="1">电签券</option>
-                                            <option value="2">大POS券</option>
-                                        </select>
-                                    </div>
-                                </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具券码</label>
                                     <div class="layui-input-block">

+ 3 - 0
Areas/Admin/Views/MainServer/ToChargeBackRecord/Index.cshtml

@@ -130,6 +130,9 @@
                         class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>机具回收确认退还</button>
                         } *@
                 </div>
+                 <blockquote class="layui-elem-quote layui-text">
+                    已扣款总金额(元):<span style="color: #f00;" id="SuccessAmount">0.00</span> | 待扣款总金额(元):<span style="color: #f00;" id="WaitAmount">0.00</span> | 暂停扣款总金额(元):<span style="color: #f00;" id="StopAmount">0.00</span>
+                </blockquote>
 
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                 <script type="text/html" id="table-list-tools">

+ 1 - 1
Areas/Admin/Views/MainServer/UserAccountRecord/Index.cshtml

@@ -88,7 +88,7 @@
                                 <option value="0">激活奖励</option>
                                 <option value="1">交易分润</option>
                                 @* <option value="11">月月红</option> *@
-                                <option value="12">交易奖励</option>
+                                @* <option value="12">交易奖励</option> *@
                                 <option value="2">提现申请</option>
                                 <option value="3">提现代付</option>
                                 <option value="4">提现手续费</option>

+ 11 - 35
wwwroot/layuiadmin/modules/Advertisment_Admin.js

@@ -61,15 +61,16 @@ layui.config({
     //列表数据
     table.render({
         elem: '#LAY-list-manage'
-        , url: '/Admin/Advertisment/IndexData?CurColId=' + CurColId //模拟接口
+        , url: '/Admin/Advertisment/IndexData' //模拟接口
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
-            , { field: 'Title', width: 220, title: '标题', sort: true }
-            , { field: 'ColId', width: 220, title: '分类', sort: true }
-            , { field: 'PicPath', width: 220, title: '图片', templet: '#imgTpl', unresize: true }
+            , { field: 'Title', title: '标题', sort: true }
+            , { field: 'ColId', title: '分类', sort: true }
+            , { field: 'PicPath', title: '图片', width: 60, templet: '#imgTpl', unresize: true }
+
             , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
-            , { title: '操作', width: 420, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+            , { title: '操作', width: 220, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , page: true
         , limit: 30
@@ -105,7 +106,7 @@ layui.config({
             var perContent = layer.open({
                 type: 2
                 , title: '广告位-编辑'
-                , content: 'Edit?Id=' + data.Id + '&CurColId=' + CurColId
+                , content: 'Edit?Id=' + data.Id
                 , maxmin: true
                 , area: ['500px', '450px']
                 , btn: ['确定', '取消']
@@ -117,6 +118,9 @@ layui.config({
                     //内容
                     iframeWindow.Contentsedit.sync();
 
+
+
+
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
                         var field = data.field; //获取提交的字段
@@ -150,34 +154,6 @@ layui.config({
                 }
             });
             layer.full(perContent);
-        } else if (obj.event === 'open') {
-            $.ajax({
-                type: "POST",
-                url: "/Admin/Advertisment/Open?r=" + Math.random(1),
-                data: "Id=" + data.Id,
-                dataType: "text",
-                success: function (data) {
-                    if (data == "success") {
-                        table.reload('LAY-list-manage'); //数据刷新
-                    } else {
-                        parent.layer.msg(data);
-                    }
-                }
-            });
-        } else if (obj.event === 'close') {
-            $.ajax({
-                type: "POST",
-                url: "/Admin/Advertisment/Close?r=" + Math.random(1),
-                data: "Id=" + data.Id,
-                dataType: "text",
-                success: function (data) {
-                    if (data == "success") {
-                        table.reload('LAY-list-manage'); //数据刷新
-                    } else {
-                        parent.layer.msg(data);
-                    }
-                }
-            });
         }
     });
 
@@ -232,7 +208,7 @@ layui.config({
             var perContent = layer.open({
                 type: 2
                 , title: '广告位-添加'
-                , content: 'Add?CurColId=' + CurColId
+                , content: 'Add'
                 , maxmin: true
                 , area: ['500px', '450px']
                 , btn: ['确定', '取消']

+ 9 - 34
wwwroot/layuiadmin/modules_main/Orders_Admin.js

@@ -581,40 +581,15 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/Orders/ExportsExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/Orders/QuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/Orders/ExportsExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
             });
         }
         , ExportExcel: function () {

+ 10 - 35
wwwroot/layuiadmin/modules_main/PreCardAmountRecord_Admin.js

@@ -341,41 +341,16 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/PreAmountRecord/ExportsExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //         window.location.reload();
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/PreAmountRecord/QuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/PreAmountRecord/ExportsExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                    window.location.reload();
+                }
             });
         }
         , BatchSetting: function () {

+ 0 - 409
wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js

@@ -1,409 +0,0 @@
-var ExcelData, ExcelKind;
-function ConfirmImport() {
-    $.ajax({
-        type: "POST",
-        url: "/Admin/SetMerchantTypeRecord/Import?r=" + Math.random(1),
-        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
-        dataType: "text",
-        success: function (data) {
-            if (data == "success") {
-                layer.msg("导入成功", { time: 2000 }, function () {
-                    window.location.reload();
-                });
-            } else {
-                layer.msg(data);
-            }
-        }
-    });
-}
-
-var excel;
-layui.config({
-    base: '/layuiadmin/' //静态资源所在路径
-}).extend({
-    myexcel: 'layui/lay/modules/excel',
-    index: 'lib/index' //主入口模块
-}).use(['index', 'table', 'excel', 'laydate'], function () {
-    var $ = layui.$
-        , form = layui.form
-        , table = layui.table;
-
-    //- 筛选条件-日期
-    var laydate = layui.laydate;
-    var layCreateDate = laydate.render({
-        elem: '#CreateDate',
-        type: 'date',
-        range: true,
-        trigger: 'click',
-        change: function (value, date, endDate) {
-            var op = true;
-            if (date.year == endDate.year && endDate.month - date.month <= 1) {
-                if (endDate.month - date.month == 1 && endDate.date > date.date) {
-                    op = false;
-                    layCreateDate.hint('日期范围请不要超过1个月');
-                    setTimeout(function () {
-                        $(".laydate-btns-confirm").addClass("laydate-disabled");
-                    }, 1);
-                }
-            } else {
-                op = false;
-                layCreateDate.hint('日期范围请不要超过1个月');
-                setTimeout(function () {
-                    $(".laydate-btns-confirm").addClass("laydate-disabled");
-                }, 1);
-            }
-            if (op) {
-                $('#CreateDate').val(value);
-            }
-        }
-    });
-
-
-    //excel导入
-    excel = layui.excel;
-    $('#ExcelFile').change(function (e) {
-        var files = e.target.files;
-        excel.importExcel(files, {}, function (data) {
-            ExcelData = data[0].sheet1;
-        });
-    });
-
-    //监听单元格编辑
-    table.on('edit(LAY-list-manage)', function (obj) {
-        var value = obj.value //得到修改后的值
-            , data = obj.data //得到所在行所有键值
-            , field = obj.field; //得到字段
-        if (field == "Sort") {
-            $.ajax({
-                type: "POST",
-                url: "/Admin/SetMerchantTypeRecord/Sort?r=" + Math.random(1),
-                data: "Id=" + data.Id + "&Sort=" + value,
-                dataType: "text",
-                success: function (data) {
-                }
-            });
-        }
-    });
-
-    //列表数据
-    table.render({
-        elem: '#LAY-list-manage'
-        , url: '/Admin/SetMerchantTypeRecord/IndexData' //模拟接口
-        , cols: [[
-            { type: 'checkbox', fixed: 'left' }
-            , { field: 'PosSn', width: 200, title: 'SN编号', sort: true }
-            // , { field: 'BrandName', width: 200, title: '产品类型', sort: true }
-            , { field: 'OperateTypeName', width: 200, title: '操作类别', sort: true }
-            , { field: 'MerUserTypeName', width: 200, title: '商户型创客姓名', sort: true }
-            , { field: 'MerUserTypeMakerCode', width: 200, title: '商户型创客编码', sort: true }
-            , { field: 'PosFromName', width: 200, title: '机具所属创客姓名', sort: true }
-            , { field: 'PosFromMakerCode', width: 200, title: '机具所属创客编码', sort: true }
-            , { field: 'CreateDate', width: 200, title: '操作时间', sort: true }
-            , { field: 'SeoTitle', width: 200, title: '操作人', sort: true }
-        ]]
-        , where: {
-
-        }
-        , page: true
-        , limit: 30
-        , height: 'full-' + String($('.layui-card-header').height() + 130)
-        , text: '对不起,加载出现异常!'
-        , done: function (res, curr, count) {
-            $(".layui-none").text("无数据");
-        }
-    });
-
-    //监听工具条
-    table.on('tool(LAY-list-manage)', function (obj) {
-        var data = obj.data;
-        if (obj.event === 'del') {
-            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/SetMerchantTypeRecord/Delete?r=" + Math.random(1),
-                    data: "Id=" + data.Id,
-                    dataType: "text",
-                    success: function (data) {
-                        if (data == "success") {
-                            obj.del();
-                            layer.close(index);
-                        } else {
-                            parent.layer.msg(data);
-                        }
-                    }
-                });
-            });
-        } else if (obj.event === 'edit') {
-            var tr = $(obj.tr);
-            var perContent = layer.open({
-                type: 2
-                , title: '仓库库存变动记录-编辑'
-                , content: 'Edit?Id=' + data.Id + ''
-                , maxmin: true
-                , area: ['500px', '450px']
-                , btn: ['确定', '取消']
-                , yes: function (index, layero) {
-                    var iframeWindow = window['layui-layer-iframe' + index]
-                        , submitID = 'LAY-list-front-submit'
-                        , submit = layero.find('iframe').contents().find('#' + submitID);
-
-                    setTimeout(function () {
-                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
-                            var errObj = $(this).find('.layui-form-danger');
-                            if (errObj.length > 0) {
-                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
-                                submit.click();
-                            }
-                        });
-                    }, 300);
-
-
-
-
-
-
-                    //监听提交
-                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-                        var field = data.field; //获取提交的字段
-                        var userdata = "";
-                        for (var prop in field) {
-                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
-                        }
-                        //提交 Ajax 成功后,静态更新表格中的数据
-                        //$.ajax({});
-
-                        $.ajax({
-                            type: "POST",
-                            url: "/Admin/SetMerchantTypeRecord/Edit?r=" + Math.random(1),
-                            data: userdata,
-                            dataType: "text",
-                            success: function (data) {
-                                layer.close(index); //关闭弹层
-                                if (data == "success") {
-                                    table.reload('LAY-list-manage'); //数据刷新
-                                } else {
-                                    layer.msg(data);
-                                }
-                            }
-                        });
-                    });
-
-                    submit.trigger('click');
-                }
-                , success: function (layero, index) {
-
-                }
-            });
-            layer.full(perContent);
-        }
-    });
-
-
-    //监听搜索
-    form.on('submit(LAY-list-front-search)', function (data) {
-        var field = data.field;
-
-        //执行重载
-        table.reload('LAY-list-manage', {
-            where: field,
-            page: {
-                curr: 1
-            }
-        });
-    });
-    form.on('submit(LAY-list-front-searchall)', function (data) {
-        table.reload('LAY-list-manage', {
-            where: null,
-            page: {
-                curr: 1
-            }
-        });
-    });
-
-    //事件
-    var active = {
-        batchdel: function () {
-            var checkStatus = table.checkStatus('LAY-list-manage')
-                , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
-                parent.layer.msg("请选择要删除的项");
-            } else {
-                var ids = "";
-                $.each(data, function (index, value) {
-                    ids += data[index].Id + ",";
-                });
-                ids = ids.substring(0, ids.length - 1);
-                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
-                    $.ajax({
-                        type: "POST",
-                        url: "/Admin/SetMerchantTypeRecord/Delete?r=" + Math.random(1),
-                        data: "Id=" + ids,
-                        dataType: "text",
-                        success: function (data) {
-                            layer.close(index);
-                            if (data == "success") {
-                                table.reload('LAY-list-manage');
-                            } else {
-                                layer.msg(data);
-                            }
-                        }
-                    });
-                });
-            }
-        }
-        , add: function () {
-            var perContent = layer.open({
-                type: 2
-                , title: '仓库库存变动记录-添加'
-                , content: 'Add'
-                , maxmin: true
-                , area: ['500px', '450px']
-                , btn: ['确定', '取消']
-                , yes: function (index, layero) {
-                    var iframeWindow = window['layui-layer-iframe' + index]
-                        , submitID = 'LAY-list-front-submit'
-                        , submit = layero.find('iframe').contents().find('#' + submitID);
-
-                    setTimeout(function () {
-                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
-                            var errObj = $(this).find('.layui-form-danger');
-                            if (errObj.length > 0) {
-                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
-                                submit.click();
-                            }
-                        });
-                    }, 300);
-
-
-
-
-
-
-                    //监听提交
-                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-                        var field = data.field; //获取提交的字段
-                        var userdata = "";
-                        for (var prop in field) {
-                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
-                        }
-                        //提交 Ajax 成功后,静态更新表格中的数据
-                        //$.ajax({});
-
-                        $.ajax({
-                            type: "POST",
-                            url: "/Admin/SetMerchantTypeRecord/Add?r=" + Math.random(1),
-                            data: userdata,
-                            dataType: "text",
-                            success: function (data) {
-                                layer.close(index); //关闭弹层
-                                if (data == "success") {
-                                    table.reload('LAY-list-manage'); //数据刷新
-                                } else {
-                                    layer.msg(data);
-                                }
-                            }
-                        });
-                    });
-
-                    submit.trigger('click');
-                }
-            });
-            layer.full(perContent);
-        }
-        , ImportData: function () {
-            ExcelKind = 1;
-            layer.open({
-                type: 1,
-                title: '导入',
-                maxmin: false,
-                area: ['460px', '280px'],
-                content: $('#excelForm'),
-                cancel: function () {
-                }
-            });
-            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
-        }
-        , ExportExcel: function () {
-            var userdata = '';
-            $(".layuiadmin-card-header-auto input").each(function (i) {
-                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
-            });
-            $(".layuiadmin-card-header-auto select").each(function (i) {
-                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
-            });
-            $.ajax({
-                type: "GET",
-                url: "/Admin/SetMerchantTypeRecord/ExportExcel?r=" + Math.random(1),
-                data: userdata,
-                dataType: "json",
-                success: function (data) {
-                    data.Obj.unshift(data.Fields);
-                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
-                }
-            });
-        }
-        , Open: function () {
-            var checkStatus = table.checkStatus('LAY-list-manage')
-                , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
-                parent.layer.msg("请选择要开启的项");
-            } else {
-                var ids = "";
-                $.each(data, function (index, value) {
-                    ids += data[index].Id + ",";
-                });
-                ids = ids.substring(0, ids.length - 1);
-                var index = layer.confirm('确定要开启吗?', function (index) {
-                    $.ajax({
-                        type: "POST",
-                        url: "/Admin/SetMerchantTypeRecord/Open?r=" + Math.random(1),
-                        data: "Id=" + ids,
-                        dataType: "text",
-                        success: function (data) {
-                            layer.close(index);
-                            if (data == "success") {
-                                table.reload('LAY-list-manage');
-                            } else {
-                                layer.msg(data);
-                            }
-                        }
-                    });
-                });
-            }
-        }
-        , Close: function () {
-            var checkStatus = table.checkStatus('LAY-list-manage')
-                , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
-                parent.layer.msg("请选择要关闭的项");
-            } else {
-                var ids = "";
-                $.each(data, function (index, value) {
-                    ids += data[index].Id + ",";
-                });
-                ids = ids.substring(0, ids.length - 1);
-                var index = layer.confirm('确定要关闭吗?', function (index) {
-                    $.ajax({
-                        type: "POST",
-                        url: "/Admin/SetMerchantTypeRecord/Close?r=" + Math.random(1),
-                        data: "Id=" + ids,
-                        dataType: "text",
-                        success: function (data) {
-                            layer.close(index);
-                            if (data == "success") {
-                                table.reload('LAY-list-manage');
-                            } else {
-                                layer.msg(data);
-                            }
-                        }
-                    });
-                });
-            }
-        }
-    };
-
-    $('.layui-btn').on('click', function () {
-        var type = $(this).data('type');
-        active[type] ? active[type].call(this) : '';
-    });
-});

+ 77 - 102
wwwroot/layuiadmin/modules_main/StoreBalance_Admin.js

@@ -1,4 +1,4 @@
-var ExcelData, ExcelKind;
+var ExcelData,ExcelKind;
 function ConfirmImport() {
     $.ajax({
         type: "POST",
@@ -31,49 +31,49 @@ layui.config({
     //- 筛选条件-日期
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
-        elem: '#CreateDate',
-        type: 'date',
-        range: true,
-        trigger: 'click',
-        change: function (value, date, endDate) {
-            var op = true;
-            if (date.year == endDate.year && endDate.month - date.month <= 1) {
-                if (endDate.month - date.month == 1 && endDate.date > date.date) {
-                    op = false;
-                    layCreateDate.hint('日期范围请不要超过1个月');
-                    setTimeout(function () {
-                        $(".laydate-btns-confirm").addClass("laydate-disabled");
-                    }, 1);
-                }
-            } else {
-                op = false;
-                layCreateDate.hint('日期范围请不要超过1个月');
-                setTimeout(function () {
-                    $(".laydate-btns-confirm").addClass("laydate-disabled");
-                }, 1);
-            }
-            if (op) {
-                $('#CreateDate').val(value);
-            }
-        }
-    });
+elem: '#CreateDate',
+type: 'date',
+range: true,
+trigger: 'click',
+change: function (value, date, endDate) {
+var op = true;
+if (date.year == endDate.year && endDate.month - date.month <= 1) {
+if (endDate.month - date.month == 1 && endDate.date > date.date) {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+} else {
+op = false;
+layCreateDate.hint('日期范围请不要超过1个月');
+setTimeout(function () {
+$(".laydate-btns-confirm").addClass("laydate-disabled");
+}, 1);
+}
+if (op) {
+$('#CreateDate').val(value);
+}
+}
+});
 
 
     //excel导入
-    excel = layui.excel;
+    excel = layui.excel;        
     $('#ExcelFile').change(function (e) {
         var files = e.target.files;
-        excel.importExcel(files, {}, function (data) {
+        excel.importExcel(files, { }, function (data) {
             ExcelData = data[0].sheet1;
         });
     });
 
     //监听单元格编辑
-    table.on('edit(LAY-list-manage)', function (obj) {
+    table.on('edit(LAY-list-manage)', function(obj){
         var value = obj.value //得到修改后的值
-            , data = obj.data //得到所在行所有键值
-            , field = obj.field; //得到字段
-        if (field == "Sort") {
+        ,data = obj.data //得到所在行所有键值
+        ,field = obj.field; //得到字段
+        if(field == "Sort"){
             $.ajax({
                 type: "POST",
                 url: "/Admin/StoreBalance/Sort?r=" + Math.random(1),
@@ -84,30 +84,30 @@ layui.config({
             });
         }
     });
-
+    
     //列表数据
     table.render({
         elem: '#LAY-list-manage'
         , url: '/Admin/StoreBalance/IndexData' //模拟接口
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
-            , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
-            , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
-            , { field: 'TransRecordNo', width: 200, title: '交易流水编号', sort: true }
-            , { field: 'TransType', width: 200, title: '交易类型', sort: true }
-            , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
-            , { field: 'OpStoreNum', width: 200, title: '操作库存数', sort: true }
-            , { field: 'OpSymbol', width: 200, title: '操作符', sort: true }
-            , { field: 'BeforeTotalNum', width: 200, title: '操作前总库存数', sort: true }
-            , { field: 'AfterTotalNum', width: 200, title: '操作后总库存数', sort: true }
-            , { field: 'BeforeLaveNum', width: 200, title: '操作前剩余库存数', sort: true }
-            , { field: 'AfterLaveNum', width: 200, title: '操作后剩余库存数', sort: true }
-            , { field: 'BeforeOutNum', width: 200, title: '操作前出库数', sort: true }
-            , { field: 'AfterOutNum', width: 200, title: '操作后出库数', sort: true }
-            , { field: 'CreateDate', width: 200, title: '操作时间', sort: true }
+            ,{field:'StoreIdStoreNo', width: 200, title:'仓库编号', sort: true}
+            ,{field:'StoreIdStoreName', width: 200, title:'仓库名称', sort: true}
+            ,{field:'TransRecordNo', width: 200, title:'交易流水编号', sort: true}
+            ,{field:'TransType', width: 200, title:'交易类型', sort: true}
+            ,{field:'BrandId', width: 200, title:'产品类型', sort: true}
+            ,{field:'OpStoreNum', width: 200, title:'操作库存数', sort: true}
+            ,{field:'OpSymbol', width: 200, title:'操作符', sort: true}
+            ,{field:'BeforeTotalNum', width: 200, title:'操作前总库存数', sort: true}
+            ,{field:'AfterTotalNum', width: 200, title:'操作后总库存数', sort: true}
+            ,{field:'BeforeLaveNum', width: 200, title:'操作前剩余库存数', sort: true}
+            ,{field:'AfterLaveNum', width: 200, title:'操作后剩余库存数', sort: true}
+            ,{field:'BeforeOutNum', width: 200, title:'操作前出库数', sort: true}
+            ,{field:'AfterOutNum', width: 200, title:'操作后出库数', sort: true}
+            ,{field:'CreateDate', width: 200, title:'操作时间', sort: true}
         ]]
         , where: {
-
+            
         }
         , page: true
         , limit: 30
@@ -133,7 +133,7 @@ layui.config({
                     data: "Id=" + data.Id,
                     dataType: "text",
                     success: function (data) {
-                        if (data == "success") {
+                        if (data == "success") {                            
                             obj.del();
                             layer.close(index);
                         } else {
@@ -156,20 +156,20 @@ layui.config({
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () {
+                    setTimeout(function () { 
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });
+                        });                        
                     }, 300);
 
-
-
-
-
+                    
+                    
+                    
+                    
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -180,7 +180,7 @@ layui.config({
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-
+                        
                         $.ajax({
                             type: "POST",
                             url: "/Admin/StoreBalance/Edit?r=" + Math.random(1),
@@ -273,20 +273,20 @@ layui.config({
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () {
+                    setTimeout(function () { 
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });
+                        });                        
                     }, 300);
 
-
-
-
-
+                    
+                    
+                    
+                    
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -297,7 +297,7 @@ layui.config({
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-
+                        
                         $.ajax({
                             type: "POST",
                             url: "/Admin/StoreBalance/Add?r=" + Math.random(1),
@@ -340,48 +340,23 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/StoreBalance/ExportExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/StoreBalance/QuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/StoreBalance/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
             });
         }
         , Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
+            if(data.length < 1){
                 parent.layer.msg("请选择要开启的项");
-            } else {
+            }else{
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
@@ -408,9 +383,9 @@ layui.config({
         , Close: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
+            if(data.length < 1){
                 parent.layer.msg("请选择要关闭的项");
-            } else {
+            }else{
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";

+ 10 - 35
wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js

@@ -341,41 +341,16 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/StoreHouseAmountRecord/ExportsExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //         window.location.reload();
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/StoreHouseAmountRecord/QuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/StoreHouseAmountRecord/ExportsExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                    window.location.reload();
+                }
             });
         }
         , BatchSetting: function () {

+ 10 - 35
wwwroot/layuiadmin/modules_main/StoreHouseStat_Admin.js

@@ -555,41 +555,16 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/StoreHouse/StatExportExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //         layer.close(loadindex);
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/StoreHouse/StatQuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/StoreHouse/StatExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                    layer.close(loadindex);
+                }
             });
         },
         Open: function () {

+ 40 - 12
wwwroot/layuiadmin/modules_main/ToChargeBackRecord_Admin.js

@@ -170,6 +170,9 @@ layui.config({
         , height: 'full-220'
         , text: '对不起,加载出现异常!'
         , done: function (res, curr, count) {
+            $("#SuccessAmount").text(res.other.SuccessAmount);
+            $("#WaitAmount").text(res.other.WaitAmount);
+            $("#StopAmount").text(res.other.StopAmount);
             $(".layui-none").text("无数据");
         }
     });
@@ -194,7 +197,7 @@ layui.config({
                     }
                 });
             });
-        }else if (obj.event === 'Break') {
+        } else if (obj.event === 'Break') {
             var index = layer.confirm('确定要暂停扣款吗?', function (index) {
                 $.ajax({
                     type: "POST",
@@ -211,7 +214,7 @@ layui.config({
                     }
                 });
             });
-        }else if (obj.event === 'Start') {
+        } else if (obj.event === 'Start') {
             var index = layer.confirm('确定要恢复扣款吗?', function (index) {
                 $.ajax({
                     type: "POST",
@@ -228,7 +231,7 @@ layui.config({
                     }
                 });
             });
-        }else if (obj.event === 'edit') {
+        } else if (obj.event === 'edit') {
             var tr = $(obj.tr);
             var perContent = layer.open({
                 type: 2
@@ -452,15 +455,40 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            $.ajax({
-                type: "GET",
-                url: "/Admin/ToChargeBackRecord/ExportExcel?r=" + Math.random(1),
-                data: userdata,
-                dataType: "json",
-                success: function (data) {
-                    data.Obj.unshift(data.Fields);
-                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
-                }
+            // $.ajax({
+            //     type: "GET",
+            //     url: "/Admin/ToChargeBackRecord/ExportExcel?r=" + Math.random(1),
+            //     data: userdata,
+            //     dataType: "json",
+            //     success: function (data) {
+            //         data.Obj.unshift(data.Fields);
+            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
+            //     }
+            // });
+            var index = layer.confirm('确定导出吗?', function (index) {
+                var indexs = layer.load(1, {
+                    shade: [0.5, '#000']
+                });
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/ToChargeBackRecord/QuickExportExcelDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == "success") {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg('导出成功,请到我的下载中点击下载文件', {
+                                time: 1000
+                            }, function () {
+                                window.location.reload();
+                            });
+                        } else {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg(data);
+                        }
+                    }
+                });
             });
         }
         , Open: function () {

+ 9 - 34
wwwroot/layuiadmin/modules_main/UserAccountRecord_Admin.js

@@ -385,40 +385,15 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/UserAccountRecord/ExportExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/UserAccountRecord/QuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/UserAccountRecord/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
             });
         }
         , Open: function () {

+ 9 - 34
wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js

@@ -550,40 +550,15 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/UserCashRecord/LeaderExportExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/UserCashRecord/LeaderQuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/UserCashRecord/LeaderExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
             });
         },
         Open: function () {

+ 9 - 34
wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

@@ -581,40 +581,15 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            // $.ajax({
-            //     type: "GET",
-            //     url: "/Admin/UserCashRecord/ExportExcel?r=" + Math.random(1),
-            //     data: userdata,
-            //     dataType: "json",
-            //     success: function (data) {
-            //         data.Obj.unshift(data.Fields);
-            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
-            //     }
-            // });
-            var index = layer.confirm('确定导出吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/UserCashRecord/UserQuickExportExcelDo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('导出成功,请到我的下载中点击下载文件', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data);
-                        }
-                    }
-                });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/UserCashRecord/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
             });
         },
         BatchSetting: function () {