Просмотр исходного кода

Merge branch 'feature-dgy-第一批新式导出功能' into feature-dgy-后台测试

# Conflicts:
#	Areas/Admin/Controllers/MainServer/SetMerchantTypeRecordController.cs
#	Areas/Admin/Controllers/MainServer/SysToolsController.cs
#	Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
#	Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml
#	Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml
#	Models/WebCMSEntities.cs
#	wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js
DuGuYang 3 лет назад
Родитель
Сommit
4bda882cb1
23 измененных файлов с 1658 добавлено и 940 удалено
  1. 115 2
      Areas/Admin/Controllers/MainServer/OrdersController.cs
  2. 61 0
      Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs
  3. 115 115
      Areas/Admin/Controllers/MainServer/SetMerchantTypeRecordController.cs
  4. 53 0
      Areas/Admin/Controllers/MainServer/StoreBalanceController.cs
  5. 62 0
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  6. 122 60
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  7. 1 0
      Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
  8. 302 58
      Areas/Admin/Controllers/MainServer/UserCashRecordController.cs
  9. 6 84
      Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs
  10. 1 1
      Areas/Admin/Controllers/MainServer/UserRankWhiteController.cs
  11. 133 133
      Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml
  12. 2 2
      Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml
  13. 1 0
      Areas/Admin/Views/MainServer/UserCashRecord/Cash.cshtml
  14. 0 1
      Models/WebCMSEntities.cs
  15. 34 9
      wwwroot/layuiadmin/modules_main/Orders_Admin.js
  16. 35 10
      wwwroot/layuiadmin/modules_main/PreCardAmountRecord_Admin.js
  17. 408 408
      wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js
  18. 34 9
      wwwroot/layuiadmin/modules_main/StoreBalance_Admin.js
  19. 35 10
      wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js
  20. 35 10
      wwwroot/layuiadmin/modules_main/StoreHouseStat_Admin.js
  21. 34 9
      wwwroot/layuiadmin/modules_main/UserAccountRecord_Admin.js
  22. 34 9
      wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js
  23. 35 10
      wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

+ 115 - 2
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -71,7 +71,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
             // string condition = " and Status>=-1 and  Status<4";
-            string condition = " and Status>=-1";
+            string condition = " and Status>=-1 and Sort=0";
             //平台订单号
             if (!string.IsNullOrEmpty(OrderNo))
             {
@@ -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 and Sort=0";
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
@@ -1276,6 +1276,119 @@ 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)

+ 61 - 0
Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs

@@ -319,6 +319,67 @@ 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 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>

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

@@ -1,115 +1,115 @@
-/*
- * 设置商户型创客记录
- */
-
-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
-
-    }
-}
+/*
+ * 设置商户型创客记录
+ */
+
+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
+
+    }
+}

+ 53 - 0
Areas/Admin/Controllers/MainServer/StoreBalanceController.cs

@@ -430,5 +430,58 @@ 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
+
     }
 }

+ 62 - 0
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -641,6 +641,68 @@ 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 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>

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

@@ -1454,7 +1454,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 仓库列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult StatDo(string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult StatDo(string MakerCode, string StoreNo, 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,6 +1475,15 @@ 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";
@@ -1505,33 +1514,35 @@ 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");
+            // 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 + "");
 
             int recordcount = list.Rows.Count;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
@@ -1567,7 +1578,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult StatExportExcel(string CreateDateData)
+        public JsonResult StatExportExcel(string MakerCode, string StoreNo, string CreateDateData)
         {
             OtherMySqlConn.connstr = ConfigurationManager.AppSettings["StatSqlConnStr"].ToString();
             string sCreateDate = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00";
@@ -1590,7 +1601,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", "出库(调拨)量");
@@ -1599,6 +1610,16 @@ 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";
@@ -1629,34 +1650,7 @@ 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,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");
-
+            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 + "");
             int recordcount = list.Rows.Count;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
             foreach (DataRow sub in list.Rows)
@@ -1667,7 +1661,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());
@@ -1686,7 +1680,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", "出库(调拨)量");
@@ -1700,6 +1694,74 @@ 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>

+ 1 - 0
Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs

@@ -798,5 +798,6 @@ namespace MySystem.Areas.Admin.Controllers
             return "success";
         }
         #endregion
+
     }
 }

+ 302 - 58
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -639,6 +639,111 @@ 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 盟主提现记录列表
@@ -674,7 +779,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 盟主提现记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult LeaderIndexData(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -704,57 +809,59 @@ 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);
-                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 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 Id =0";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            // 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 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 Id =0";
+            //     }
+            // }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecord", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -801,11 +908,10 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
+        public JsonResult LeaderExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string CreateDateData)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("CashOrderNo", "1"); //提现单号
-            Fields.Add("CreateDate", "3"); //创建时间
 
             string condition = " and Status>-1 and TradeType=3";
             //创客编号
@@ -823,16 +929,59 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and Status=" + StatusSelect;
             }
-            //提交到代付状态
-            if (!string.IsNullOrEmpty(PayStatus))
+            if (!string.IsNullOrEmpty(CreateDateData))
             {
-                int QueryCount = int.Parse(function.CheckInt(PayStatus));
-                if (QueryCount == 2)
-                {
-                    QueryCount = 0;
-                }
-                condition += " and QueryCount=" + QueryCount;
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            // 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 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 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>>;
@@ -884,6 +1033,97 @@ 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>
@@ -1131,6 +1371,10 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             RedisDbconn.Instance.AddList("JkCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
                         }
+                        else if(Channel == 3)
+                        {
+                            RedisDbconn.Instance.AddList("HyfCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
+                        }
                     }
                 }
             }

+ 6 - 84
Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs

@@ -86,48 +86,9 @@ namespace MySystem.Areas.Admin.Controllers
             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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                var checks = db.UserCashRecordForBusiness.Any(m => m.CreateDate <= end);
-                if (check)
-                {
-                    var sId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    condition += "  and Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecordForBusiness.Where(m => m.CreateDate <= end).Max(m => m.Id);
-                    condition += " and Id <=" + eId;
-                }
-            }
-            else
-            {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
-                var check = db.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                if (check)
-                {
-                    var minId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecordForBusiness.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
-                        condition += " and Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and Id =0";
-                }
+                var start = datelist[0];
+                var 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("UserCashRecordForBusiness", Fields, "Id desc", "0", page, limit, condition);
@@ -268,48 +229,9 @@ namespace MySystem.Areas.Admin.Controllers
             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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                var checks = db.UserCashRecordForBusiness.Any(m => m.CreateDate <= end);
-                if (check)
-                {
-                    var sId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    condition += "  and a.Id >=" + sId;
-                }
-                if (checks)
-                {
-                    var eId = db.UserCashRecordForBusiness.Where(m => m.CreateDate <= end).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.UserCashRecordForBusiness.Any(m => m.CreateDate >= start);
-                if (check)
-                {
-                    var minId = db.UserCashRecordForBusiness.Where(m => m.CreateDate >= start).Min(m => m.Id);
-                    var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecordForBusiness.txt");
-                    if (string.IsNullOrEmpty(Info.ToString()))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else if (minId != int.Parse(Info))
-                    {
-                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecordForBusiness.txt", minId.ToString());
-                        condition += " and a.Id >=" + minId;
-                    }
-                    else
-                    {
-                        condition += " and a.Id >=" + Convert.ToInt32(Info);
-                    }
-                }
-                else
-                {
-                    condition += " and a.Id =0";
-                }
+                var start = datelist[0];
+                var end = datelist[1];
+                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
             }
             var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客姓名',a.CashOrderNo '提现单号',a.TradeAmount '提现金额',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '提现时间',a.SeoKeyword '备注',a.CreateMan '操作人' FROM UserCashRecordForBusiness a LEFT JOIN Users b ON a.UserId=b.Id" + condition;
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);

+ 1 - 1
Areas/Admin/Controllers/MainServer/UserRankWhiteController.cs

@@ -552,7 +552,7 @@ namespace MySystem.Areas.Admin.Controllers
                 string end = datelist[1];
                 condition += " and a.UpdateDate>='" + start + " 00:00:00' and a.UpdateDate<='" + end + " 23:59:59'";
             }
-            var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客姓名',b.UserLevel '创客职级',c.MakerCode '上级创客编号',c.RealName ' 上级创客姓名',d.MakerCode '顶级创客编号',d.RealName '顶级创客姓名',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',DATE_FORMAT(a.UpdateDate,'%Y-%m-%d %H:%i:%s') '期时间',a.Rank '预设职级' FROM UserRankWhite a LEFT JOIN Users b ON a.UserId=b.Id LEFT JOIN Users c ON b.ParentUserId=c.Id LEFT JOIN Users d ON SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',4),',',-1)=d.Id" + condition;
+            var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客姓名',b.UserLevel '创客职级',c.MakerCode '上级创客编号',c.RealName ' 上级创客姓名',d.MakerCode '顶级创客编号',d.RealName '顶级创客姓名',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',DATE_FORMAT(a.UpdateDate,'%Y-%m-%d %H:%i:%s') '期时间',a.Rank '预设职级' FROM UserRankWhite a LEFT JOIN Users b ON a.UserId=b.Id LEFT JOIN Users c ON b.ParentUserId=c.Id LEFT JOIN Users d ON SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',4),',',-1)=d.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\"}";

+ 133 - 133
Areas/Admin/Views/MainServer/SetMerchantTypeRecord/Index.cshtml

@@ -1,134 +1,134 @@
-@{
-    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>
-
+@{
+    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>

+ 2 - 2
Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml

@@ -99,9 +99,9 @@
                                     table.reload('LAY-list-manage'); //数据刷新
                                 });
                         }
-                    }
-                });
+                    });
             });
+        });
         }
 
 

+ 1 - 0
Areas/Admin/Views/MainServer/UserCashRecord/Cash.cshtml

@@ -42,6 +42,7 @@
                                     <select id="Channel" name="Channel" lay-search="">
                                         <option value="1">云汇算</option>
                                         <option value="2">金控</option>
+                                        <option value="3">盒子</option>
                                     </select>
                                 </div>
                             </div>

+ 0 - 1
Models/WebCMSEntities.cs

@@ -71,7 +71,6 @@ namespace MySystem.Models
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
         public virtual DbSet<LeaderCompPrize> LeaderCompPrize { get; set; }
-        
         public virtual DbSet<LeaderCompTmp> LeaderCompTmp { get; set; }
         public virtual DbSet<LeaderCompTradeStat> LeaderCompTradeStat { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }

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

@@ -581,15 +581,40 @@ 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');
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         }
         , ExportExcel: function () {

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

@@ -341,16 +341,41 @@ 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();
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         }
         , BatchSetting: function () {

+ 408 - 408
wwwroot/layuiadmin/modules_main/SetMerchantTypeRecord_Admin.js

@@ -1,409 +1,409 @@
-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) : '';
-    });
+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) : '';
+    });
 });

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

@@ -340,15 +340,40 @@ $('#CreateDate').val(value);
             $(".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');
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         }
         , Open: function () {

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

@@ -341,16 +341,41 @@ 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();
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         }
         , BatchSetting: function () {

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

@@ -555,16 +555,41 @@ 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);
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         },
         Open: function () {

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

@@ -385,15 +385,40 @@ 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');
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         }
         , Open: function () {

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

@@ -550,15 +550,40 @@ 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');
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         },
         Open: function () {

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

@@ -581,15 +581,40 @@ 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');
-                }
+            // $.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);
+                        }
+                    }
+                });
             });
         },
         BatchSetting: function () {
@@ -698,7 +723,7 @@ layui.config({
                         title: '提交到代付',
                         content: 'Cash',
                         maxmin: true,
-                        area: ['500px', '250px'],
+                        area: ['500px', '350px'],
                         btn: ['确定', '取消'],
                         yes: function (index, layero) {
                             var iframeWindow = window['layui-layer-iframe' + index],