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

Merge branch 'DuGuYangDo' into DuGuYang

# Conflicts:
#	Areas/Admin/Controllers/MainServer/SysToolsController.cs
#	Areas/Admin/Views/MainServer/SysTools/ChangeSignQuan.cshtml
#	Areas/Admin/Views/MainServer/SysTools/ChangeSignSn.cshtml
#	Areas/Admin/Views/MainServer/SysTools/Loop.cshtml
#	wwwroot/layuiadmin/modules_main/SysTools_Admin.js
“DuGuYang” 4 лет назад
Родитель
Сommit
7fa0981978

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

@@ -58,7 +58,6 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("OrderNo", "1");
 
-            Fields.Add("CreateDate", "3"); //时间
 
 
             string condition = " and Status>-1";

+ 420 - 0
Areas/Admin/Controllers/MainServer/PosCouponsController.cs

@@ -0,0 +1,420 @@
+/*
+ * 机具券变更记录
+ */
+
+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 PosCouponsController : BaseController
+    {
+        public PosCouponsController(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(PosCoupons data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询机具券列表
+
+        /// <summary>
+        /// 机具券列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(PosCoupons data, string CreateDateData, string UseDateData, string UserIdMakerCode, string LeaderIdMakerCode, string ExchangeCode, string IsUseSelect, string IsLockSelect, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("OrderNo", "1"); //单号
+
+
+            string condition = " and Status>-1";
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //盟主创客编号
+            if (!string.IsNullOrEmpty(LeaderIdMakerCode))
+            {
+                condition += " and LeaderUserId in (select UserId from UserForRealName where RealName='" + LeaderIdMakerCode + "')";
+            }
+            //兑换码
+            if (!string.IsNullOrEmpty(ExchangeCode))
+            {
+                condition += " and ExchangeCode =" + ExchangeCode;
+            }
+            //是否使用
+            if (!string.IsNullOrEmpty(IsUseSelect))
+            {
+                condition += " and IsUse =" + IsUseSelect;
+            }
+            //是否锁定
+            if (!string.IsNullOrEmpty(IsLockSelect))
+            {
+                condition += " and IsLock=" + IsLockSelect;
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate >='" + start + " 00:00:00' and CreateDate <='" + end + " 23:59:59'";
+            }
+
+            if (!string.IsNullOrEmpty(UseDateData))
+            {
+                string[] datelist = UseDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and UseDate >='" + start + " 00:00:00' and UseDate <='" + end + " 23:59:59'";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCoupons", 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)
+            {
+                //创客信息
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users fromuserid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdMakerCode"] = fromuserid_Users.MakerCode;
+                dic["UserIdRealName"] = fromuserid_Users.RealName;
+                dic.Remove("UserId");
+
+                //盟主创客信息
+                int LeaderUserId = int.Parse(function.CheckInt(dic["LeaderUserId"].ToString()));
+                Users leaderuserid_Users = db.Users.FirstOrDefault(m => m.Id == LeaderUserId) ?? new Users();
+                dic["LeaderUserIdMakerCode"] = leaderuserid_Users.MakerCode;
+                dic["LeaderUserIdRealName"] = leaderuserid_Users.RealName;
+                dic.Remove("LeaderUserId");
+
+                //是否使用
+                int IsUse = int.Parse(dic["IsUse"].ToString());
+                if (IsUse == 0) dic["IsUse"] = "否";
+                if (IsUse == 1) dic["IsUse"] = "是";
+
+                //是否锁定
+                int IsLock = int.Parse(dic["IsLock"].ToString());
+                if (IsLock == 0) dic["IsLock"] = "否";
+                if (IsLock == 1) dic["IsLock"] = "是";
+
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+        #region 增加机具券变更记录
+
+        /// <summary>
+        /// 增加或修改机具券变更记录信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Add(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 增加机具券变更记录
+
+        /// <summary>
+        /// 增加或修改机具券变更记录信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Add(PosCoupons data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("PosCoupons", Fields, 0);
+            AddSysLog(data.Id.ToString(), "PosCoupons", "add");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 修改机具券变更记录
+
+        /// <summary>
+        /// 增加或修改机具券变更记录信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Edit(string right, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            PosCoupons editData = db.PosCoupons.FirstOrDefault(m => m.Id == Id) ?? new PosCoupons();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改机具券变更记录
+
+        /// <summary>
+        /// 增加或修改机具券变更记录信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(PosCoupons data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosCoupons", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "PosCoupons", "update");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除机具券变更记录信息
+
+        /// <summary>
+        /// 删除机具券变更记录信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosCoupons", "del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosCoupons", Fields, id);
+            }
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 开启
+
+        /// <summary>
+        /// 开启
+        /// </summary>
+        /// <returns></returns>
+        public string Open(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosCoupons", "open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosCoupons", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 关闭
+
+        /// <summary>
+        /// 关闭
+        /// </summary>
+        /// <returns></returns>
+        public string Close(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosCoupons", "close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosCoupons", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("PosCoupons", Sort, Id);
+
+            AddSysLog(Id.ToString(), "PosCoupons", "sort");
+            return "success";
+        }
+        #endregion
+
+        #region 导入数据
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Import(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+
+                db.PosCoupons.Add(new PosCoupons()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "PosCoupons", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(PosCoupons data, string FromUserIdMakerCode, string FromUserIdRealName, string ToUserIdMakerCode, string ToUserIdRealName, string ChangeKindSelect)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("OrderNo", "1"); //单号
+
+
+            string condition = " and Status>-1";
+            //来源创客创客编号
+            if (!string.IsNullOrEmpty(FromUserIdMakerCode))
+            {
+                condition += " and FromUserId in (select FromUserId from UserForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+            }
+            //来源创客真实姓名
+            if (!string.IsNullOrEmpty(FromUserIdRealName))
+            {
+                condition += " and FromUserId in (select FromUserId from UserForRealName where RealName='" + FromUserIdRealName + "')";
+            }
+            //目标创客创客编号
+            if (!string.IsNullOrEmpty(ToUserIdMakerCode))
+            {
+                condition += " and ToUserId in (select ToUserId from UserForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+            }
+            //目标创客真实姓名
+            if (!string.IsNullOrEmpty(ToUserIdRealName))
+            {
+                condition += " and ToUserId in (select ToUserId from UserForRealName where RealName='" + ToUserIdRealName + "')";
+            }
+            //变更类型
+            if (!string.IsNullOrEmpty(ChangeKindSelect))
+            {
+                condition += " and ChangeKind=" + ChangeKindSelect;
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCoupons", Fields, "Id desc", "0", 1, 20000, condition, "FromUserId,ToUserId,OrderNo,BeforeStock,BeforeTotal,BeforeOut,AfterStock,AfterTotal,AfterOut,ChangeCount,ChangeKind", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //来源创客
+                int FromUserId = int.Parse(function.CheckInt(dic["FromUserId"].ToString()));
+                Users fromuserid_Users = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
+                dic["FromUserIdMakerCode"] = fromuserid_Users.MakerCode;
+                dic["FromUserIdRealName"] = fromuserid_Users.RealName;
+                dic.Remove("FromUserId");
+                //目标创客
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users touserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["ToUserIdMakerCode"] = touserid_Users.MakerCode;
+                dic["ToUserIdRealName"] = touserid_Users.RealName;
+                dic.Remove("ToUserId");
+
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+            ReturnFields.Add("FromUserIdMakerCode", "来源创客创客编号");
+            ReturnFields.Add("FromUserIdRealName", "来源创客真实姓名");
+            ReturnFields.Add("ToUserIdMakerCode", "目标创客创客编号");
+            ReturnFields.Add("ToUserIdRealName", "目标创客真实姓名");
+            ReturnFields.Add("OrderNo", "单号");
+            ReturnFields.Add("BeforeStock", "变更前机具券库存");
+            ReturnFields.Add("BeforeTotal", "变更前机具券总数");
+            ReturnFields.Add("BeforeOut", "变更前机具券使用数");
+            ReturnFields.Add("AfterStock", "变更后机具券库存");
+            ReturnFields.Add("AfterTotal", "变更后机具券总数");
+            ReturnFields.Add("AfterOut", "变更后机具券使用数");
+            ReturnFields.Add("ChangeCount", "变更数量");
+            ReturnFields.Add("ChangeKind", "变更类型");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "PosCoupons", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 195 - 39
Areas/Admin/Controllers/MainServer/PosMerchantInfoController.cs

@@ -51,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 商户列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(PosMerchantInfo data, string MakerCode, string RealName, string MerMakerCode, string StoreNo, string StoreName, string MerStatusSelect, string ActiveStatusSelect, string ActTypeSelect, string MerUserTypeSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(PosMerchantInfo data, string MerIdcardNo, string MerchantName, string MakerCode, string RealName, string MerMakerCode, string StoreNo, string StoreName, string MerStatusSelect, string ActiveStatusSelect, string ActTypeSelect, string MerUserTypeSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -66,6 +66,161 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("TopUserId", "0"); //顶级创客
 
             string condition = " and Status>-1";
+            //身份证号
+            if (!string.IsNullOrEmpty(MerIdcardNo))
+            {
+                condition += " and MerchantName like '%" + MerIdcardNo + "%'";
+            }
+            //商户姓名
+            if (!string.IsNullOrEmpty(MerchantName))
+            {
+                condition += " and MerchantName like '%" + MerchantName + "%'";
+            }
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
+            }
+            //创客名称
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
+            }
+            //商户创客编号
+            if (!string.IsNullOrEmpty(MerMakerCode))
+            {
+                condition += " and MerUserId in (select UserId from UserForMakerCode where MakerCode='" + MerMakerCode + "')";
+            }
+            //仓库编号
+            if (!string.IsNullOrEmpty(StoreNo))
+            {
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreNo + "')";
+            }
+            //仓库名称
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreName + "')";
+            }
+            //商户状态
+            if (!string.IsNullOrEmpty(MerStatusSelect))
+            {
+                condition += " and MerStatus=" + MerStatusSelect;
+            }
+            //商户激活状态
+            if (!string.IsNullOrEmpty(ActiveStatusSelect))
+            {
+                condition += " and ActiveStatus=" + ActiveStatusSelect;
+            }
+            //激活类型
+            if (!string.IsNullOrEmpty(ActTypeSelect))
+            {
+                condition += " and ActType=" + ActTypeSelect;
+            }
+            //商户创客类型
+            if (!string.IsNullOrEmpty(MerUserTypeSelect))
+            {
+                condition += " and MerUserType=" + MerUserTypeSelect;
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMerchantInfo", 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)
+            {
+                //直属创客
+                int UserId = int.Parse(dic["UserId"].ToString());
+                Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["MakerCode"] = puser.MakerCode;
+                dic["RealName"] = puser.RealName;
+                //顶级创客
+                int TopUserId = int.Parse(dic["TopUserId"].ToString());
+                Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
+                dic["TopMakerCode"] = tuser.MakerCode;
+                dic["TopRealName"] = tuser.RealName;
+                //商户创客
+                int MerUserId = int.Parse(dic["MerUserId"].ToString());
+                Users muser = db.Users.FirstOrDefault(m => m.Id == MerUserId) ?? new Users();
+                dic["MerMakerCode"] = muser.MakerCode;
+                dic["MerRealName"] = muser.RealName;
+                //申请创客
+                int SnApplyUserId = int.Parse(dic["SnApplyUserId"].ToString());
+                Users snuser = db.Users.FirstOrDefault(m => m.Id == SnApplyUserId) ?? new Users();
+                dic["SnApplyMakerCode"] = snuser.MakerCode;
+                dic["SnApplyRealName"] = snuser.RealName;
+                //SN仓库
+                int SnStoreId = int.Parse(dic["SnStoreId"].ToString());
+                StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == SnStoreId) ?? new StoreHouse();
+                dic["StoreNo"] = store.StoreNo;
+                dic["StoreName"] = store.StoreName;
+                //机具类型
+                int SnType = int.Parse(dic["SnType"].ToString());
+                if (SnType == 0) dic["SnType"] = "购买机具";
+                if (SnType == 1) dic["SnType"] = "赠送机具";
+                //返利资格
+                dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
+                //激活类型
+                int ActType = int.Parse(dic["ActType"].ToString());
+                if (ActType == 0) dic["ActType"] = "正常激活";
+                if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
+                if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
+                if (ActType == 3) dic["ActType"] = "循环机划拨激活";
+                //商户状态
+                int MerStatus = int.Parse(dic["MerStatus"].ToString());
+                if (MerStatus == 0) dic["MerStatus"] = "正常";
+                if (MerStatus == 1) dic["MerStatus"] = "冻结";
+                if (MerStatus == 2) dic["MerStatus"] = "关闭";
+                //商户激活状态
+                int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
+                if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
+                if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
+                if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
+                //商户创客类型
+                int MerUserType = int.Parse(dic["MerUserType"].ToString());
+                if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
+                if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        #region 列表
+        public IActionResult List(PosMerchantInfo data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 列表
+        public JsonResult ListData(PosMerchantInfo data, string MerIdcardNo, string MerchantName, string MakerCode, string RealName, string MerMakerCode, string StoreNo, string StoreName, string MerStatusSelect, string ActiveStatusSelect, string ActTypeSelect, string MerUserTypeSelect, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("BrandId", "1");
+            Fields.Add("MerchantNo", "1"); //商户编号
+            Fields.Add("MerchantName", "1"); //商户姓名
+            Fields.Add("MerchantMobile", "1"); //商户手机号
+            Fields.Add("KqMerNo", "1"); //快钱商户编码
+            Fields.Add("KqSnNo", "1"); //快钱SN号
+            Fields.Add("KqRegTime", "3"); //渠道注册时间
+            Fields.Add("TopUserId", "0"); //顶级创客
+
+            string condition = " and Status>-1";
+            //身份证号
+            if (!string.IsNullOrEmpty(MerIdcardNo))
+            {
+                condition += " and MerchantName like '%" + MerIdcardNo + "%'";
+            }
+            //商户姓名
+            if (!string.IsNullOrEmpty(MerchantName))
+            {
+                condition += " and MerchantName like '%" + MerchantName + "%'";
+            }
             //创客编号
             if (!string.IsNullOrEmpty(MakerCode))
             {
@@ -92,22 +247,22 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreName + "')";
             }
             //商户状态
-            if(!string.IsNullOrEmpty(MerStatusSelect))
+            if (!string.IsNullOrEmpty(MerStatusSelect))
             {
                 condition += " and MerStatus=" + MerStatusSelect;
             }
             //商户激活状态
-            if(!string.IsNullOrEmpty(ActiveStatusSelect))
+            if (!string.IsNullOrEmpty(ActiveStatusSelect))
             {
                 condition += " and ActiveStatus=" + ActiveStatusSelect;
             }
             //激活类型
-            if(!string.IsNullOrEmpty(ActTypeSelect))
+            if (!string.IsNullOrEmpty(ActTypeSelect))
             {
                 condition += " and ActType=" + ActTypeSelect;
             }
             //商户创客类型
-            if(!string.IsNullOrEmpty(MerUserTypeSelect))
+            if (!string.IsNullOrEmpty(MerUserTypeSelect))
             {
                 condition += " and MerUserType=" + MerUserTypeSelect;
             }
@@ -143,36 +298,37 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["StoreName"] = store.StoreName;
                 //机具类型
                 int SnType = int.Parse(dic["SnType"].ToString());
-                if(SnType == 0) dic["SnType"] = "购买机具";
-                if(SnType == 1) dic["SnType"] = "赠送机具";
+                if (SnType == 0) dic["SnType"] = "购买机具";
+                if (SnType == 1) dic["SnType"] = "赠送机具";
                 //返利资格
                 dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
                 //激活类型
                 int ActType = int.Parse(dic["ActType"].ToString());
-                if(ActType == 0) dic["ActType"] = "正常激活";
-                if(ActType == 1) dic["ActType"] = "首次已激活MPOS";
-                if(ActType == 2) dic["ActType"] = "首次已激活KPOS";
-                if(ActType == 3) dic["ActType"] = "循环机划拨激活";
+                if (ActType == 0) dic["ActType"] = "正常激活";
+                if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
+                if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
+                if (ActType == 3) dic["ActType"] = "循环机划拨激活";
                 //商户状态
                 int MerStatus = int.Parse(dic["MerStatus"].ToString());
-                if(MerStatus == 0) dic["MerStatus"] = "正常";
-                if(MerStatus == 1) dic["MerStatus"] = "冻结";
-                if(MerStatus == 2) dic["MerStatus"] = "关闭";
+                if (MerStatus == 0) dic["MerStatus"] = "正常";
+                if (MerStatus == 1) dic["MerStatus"] = "冻结";
+                if (MerStatus == 2) dic["MerStatus"] = "关闭";
                 //商户激活状态
                 int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
-                if(ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
-                if(ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
-                if(ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
+                if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
+                if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
+                if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
                 //商户创客类型
                 int MerUserType = int.Parse(dic["MerUserType"].ToString());
-                if(MerUserType == 0) dic["MerUserType"] = "非商户型创客";
-                if(MerUserType == 1) dic["MerUserType"] = "商户型创客";
+                if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
+                if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
             }
             return Json(obj);
         }
 
         #endregion
 
+
         #region 增加商户
 
         /// <summary>
@@ -413,22 +569,22 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreName + "')";
             }
             //商户状态
-            if(!string.IsNullOrEmpty(MerStatusSelect))
+            if (!string.IsNullOrEmpty(MerStatusSelect))
             {
                 condition += " and MerStatus=" + MerStatusSelect;
             }
             //商户激活状态
-            if(!string.IsNullOrEmpty(ActiveStatusSelect))
+            if (!string.IsNullOrEmpty(ActiveStatusSelect))
             {
                 condition += " and ActiveStatus=" + ActiveStatusSelect;
             }
             //激活类型
-            if(!string.IsNullOrEmpty(ActTypeSelect))
+            if (!string.IsNullOrEmpty(ActTypeSelect))
             {
                 condition += " and ActType=" + ActTypeSelect;
             }
             //商户创客类型
-            if(!string.IsNullOrEmpty(MerUserTypeSelect))
+            if (!string.IsNullOrEmpty(MerUserTypeSelect))
             {
                 condition += " and MerUserType=" + MerUserTypeSelect;
             }
@@ -464,30 +620,30 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["StoreName"] = store.StoreName;
                 //机具类型
                 int SnType = int.Parse(dic["SnType"].ToString());
-                if(SnType == 0) dic["SnType"] = "购买机具";
-                if(SnType == 1) dic["SnType"] = "赠送机具";
+                if (SnType == 0) dic["SnType"] = "购买机具";
+                if (SnType == 1) dic["SnType"] = "赠送机具";
                 //返利资格
                 dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
                 //激活类型
                 int ActType = int.Parse(dic["ActType"].ToString());
-                if(ActType == 0) dic["ActType"] = "正常激活";
-                if(ActType == 1) dic["ActType"] = "首次已激活MPOS";
-                if(ActType == 2) dic["ActType"] = "首次已激活KPOS";
-                if(ActType == 3) dic["ActType"] = "循环机划拨激活";
+                if (ActType == 0) dic["ActType"] = "正常激活";
+                if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
+                if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
+                if (ActType == 3) dic["ActType"] = "循环机划拨激活";
                 //商户状态
                 int MerStatus = int.Parse(dic["MerStatus"].ToString());
-                if(MerStatus == 0) dic["MerStatus"] = "正常";
-                if(MerStatus == 1) dic["MerStatus"] = "冻结";
-                if(MerStatus == 2) dic["MerStatus"] = "关闭";
+                if (MerStatus == 0) dic["MerStatus"] = "正常";
+                if (MerStatus == 1) dic["MerStatus"] = "冻结";
+                if (MerStatus == 2) dic["MerStatus"] = "关闭";
                 //商户激活状态
                 int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
-                if(ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
-                if(ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
-                if(ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
+                if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
+                if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
+                if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
                 //商户创客类型
                 int MerUserType = int.Parse(dic["MerUserType"].ToString());
-                if(MerUserType == 0) dic["MerUserType"] = "非商户型创客";
-                if(MerUserType == 1) dic["MerUserType"] = "商户型创客";
+                if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
+                if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
                 dic.Remove("UserId");
                 dic.Remove("TopUserId");
                 dic.Remove("MerUserId");
@@ -548,7 +704,7 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
         #region 同步交易额
-        
+
         [HttpPost]
         public string SycnTradeAmountDo(DateTime sdate, DateTime edate, int MerchantId)
         {
@@ -557,7 +713,7 @@ namespace MySystem.Areas.Admin.Controllers
                 return "时间间隔不能超过1个月";
             }
             if (edate >= DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"))
-            { 
+            {
                 return "结束时间只能是今天之前";
             }
             string check = RedisDbconn.Instance.Get<string>("ResetMerchantTradeQueue:" + MerchantId);

+ 541 - 0
Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

@@ -0,0 +1,541 @@
+/*
+ * 商户
+ */
+
+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 PosMerchantInfoListController : BaseController
+    {
+        public PosMerchantInfoListController(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(PosMerchantInfo data, string right, string BrandId)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.BrandId = BrandId;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询商户列表
+
+        /// <summary>
+        /// 商户列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(PosMerchantInfo data, string MerIdcardNo, string MerchantName, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            string condition = " and Status>-1";
+            //身份证号
+            if (!string.IsNullOrEmpty(MerIdcardNo))
+            {
+                condition += " and MerchantName like '%" + MerIdcardNo + "%'";
+            }
+            //商户姓名
+            if (!string.IsNullOrEmpty(MerchantName))
+            {
+                condition += " and MerchantName like '%" + MerchantName + "%'";
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMerchantInfo", 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)
+            {
+                //直属创客
+                int UserId = int.Parse(dic["UserId"].ToString());
+                Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["MakerCode"] = puser.MakerCode;
+                dic["RealName"] = puser.RealName;
+                //顶级创客
+                int TopUserId = int.Parse(dic["TopUserId"].ToString());
+                Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
+                dic["TopMakerCode"] = tuser.MakerCode;
+                dic["TopRealName"] = tuser.RealName;
+                //商户创客
+                int MerUserId = int.Parse(dic["MerUserId"].ToString());
+                Users muser = db.Users.FirstOrDefault(m => m.Id == MerUserId) ?? new Users();
+                dic["MerMakerCode"] = muser.MakerCode;
+                dic["MerRealName"] = muser.RealName;
+                //申请创客
+                int SnApplyUserId = int.Parse(dic["SnApplyUserId"].ToString());
+                Users snuser = db.Users.FirstOrDefault(m => m.Id == SnApplyUserId) ?? new Users();
+                dic["SnApplyMakerCode"] = snuser.MakerCode;
+                dic["SnApplyRealName"] = snuser.RealName;
+                //SN仓库
+                int SnStoreId = int.Parse(dic["SnStoreId"].ToString());
+                StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == SnStoreId) ?? new StoreHouse();
+                dic["StoreNo"] = store.StoreNo;
+                dic["StoreName"] = store.StoreName;
+                //机具类型
+                int SnType = int.Parse(dic["SnType"].ToString());
+                if (SnType == 0) dic["SnType"] = "购买机具";
+                if (SnType == 1) dic["SnType"] = "赠送机具";
+                //返利资格
+                dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
+                //激活类型
+                int ActType = int.Parse(dic["ActType"].ToString());
+                if (ActType == 0) dic["ActType"] = "正常激活";
+                if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
+                if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
+                if (ActType == 3) dic["ActType"] = "循环机划拨激活";
+                //商户状态
+                int MerStatus = int.Parse(dic["MerStatus"].ToString());
+                if (MerStatus == 0) dic["MerStatus"] = "正常";
+                if (MerStatus == 1) dic["MerStatus"] = "冻结";
+                if (MerStatus == 2) dic["MerStatus"] = "关闭";
+                //商户激活状态
+                int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
+                if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
+                if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
+                if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
+                //商户创客类型
+                int MerUserType = int.Parse(dic["MerUserType"].ToString());
+                if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
+                if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        #region 增加商户
+
+        /// <summary>
+        /// 增加或修改商户信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Add(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 增加商户
+
+        /// <summary>
+        /// 增加或修改商户信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Add(PosMerchantInfo data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("PosMerchantInfo", Fields, 0);
+            AddSysLog(data.Id.ToString(), "PosMerchantInfo", "add");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 修改商户
+
+        /// <summary>
+        /// 增加或修改商户信息
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Edit(string right, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            PosMerchantInfo editData = db.PosMerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new PosMerchantInfo();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 修改商户
+
+        /// <summary>
+        /// 增加或修改商户信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public string Edit(PosMerchantInfo data)
+        {
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+
+
+            Fields.Add("SeoTitle", data.SeoTitle);
+            Fields.Add("SeoKeyword", data.SeoKeyword);
+            Fields.Add("SeoDescription", data.SeoDescription);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMerchantInfo", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "PosMerchantInfo", "update");
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 删除商户信息
+
+        /// <summary>
+        /// 删除商户信息
+        /// </summary>
+        /// <returns></returns>
+        public string Delete(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosMerchantInfo", "del");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMerchantInfo", Fields, id);
+            }
+            db.SaveChanges();
+
+            return "success";
+        }
+
+        #endregion
+
+        #region 开启
+
+        /// <summary>
+        /// 开启
+        /// </summary>
+        /// <returns></returns>
+        public string Open(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosMerchantInfo", "open");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMerchantInfo", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 关闭
+
+        /// <summary>
+        /// 关闭
+        /// </summary>
+        /// <returns></returns>
+        public string Close(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "PosMerchantInfo", "close");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 0);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMerchantInfo", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+        #region 排序
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id"></param>
+        public string Sort(int Id, int Sort)
+        {
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("PosMerchantInfo", Sort, Id);
+
+            AddSysLog(Id.ToString(), "PosMerchantInfo", "sort");
+            return "success";
+        }
+        #endregion
+
+        #region 导入数据
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Import(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+
+                db.PosMerchantInfo.Add(new PosMerchantInfo()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+
+                });
+                db.SaveChanges();
+            }
+            AddSysLog("0", "PosMerchantInfo", "Import");
+            return "success";
+        }
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(PosMerchantInfo data, string MakerCode, string RealName, string MerMakerCode, string StoreNo, string StoreName, string MerStatusSelect, string ActiveStatusSelect, string ActTypeSelect, string MerUserTypeSelect)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            Fields.Add("BrandId", "1");
+            Fields.Add("MerchantNo", "1"); //商户编号
+            Fields.Add("MerchantName", "1"); //商户姓名
+            Fields.Add("MerchantMobile", "1"); //商户手机号
+            Fields.Add("KqMerNo", "1"); //快钱商户编码
+            Fields.Add("KqSnNo", "1"); //快钱SN号
+            Fields.Add("KqRegTime", "3"); //渠道注册时间
+            Fields.Add("TopUserId", "0"); //顶级创客
+
+            string condition = " and Status>-1";
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + MakerCode + "')";
+            }
+            //创客名称
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
+            }
+            //商户创客编号
+            if (!string.IsNullOrEmpty(MerMakerCode))
+            {
+                condition += " and MerUserId in (select UserId from UserForMakerCode where MakerCode='" + MerMakerCode + "')";
+            }
+            //仓库编号
+            if (!string.IsNullOrEmpty(StoreNo))
+            {
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreNo + "')";
+            }
+            //仓库名称
+            if (!string.IsNullOrEmpty(RealName))
+            {
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreName + "')";
+            }
+            //商户状态
+            if (!string.IsNullOrEmpty(MerStatusSelect))
+            {
+                condition += " and MerStatus=" + MerStatusSelect;
+            }
+            //商户激活状态
+            if (!string.IsNullOrEmpty(ActiveStatusSelect))
+            {
+                condition += " and ActiveStatus=" + ActiveStatusSelect;
+            }
+            //激活类型
+            if (!string.IsNullOrEmpty(ActTypeSelect))
+            {
+                condition += " and ActType=" + ActTypeSelect;
+            }
+            //商户创客类型
+            if (!string.IsNullOrEmpty(MerUserTypeSelect))
+            {
+                condition += " and MerUserType=" + MerUserTypeSelect;
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMerchantInfo", Fields, "Id desc", "0", 1, 20000, condition, "MerchantNo,MerchantName,MerchantMobile,KqMerNo,KqSnNo,MerStatus,ActiveStatus,UserId,MerUserId,SnType,SnApplyUserId,KqRegTime,ActType,SnStoreId,TopUserId,MerUserType,RebateQual", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //直属创客
+                int UserId = int.Parse(dic["UserId"].ToString());
+                Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["MakerCode"] = puser.MakerCode;
+                dic["RealName"] = puser.RealName;
+                //顶级创客
+                int TopUserId = int.Parse(dic["TopUserId"].ToString());
+                Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
+                dic["TopMakerCode"] = tuser.MakerCode;
+                dic["TopRealName"] = tuser.RealName;
+                //商户创客
+                int MerUserId = int.Parse(dic["MerUserId"].ToString());
+                Users muser = db.Users.FirstOrDefault(m => m.Id == MerUserId) ?? new Users();
+                dic["MerMakerCode"] = muser.MakerCode;
+                dic["MerRealName"] = muser.RealName;
+                //申请创客
+                int SnApplyUserId = int.Parse(dic["SnApplyUserId"].ToString());
+                Users snuser = db.Users.FirstOrDefault(m => m.Id == SnApplyUserId) ?? new Users();
+                dic["SnApplyMakerCode"] = snuser.MakerCode;
+                dic["SnApplyRealName"] = snuser.RealName;
+                //SN仓库
+                int SnStoreId = int.Parse(dic["SnStoreId"].ToString());
+                StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == SnStoreId) ?? new StoreHouse();
+                dic["StoreNo"] = store.StoreNo;
+                dic["StoreName"] = store.StoreName;
+                //机具类型
+                int SnType = int.Parse(dic["SnType"].ToString());
+                if (SnType == 0) dic["SnType"] = "购买机具";
+                if (SnType == 1) dic["SnType"] = "赠送机具";
+                //返利资格
+                dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
+                //激活类型
+                int ActType = int.Parse(dic["ActType"].ToString());
+                if (ActType == 0) dic["ActType"] = "正常激活";
+                if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
+                if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
+                if (ActType == 3) dic["ActType"] = "循环机划拨激活";
+                //商户状态
+                int MerStatus = int.Parse(dic["MerStatus"].ToString());
+                if (MerStatus == 0) dic["MerStatus"] = "正常";
+                if (MerStatus == 1) dic["MerStatus"] = "冻结";
+                if (MerStatus == 2) dic["MerStatus"] = "关闭";
+                //商户激活状态
+                int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
+                if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
+                if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
+                if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
+                //商户创客类型
+                int MerUserType = int.Parse(dic["MerUserType"].ToString());
+                if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
+                if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
+                dic.Remove("UserId");
+                dic.Remove("TopUserId");
+                dic.Remove("MerUserId");
+                dic.Remove("SnApplyUserId");
+                dic.Remove("SnStoreId");
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+            ReturnFields.Add("MerchantNo", "商户编号");
+            ReturnFields.Add("MerchantName", "商户名称");
+            ReturnFields.Add("MerchantMobile", "商户手机号");
+            ReturnFields.Add("KqMerNo", "快钱商户编码");
+            ReturnFields.Add("KqSnNo", "快钱SN号");
+            ReturnFields.Add("SnType", "机具类型");
+            ReturnFields.Add("RebateQual", "返利资格");
+            ReturnFields.Add("ActType", "激活类型");
+            ReturnFields.Add("MerStatus", "商户状态");
+            ReturnFields.Add("ActiveStatus", "商户激活状态");
+            ReturnFields.Add("MerMakerCode", "商户创客编码");
+            ReturnFields.Add("MerRealName", "商户创客名称");
+            ReturnFields.Add("MerUserType", "商户创客类型");
+            ReturnFields.Add("MakerCode", "直属创客编号");
+            ReturnFields.Add("RealName", "直属创客姓名");
+            ReturnFields.Add("TopMakerCode", "顶级创客编码");
+            ReturnFields.Add("TopRealName", "顶级创客名称");
+            ReturnFields.Add("StoreNo", "SN仓库编号");
+            ReturnFields.Add("StoreName", "SN仓库名称");
+            ReturnFields.Add("SnApplyMakerCode", "申请创客编号");
+            ReturnFields.Add("SnApplyRealName", "申请创客姓名");
+            ReturnFields.Add("KqRegTime", "注册时间");
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "PosMerchantInfo", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+
+
+
+
+        #region 同步交易额
+
+        public IActionResult SycnTradeAmount(string right, int Id = 0)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            PosMerchantInfo editData = db.PosMerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new PosMerchantInfo();
+            ViewBag.data = editData;
+            return View();
+        }
+
+        #endregion
+
+        #region 同步交易额
+
+        [HttpPost]
+        public string SycnTradeAmountDo(DateTime sdate, DateTime edate, int MerchantId)
+        {
+            if (sdate.AddMonths(1) < edate)
+            {
+                return "时间间隔不能超过1个月";
+            }
+            if (edate >= DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"))
+            {
+                return "结束时间只能是今天之前";
+            }
+            string check = RedisDbconn.Instance.Get<string>("ResetMerchantTradeQueue:" + MerchantId);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "请稍后再试";
+            }
+            try
+            {
+                RedisDbconn.Instance.AddList("ResetMerchantTradeQueue", MerchantId + "#cut#" + sdate.ToString("yyyy-MM-dd HH:mm:ss") + "#cut#" + edate.ToString("yyyy-MM-dd HH:mm:ss"));
+                RedisDbconn.Instance.Set("ResetMerchantTradeQueue:" + MerchantId, "wait");
+                RedisDbconn.Instance.SetExpire("ResetMerchantTradeQueue:" + MerchantId, 3600);
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计商户的交易额异常");
+                return "同步异常";
+            }
+            return "success";
+        }
+
+        #endregion
+    }
+}

+ 4 - 5
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -242,7 +242,7 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
                             {
-                                UserId = pos.Id, //接收创客
+                                UserId = pos.UserId, //接收创客
                                 MsgType = 2,
                                 Title = "补录成功通知", //标题
                                 Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已经成功补录,请查收。",
@@ -1496,7 +1496,6 @@ namespace MySystem.Areas.Admin.Controllers
             string[] CouponNoList = CouponNos.Split('\n');
             for (int i = 0; i < CouponNoList.Length; i++)
             {
-
             }
             return "success";
         }
@@ -1524,7 +1523,6 @@ namespace MySystem.Areas.Admin.Controllers
             string[] SnNoList = SnNos.Split('\n');
             for (int i = 0; i < SnNoList.Length; i++)
             {
-
             }
             return "success";
         }
@@ -1606,7 +1604,7 @@ namespace MySystem.Areas.Admin.Controllers
 
             if (!string.IsNullOrEmpty(SwapSnExpand))
             {
-                machineApplie = machineApplie.Where(m => m.SwapSnExpand.Contains(SwapSnExpand)).ToList();
+                machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SwapSnExpand)).ToList();
                 foreach (var item in machineApplie)
                 {
                     var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
@@ -1624,7 +1622,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else if (!string.IsNullOrEmpty(SnNos))
             {
-                machineApplie = machineApplie.Where(m => m.SwapSnExpand.Contains(SnNos)).ToList();
+                machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SnNos)).ToList();
                 foreach (var item in machineApplie)
                 {
                     var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
@@ -1642,6 +1640,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
+                machineApplie = db.MachineApply.Where(m => m.Status > -1).ToList();
                 foreach (var item in machineApplie)
                 {
                     var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);

+ 203 - 0
Areas/Admin/Views/MainServer/PosCoupons/Add.cshtml

@@ -0,0 +1,203 @@
+@{
+    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">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+
+</div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+                    
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 205 - 0
Areas/Admin/Views/MainServer/PosCoupons/Edit.cshtml

@@ -0,0 +1,205 @@
+@using MySystem.Models;
+@{PosCouponOrders editData = ViewBag.data as PosCouponOrders;}
+@{
+    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">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        <input type="hidden" name="Id" value="@editData.Id" />
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+
+</div>
+
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        
+        
+        //编辑器
+        KindEditor.ready(function (K) {
+            
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 172 - 0
Areas/Admin/Views/MainServer/PosCoupons/Index.cshtml

@@ -0,0 +1,172 @@
+@{
+    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: 85px !important;
+        }
+
+        .layui-inline {
+            margin-right: 0px !important;
+        }
+
+        .w100 {
+            width: 100px !important;
+        }
+
+        .ml50 {
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">交易日期</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                            autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">使用时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="UseDateData" id="UseDate"
+                                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="UserIdMakerCode" 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="LeaderIdMakerCode" 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="ExchangeCode" id="ExchangeCode"
+                                autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">是否使用</label>
+                        <div class="layui-input-inline">
+                            <select id="ChangeKindSelect" name="IsUseSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="0">否</option>
+                                <option value="1">是</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">是否锁定</label>
+                        <div class="layui-input-inline">
+                            <select id="ChangeKindSelect" name="IsLockSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="0">否</option>
+                                <option value="1">是</option>
+                            </select>
+                        </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">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i
+                            class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i
+                            class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                </div>
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                    }
+                </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/PosCoupons_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 79 - 0
Areas/Admin/Views/MainServer/PosMerchantInfoList/Index.cshtml

@@ -0,0 +1,79 @@
+@{
+    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: 85px !important;
+        }
+        .layui-inline{
+            margin-right: 0px !important;
+        }        
+        .w100{
+            width: 100px !important;
+        }
+        .ml50{
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">身份证号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="MerIdcardNo" 
+                                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="MerchantName" 
+                                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>
+                        @if (RightInfo.Contains("," + right + "_export,"))
+                        {
+                            <button class="layui-btn" data-type="ExportExcel">
+                                <i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出
+                            </button>
+                        }
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/PosMerchantInfoList_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+</body>
+</html>

+ 4 - 0
Areas/Admin/Views/MainServer/SysTools/ChangeSignQuan.cshtml

@@ -34,7 +34,11 @@
                                     <label class="layui-form-label">机具券</label>
                                     <div class="layui-input-block">
                                         <textarea class="layui-textarea" lay-verify="required|" name="OldSn" id="OldSn"
+<<<<<<< HEAD
                                             placeholder="请输入原机具SN,多个SN用回车隔开"></textarea>
+=======
+                                            placeholder="请输入机具SN,多个SN用回车隔开"></textarea>
+>>>>>>> DuGuYangDo
                                     </div>
                                 </div>
                                 <div class="layui-form-item">

+ 4 - 0
Areas/Admin/Views/MainServer/SysTools/ChangeSignSn.cshtml

@@ -34,7 +34,11 @@
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-block">
                                         <textarea class="layui-textarea" lay-verify="required|" name="OldSn" id="OldSn"
+<<<<<<< HEAD
                                             placeholder="请输入原机具SN,多个SN用回车隔开"></textarea>
+=======
+                                            placeholder="请输入机具SN,多个SN用回车隔开"></textarea>
+>>>>>>> DuGuYangDo
                                     </div>
                                 </div>
                                 <div class="layui-form-item">

+ 17 - 0
Areas/Admin/Views/MainServer/SysTools/Loop.cshtml

@@ -47,13 +47,21 @@
                         <div class="layui-inline">
                             <label class="layui-form-label">来源机具SN</label>
                             <div class="layui-input-inline">
+<<<<<<< HEAD
                                 <input class="layui-input" type="text" name="ComeSn" id="ComeSn" autocomplete="off">
+=======
+                                <input class="layui-input" type="text" name="SwapSnExpand" id="SwapSnExpand" autocomplete="off">
+>>>>>>> DuGuYangDo
                             </div>
                         </div>
                         <div class="layui-inline">
                             <label class="layui-form-label">发货机具SN</label>
                             <div class="layui-input-inline">
+<<<<<<< HEAD
                                 <input class="layui-input" type="text" name="SendSn" id="SendSn" autocomplete="off">
+=======
+                                <input class="layui-input" type="text" name="SnNos" id="SnNos" autocomplete="off">
+>>>>>>> DuGuYangDo
                             </div>
                         </div>
                     </div>
@@ -61,8 +69,17 @@
             </div>
 
             <div class="layui-card-body">
+<<<<<<< HEAD
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                 <script type="text/html" id="MakerCodeTpl">
+=======
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="imgTpl">
+                    <img style="display: inline-block; width: 50%; height: 100%;" src={{ d.avatar }}>
+                </script>
+                <script type="text/html" id="Loop">
+>>>>>>> DuGuYangDo
                     <a lay-href="/Admin/SysTools/Loop?right=@right&SwapSnExpand=@("{{d.SnNos}}")" lay-text="发货机信息" style="color: #428bca;">{{d.SwapSnExpand}}</a>
                     <a lay-href="/Admin/SysTools/Loop?right=@right&SnNos=@("{{d.SwapSnExpand}}")" lay-text="申请机信息" style="color: #428bca;">{{d.SnNos}}</a>
                 </script>

+ 5 - 0
appsettings.json

@@ -8,7 +8,12 @@
   },
   "AllowedHosts": "*",
   "Setting": {
+    "AppKey": "",
+    "AppId": "",
+    "CheckUrl": "",
     "ConnectionStrings": "",
+    "WebServiceUrl": "",
+    "DbSchemeUrl": "",
     "Host": "http://test.bs.kexiaoshuang.com/",
     "Database": "KxsMainServer",
     "SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;",

+ 62 - 62
wwwroot/layuiadmin/modules_main/PosCouponRecord_Admin.js

@@ -1,4 +1,4 @@
-var ExcelData,ExcelKind;
+var ExcelData, ExcelKind;
 function ConfirmImport() {
     $.ajax({
         type: "POST",
@@ -31,49 +31,49 @@ layui.config({
     //- 筛选条件-日期
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
-elem: '#CreateDate',
-type: 'datetime',
-range: true,
-trigger: 'click',
-change: function (value, date, endDate) {
-var op = true;
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
-op = false;
-layCreateDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-} else {
-op = false;
-layCreateDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-if (op) {
-$('#CreateDate').val(value);
-}
-}
-});
+        elem: '#CreateDate',
+        type: 'datetime',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
 
 
     //excel导入
-    excel = layui.excel;        
+    excel = layui.excel;
     $('#ExcelFile').change(function (e) {
         var files = e.target.files;
-        excel.importExcel(files, { }, function (data) {
+        excel.importExcel(files, {}, function (data) {
             ExcelData = data[0].sheet1;
         });
     });
 
     //监听单元格编辑
-    table.on('edit(LAY-list-manage)', function(obj){
+    table.on('edit(LAY-list-manage)', function (obj) {
         var value = obj.value //得到修改后的值
-        ,data = obj.data //得到所在行所有键值
-        ,field = obj.field; //得到字段
-        if(field == "Sort"){
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
             $.ajax({
                 type: "POST",
                 url: "/Admin/PosCouponRecord/Sort?r=" + Math.random(1),
@@ -84,22 +84,22 @@ $('#CreateDate').val(value);
             });
         }
     });
-    
+
     //列表数据
     table.render({
         elem: '#LAY-list-manage'
         , url: '/Admin/PosCouponRecord/IndexData' //模拟接口
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
-    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
-            ,{field:'PosCouponId', width: 200, title:'机具券Id', sort: true}
-,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
-,{field:'FromUserIdMakerCode', width: 200, title:'来源创客创客编号', sort: true}
-,{field:'FromUserIdRealName', width: 200, title:'来源创客真实姓名', sort: true}
-,{field:'ToUserIdMakerCode', width: 200, title:'目标创客创客编号', sort: true}
-,{field:'ToUserIdRealName', width: 200, title:'目标创客真实姓名', sort: true}
-,{field:'OrderNo', width: 200, title:'单号', sort: true}
-,{field:'ChangeKind', width: 200, title:'变更类型', sort: true}
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'PosCouponId', width: 200, title: '机具券兑换码', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'FromUserIdMakerCode', width: 200, title: '来源创客创客编号', sort: true }
+            , { field: 'FromUserIdRealName', width: 200, title: '来源创客真实姓名', sort: true }
+            , { field: 'ToUserIdMakerCode', width: 200, title: '目标创客创客编号', sort: true }
+            , { field: 'ToUserIdRealName', width: 200, title: '目标创客真实姓名', sort: true }
+            , { field: 'OrderNo', width: 200, title: '单号', sort: true }
+            , { field: 'ChangeKind', width: 200, title: '变更类型', sort: true }
 
             // , {field:'Sort', fixed: 'right', title:'排序', width:80, edit: 'text'}
             // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
@@ -127,7 +127,7 @@ $('#CreateDate').val(value);
                     data: "Id=" + data.Id,
                     dataType: "text",
                     success: function (data) {
-                        if (data == "success") {                            
+                        if (data == "success") {
                             obj.del();
                             layer.close(index);
                         } else {
@@ -150,20 +150,20 @@ $('#CreateDate').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    setTimeout(function () {
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });                        
+                        });
                     }, 300);
 
-                    
-                    
-                    
-                    
+
+
+
+
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -174,7 +174,7 @@ $('#CreateDate').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/PosCouponRecord/Edit?r=" + Math.random(1),
@@ -267,20 +267,20 @@ $('#CreateDate').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    setTimeout(function () {
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });                        
+                        });
                     }, 300);
 
-                    
-                    
-                    
-                    
+
+
+
+
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -291,7 +291,7 @@ $('#CreateDate').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/PosCouponRecord/Add?r=" + Math.random(1),
@@ -348,9 +348,9 @@ $('#CreateDate').val(value);
         , Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要开启的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
@@ -377,9 +377,9 @@ $('#CreateDate').val(value);
         , Close: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要关闭的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";

+ 92 - 92
wwwroot/layuiadmin/modules_main/PosCoupons_Admin.js

@@ -1,4 +1,4 @@
-var ExcelData,ExcelKind;
+var ExcelData, ExcelKind;
 function ConfirmImport() {
     $.ajax({
         type: "POST",
@@ -31,76 +31,76 @@ layui.config({
     //- 筛选条件-日期
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
-elem: '#CreateDate',
-type: 'datetime',
-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);
-}
-}
-});
-var layUseDate = laydate.render({
-elem: '#UseDate',
-trigger: 'click',
-type: 'datetime',
-range: true,
-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;
-layUseDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-} else {
-op = false;
-layUseDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-if (op) {
-$('#UseDate').val(value);
-}
-}
-});
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+    var layUseDate = laydate.render({
+        elem: '#UseDate',
+        trigger: 'click',
+        type: 'datetime',
+        range: true,
+        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;
+                    layUseDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layUseDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#UseDate').val(value);
+            }
+        }
+    });
 
 
     //excel导入
-    excel = layui.excel;        
+    excel = layui.excel;
     $('#ExcelFile').change(function (e) {
         var files = e.target.files;
-        excel.importExcel(files, { }, function (data) {
+        excel.importExcel(files, {}, function (data) {
             ExcelData = data[0].sheet1;
         });
     });
 
     //监听单元格编辑
-    table.on('edit(LAY-list-manage)', function(obj){
+    table.on('edit(LAY-list-manage)', function (obj) {
         var value = obj.value //得到修改后的值
-        ,data = obj.data //得到所在行所有键值
-        ,field = obj.field; //得到字段
-        if(field == "Sort"){
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
             $.ajax({
                 type: "POST",
                 url: "/Admin/PosCoupons/Sort?r=" + Math.random(1),
@@ -111,27 +111,27 @@ $('#UseDate').val(value);
             });
         }
     });
-    
+
     //列表数据
     table.render({
         elem: '#LAY-list-manage'
         , url: '/Admin/PosCoupons/IndexData' //模拟接口
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
-    		, {field:'Id', fixed: 'left', title:'ID', width:80, sort: true, unresize: true}
-            ,{field:'UserIdMakerCode', width: 200, title:'创客创客编号', sort: true}
-,{field:'UserIdRealName', width: 200, title:'创客真实姓名', sort: true}
-,{field:'CreateDate', width: 200, title:'创建时间', sort: true}
-,{field:'ExchangeCode', width: 200, title:'兑换码', sort: true}
-,{field:'IsUseName', width: 200, title:'是否使用', sort: true}
-,{field:'IsLockName', width: 200, title:'是否锁定', sort: true}
-,{field:'UseDate', width: 200, title:'使用时间', sort: true}
-
-            , {field:'Sort', fixed: 'right', title:'排序', width:80, edit: 'text'}
-            , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客创客编号', sort: true }
+            , { field: 'UserIdRealName', width: 200, title: '创客真实姓名', sort: true }
+            , { field: 'LeaderUserIdMakerCode', width: 200, title: '盟主编号', sort: true }
+            , { field: 'LeaderUserIdRealName', width: 200, title: '盟主真实姓名', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'ExchangeCode', width: 200, title: '兑换码', sort: true }
+            , { field: 'IsUseName', width: 200, title: '是否使用', sort: true }
+            , { field: 'IsLockName', width: 200, title: '是否锁定', sort: true }
+            , { field: 'UseDate', width: 200, title: '使用时间', sort: true }
+            // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {
-            
+
         }
         , page: true
         , limit: 30
@@ -153,7 +153,7 @@ $('#UseDate').val(value);
                     data: "Id=" + data.Id,
                     dataType: "text",
                     success: function (data) {
-                        if (data == "success") {                            
+                        if (data == "success") {
                             obj.del();
                             layer.close(index);
                         } else {
@@ -176,20 +176,20 @@ $('#UseDate').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    setTimeout(function () {
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });                        
+                        });
                     }, 300);
 
-                    
-                    
-                    
-                    
+
+
+
+
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -200,7 +200,7 @@ $('#UseDate').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/PosCoupons/Edit?r=" + Math.random(1),
@@ -293,20 +293,20 @@ $('#UseDate').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    setTimeout(function () {
                         layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
                             var errObj = $(this).find('.layui-form-danger');
                             if (errObj.length > 0) {
                                 iframeWindow.element.tabChange('mytabbar', String(i + 1));
                                 submit.click();
                             }
-                        });                        
+                        });
                     }, 300);
 
-                    
-                    
-                    
-                    
+
+
+
+
 
                     //监听提交
                     iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
@@ -317,7 +317,7 @@ $('#UseDate').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/PosCoupons/Add?r=" + Math.random(1),
@@ -374,9 +374,9 @@ $('#UseDate').val(value);
         , Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要开启的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
@@ -403,9 +403,9 @@ $('#UseDate').val(value);
         , Close: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要关闭的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";

+ 496 - 0
wwwroot/layuiadmin/modules_main/PosMerchantInfoList_Admin.js

@@ -0,0 +1,496 @@
+var ExcelData;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/PosMerchantInfo/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);
+            }
+        }
+    });
+    var layKqRegTime = laydate.render({
+        elem: '#KqRegTime',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        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;
+                    layKqRegTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layKqRegTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#KqRegTime').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/PosMerchantInfo/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+    
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/PosMerchantInfoList/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            ,{field:'MerchantNo', width: 200, title:'商户编号', sort: true}
+            ,{field:'MerIdcardNo', width: 200, title:'身份证号', sort: true}
+            ,{field:'MerchantName', width: 200, title:'商户名称', sort: true}
+            ,{field:'MerchantMobile', width: 200, title:'商户手机号', sort: true}
+            ,{field:'KqMerNo', width: 200, title:'快钱商户编码', sort: true}
+            ,{field:'KqSnNo', width: 200, title:'快钱SN号', sort: true}
+            ,{field:'SnType', width: 200, title:'机具类型', sort: true}
+            ,{field:'RebateQual', width: 200, title:'返利资格', sort: true}
+            ,{field:'ActType', width: 200, title:'激活类型', sort: true}
+            ,{field:'MerStatus', width: 200, title:'商户状态', sort: true}
+            ,{field:'ActiveStatus', width: 200, title:'商户激活状态', sort: true}
+            ,{field:'MerMakerCode', width: 200, title:'商户创客编码', sort: true}
+            ,{field:'MerRealName', width: 200, title:'商户创客名称', sort: true}
+            ,{field:'MerUserType', width: 200, title:'商户创客类型', sort: true}
+            ,{field:'MakerCode', width: 200, title:'直属创客编号', sort: true}
+            ,{field:'RealName', width: 200, title:'直属创客姓名', sort: true}
+            ,{field:'StoreNo', width: 200, title:'SN仓库编号', sort: true}
+            ,{field:'StoreName', width: 200, title:'SN仓库名称', sort: true}
+            ,{field:'SnApplyMakerCode', width: 200, title:'申请创客编号', sort: true}
+            ,{field:'SnApplyRealName', width: 200, title:'申请创客姓名', sort: true}
+            , { field: 'KqRegTime', width: 200, title: '注册时间', sort: true }
+            , { title: '操作', width: 120, align: 'left', toolbar: '#table-list-tools', fixed: 'right' }
+        ]]
+        , 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/PosMerchantInfo/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/PosMerchantInfo/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);
+        } else if (obj.event === 'sycntrade') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '同步交易额'
+                , content: 'SycnTradeAmount?Id=' + data.Id
+                , maxmin: false
+                , area: ['550px', '700px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    //监听提交
+                    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({});
+                        var loadindex = layer.load(1, {
+                            shade: [0.5, '#000']
+                        });
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/PosMerchantInfo/SycnTradeAmountDo?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(loadindex); //关闭弹层
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    layer.alert('重置程序已启动,请稍后核对商户交易额');
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+        }
+    });
+
+
+    //监听搜索
+    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/PosMerchantInfo/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/PosMerchantInfo/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 () {
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '180px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+        }
+        , 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/PosMerchantInfo/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/PosMerchantInfo/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/PosMerchantInfo/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) : '';
+    });
+});

+ 40 - 0
wwwroot/layuiadmin/modules_main/PosMerchantInfo_Admin.js

@@ -154,6 +154,46 @@ layui.config({
         }
     });
 
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manages'
+        , url: '/Admin/PosMerchantInfo/ListData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            ,{field:'MerchantNo', width: 200, title:'商户编号', sort: true}
+            ,{field:'MerIdcardNo', width: 200, title:'身份证号', sort: true}
+            ,{field:'MerchantName', width: 200, title:'商户名称', sort: true}
+            ,{field:'MerchantMobile', width: 200, title:'商户手机号', sort: true}
+            ,{field:'KqMerNo', width: 200, title:'快钱商户编码', sort: true}
+            ,{field:'KqSnNo', width: 200, title:'快钱SN号', sort: true}
+            ,{field:'SnType', width: 200, title:'机具类型', sort: true}
+            ,{field:'RebateQual', width: 200, title:'返利资格', sort: true}
+            ,{field:'ActType', width: 200, title:'激活类型', sort: true}
+            ,{field:'MerStatus', width: 200, title:'商户状态', sort: true}
+            ,{field:'ActiveStatus', width: 200, title:'商户激活状态', sort: true}
+            ,{field:'MerMakerCode', width: 200, title:'商户创客编码', sort: true}
+            ,{field:'MerRealName', width: 200, title:'商户创客名称', sort: true}
+            ,{field:'MerUserType', width: 200, title:'商户创客类型', sort: true}
+            ,{field:'MakerCode', width: 200, title:'直属创客编号', sort: true}
+            ,{field:'RealName', width: 200, title:'直属创客姓名', sort: true}
+            ,{field:'StoreNo', width: 200, title:'SN仓库编号', sort: true}
+            ,{field:'StoreName', width: 200, title:'SN仓库名称', sort: true}
+            ,{field:'SnApplyMakerCode', width: 200, title:'申请创客编号', sort: true}
+            ,{field:'SnApplyRealName', width: 200, title:'申请创客姓名', sort: true}
+            , { field: 'KqRegTime', width: 200, title: '注册时间', sort: true }
+            , { title: '操作', width: 120, align: 'left', toolbar: '#table-list-tools', fixed: 'right' }
+        ]]
+        , 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;

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

@@ -8,8 +8,13 @@ table.render({
         , { field: 'OrderNo', width: 200, title: '订单号', sort: true }
         , { field: 'MakerCode', width: 200, title: '创客编号', sort: true }
         , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
+<<<<<<< HEAD
         , { field: 'ComeSn', width: 200, title: '来源机具SN', sort: true, templet: '#MakerCodeTpl' }
         , { field: 'SendSn', width: 200, title: '发货SN', sort: true, templet: '#MakerCodeTpl' }
+=======
+        , { field: 'ComeSn', width: 200, title: '来源机具SN', sort: true, templet: '#Loop' }
+        , { field: 'SendSn', width: 200, title: '发货SN', sort: true, templet: '#Loop' }
+>>>>>>> DuGuYangDo
         , { field: 'CreateDate', width: 200, title: '申请时间', sort: true }
         , { field: 'Status', width: 200, title: '申请状态', sort: true }
         , { title: '操作', width: 1500, align: 'left', toolbar: '#table-list-tools' }