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

Merge branch 'feature-dgy-后台优化' into DuGuYang

DuGuYang 3 лет назад
Родитель
Сommit
9407bb3346
23 измененных файлов с 2248 добавлено и 10 удалено
  1. 4 0
      AppStart/ExcelHelper.cs
  2. 3 0
      AppStart/RelationClassForConst.cs
  3. 1 0
      Areas/Admin/Controllers/BsServer/BaseController.cs
  4. 263 0
      Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs
  5. 1 0
      Areas/Admin/Controllers/MainServer/StoreChangeHistoryController.cs
  6. 2 0
      Areas/Admin/Controllers/MainServer/StoreStockChangeController.cs
  7. 308 0
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  8. 1 1
      Areas/Admin/Controllers/MainServer/UserCashRecordController.cs
  9. 140 0
      Areas/Admin/Controllers/MainServer/UsersController.cs
  10. 1 1
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs
  11. 140 0
      Areas/Admin/Views/MainServer/PosMachinesTwo/Indexs.cshtml
  12. 1 2
      Areas/Admin/Views/MainServer/SchoolMorningMeet/Add.cshtml
  13. 1 0
      Areas/Admin/Views/MainServer/StoreChangeHistory/Index.cshtml
  14. 1 1
      Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Index.cshtml
  15. 2 0
      Areas/Admin/Views/MainServer/StoreStockChange/Index.cshtml
  16. 263 0
      Areas/Admin/Views/MainServer/SysTools/AddMerchantInfo.cshtml
  17. 276 0
      Areas/Admin/Views/MainServer/SysTools/RefundPosFee.cshtml
  18. 1 1
      Areas/Admin/Views/MainServer/UserAccount/Index.cshtml
  19. 153 0
      Areas/Admin/Views/MainServer/Users/SanIndex.cshtml
  20. 503 0
      wwwroot/layuiadmin/modules_main/PosMachinesTwoTimeOut_Admin.js
  21. 169 0
      wwwroot/layuiadmin/modules_main/SanUsers_Admin.js
  22. 7 2
      wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js
  23. 7 2
      wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

+ 4 - 0
AppStart/ExcelHelper.cs

@@ -1240,6 +1240,10 @@ namespace MySystem
                                             }
 
                                         }
+                                        else
+                                        {
+                                            RedisDbconn.Instance.AddList("ErrList" + checkKey, "提现记录单号为" + CashOrderNo + "不存在或者金额不符");
+                                        }
                                     }
                                     DoCount += Size;
 

+ 3 - 0
AppStart/RelationClassForConst.cs

@@ -129,6 +129,9 @@ namespace MySystem
                 case 125:
                     result = "软件服务费";
                     break;
+                case 126:
+                    result = "机具货款退还";
+                    break;
             }
             return result;
         }

+ 1 - 0
Areas/Admin/Controllers/BsServer/BaseController.cs

@@ -43,6 +43,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         //数据库连接字符串
         public string OpConn = Library.ConfigurationManager.AppSettings["OpSqlConnStr"].ToString();
+        public string SqlConn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         
         public int SysId;
         public int SysRealRole;

+ 263 - 0
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -729,5 +729,268 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+
+        #region 过期机具扣费列表
+
+        /// <summary>
+        /// 根据条件查询过期机具扣费列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Indexs(PosMachinesTwo data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询过期机具扣费列表
+
+        /// <summary>
+        /// 过期机具扣费列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexsData(PosMachinesTwo data, string PosSn, string UserIdMakerCode, string StoreMakerCode, string BrandId, string RecycEndDateData, string AmountYk, string Amountk, string AmountDk, int ShowFlag = 0, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            if (ShowFlag == 0)
+            {
+                Dictionary<string, object> objs = new Dictionary<string, object>();
+
+                Dictionary<string, object> others = new Dictionary<string, object>();
+                others.Add("TotalCount", 0);
+                others.Add("AmountYks", 0);
+                others.Add("AmountDks", 0);
+                objs.Add("other", others);
+                return Json(objs);
+            }
+            decimal AmountYks = 0;//已扣
+            decimal AmountDks = 0;//待扣
+            var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string condition = " and Status>-1 and RecycEndDate<" + time + " and ScanQrTrade>0 and ScanQrTrade<999 and BindingState=0";
+
+            //所属创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and BuyUserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //仓库所属创客编号
+            if (!string.IsNullOrEmpty(StoreMakerCode))
+            {
+                var userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == StoreMakerCode) ?? new UserForMakerCode();
+                var user = db.Users.FirstOrDefault(m => m.Id == userForMakerCode.UserId) ?? new Users();
+                var store = db.StoreHouse.Where(m => m.UserId == user.Id && m.Status > -1).ToList();
+                var storeIds = "";
+                foreach (var item in store)
+                {
+                    storeIds += item.Id + ",";
+                }
+                storeIds = storeIds.TrimEnd(',');
+                condition += " and StoreId in (" + storeIds + ")";
+            }
+            //品牌
+            if (!string.IsNullOrEmpty(BrandId))
+            {
+                condition += " and BrandId =" + BrandId;
+            }
+            if (!string.IsNullOrEmpty(PosSn))
+            {
+                condition += " and PosSn =" + PosSn + "";
+            }
+            // if (!string.IsNullOrEmpty(AmountYk))
+            // {
+            //     condition += " and BrandId =" + BrandId;
+            // }
+            // if (!string.IsNullOrEmpty(Amountk))
+            // {
+            //     condition += " and BrandId =" + BrandId;
+            // }
+            // if (!string.IsNullOrEmpty(AmountDk))
+            // {
+            //     condition += " and BrandId =" + BrandId;
+            // }
+
+            if (!string.IsNullOrEmpty(RecycEndDateData))
+            {
+                string[] datelist = RecycEndDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and RecycEndDate>='" + start + " 00:00:00' and RecycEndDate<='" + end + " 23:59:59'";
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMachinesTwo", 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 BindingState = int.Parse(dic["BindingState"].ToString());
+                if (BindingState == 0) dic["BindingState"] = "未绑定";
+                if (BindingState == 1) dic["BindingState"] = "已绑定";
+                //激活状态
+                int ActivationState = int.Parse(dic["ActivationState"].ToString());
+                if (ActivationState == 0) dic["ActivationState"] = "未激活";
+                if (ActivationState == 1) dic["ActivationState"] = "已激活";
+                //所属创客
+                int BuyUserId = int.Parse(function.CheckInt(dic["BuyUserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == BuyUserId) ?? new Users();
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic.Remove("BuyUserId");
+                //所属仓库
+                int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
+                StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
+                dic["StoreIdCode"] = storeid_StoreHouse.StoreNo;
+                dic["StoreIdName"] = storeid_StoreHouse.StoreName;
+                dic.Remove("StoreId");
+                //产品类型
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                decimal ScanQrTrade = decimal.Parse(dic["ScanQrTrade"].ToString());
+                var brandInfo = dic["BrandId"].ToString();
+                decimal amount = 0;
+                if (brandInfo.Contains("电签"))
+                {
+                    amount = 200;
+                }
+                if (brandInfo.Contains("大POS"))
+                {
+                    amount = 300;
+                }
+                if (ScanQrTrade > 0 && ScanQrTrade < 999)
+                {
+                    dic["AmountYk"] = amount;
+                    dic["Amountk"] = ScanQrTrade;
+                    dic["AmountDk"] = amount - ScanQrTrade;
+                    // AmountYks += ScanQrTrade;
+                    // AmountDks += amount - ScanQrTrade;
+                }
+                if (ScanQrTrade == 999)
+                {
+                    dic["AmountYk"] = amount;
+                    dic["Amountk"] = amount;
+                    dic["AmountDk"] = 0;
+                    // AmountYks += amount;
+                }
+
+                //参加活动
+                dic["ActivityList"] = RelationClass.GetProfitObjectsActivesList(dic["ActivityList"].ToString());
+                //绑定商户
+                int BindMerchantId = int.Parse(function.CheckInt(dic["BindMerchantId"].ToString()));
+                PosMerchantInfo bindmerchantid_MerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == BindMerchantId) ?? new PosMerchantInfo();
+                dic["BindMerchantIdMerchantNo"] = bindmerchantid_MerchantInfo.MerchantNo;
+                dic["BindMerchantIdMerchantName"] = bindmerchantid_MerchantInfo.MerchantName;
+                dic.Remove("BindMerchantId");
+                //机具类型
+                int PosSnType = int.Parse(dic["PosSnType"].ToString());
+                if (PosSnType == 0) dic["PosSnType"] = "购买机具";
+                if (PosSnType == 1) dic["PosSnType"] = "赠送机具";
+                //设备类型
+                string DeviceType = dic["DeviceType"].ToString();
+                if (DeviceType == "KysSignPos") dic["DeviceType"] = "快益刷电签POS";
+                if (DeviceType == "KssSignPos") dic["DeviceType"] = "快闪刷电签POS";
+                if (DeviceType == "") dic["DeviceType"] = "";
+
+                //盟主信息
+                int LeaderUserId = int.Parse(function.CheckInt(dic["LeaderUserId"].ToString()));
+                if (LeaderUserId != 0)
+                {
+                    Users users = db.Users.FirstOrDefault(m => m.Id == LeaderUserId) ?? new Users();
+                    dic["UserInfo"] = users.MakerCode + "_" + users.RealName;
+                }
+
+                //是否为第一台机具
+                int IsFirst = int.Parse(dic["IsFirst"].ToString());
+                if (IsFirst == 0) dic["IsFirst"] = "否";
+                if (IsFirst == 1) dic["IsFirst"] = "是";
+
+                //循环开始时间
+                // if (!string.IsNullOrEmpty(dic["RecycEndDate"].ToString()))
+                // {
+                //     // var RecycStartDate = Convert.ToDateTime(dic["RecycEndDate"].ToString()).AddDays(-360).ToString("yyyy-MM-dd HH:mm:ss");
+                //     // dic["RecycStartDate"] = RecycStartDate;
+                //     string PosSn = dic["PosSn"].ToString();
+                //     bool op = db.StoreChangeHistory.Any(m => m.SnNo == PosSn && m.TransType == 2);
+                //     if(op)
+                //     {
+                //         StoreChangeHistory item = db.StoreChangeHistory.FirstOrDefault(m => m.SnNo == PosSn && m.TransType == 2) ?? new StoreChangeHistory();
+                //         dic["RecycStartDate"] = item.ToDate == null ? "" : item.ToDate.Value.ToString("yyyy-MM-dd");
+                //     }
+                // }
+
+                //实际押金
+                string SeoKeyword = dic["SeoKeyword"].ToString();
+                if (SeoKeyword.Length > 2)
+                {
+                    SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
+                }
+                dic["SeoKeyword"] = SeoKeyword;
+
+                //设置押金
+                string PrizeParams = dic["PrizeParams"].ToString();
+                dic["PrizeParams"] = PrizeParams;
+
+                //所属运营中心
+                int OpId = int.Parse(dic["OpId"].ToString());
+                if (OpId != 0)
+                {
+                    var sys = opdb.SysAdmin.FirstOrDefault(m => m.QueryCount > 0 && m.UserId == OpId) ?? new OpModels.SysAdmin();
+                    dic["OpCode"] = sys.OpCode;
+                }
+
+            }
+            Dictionary<string, object> other = new Dictionary<string, object>();
+            int TotalCount = 0;//总机具数
+            DataTable dt = OtherMySqlConn.dtable("select count(0) from PosMachinesTwo where 1=1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                TotalCount = int.Parse(function.CheckNum(dt.Rows[0][0].ToString()));
+            }
+            DataTable dts = OtherMySqlConn.dtable("select Id from PosMachinesTwo where 1=1" + condition);
+            var Ids = "";
+            foreach (DataRow item in dts.Rows)
+            {
+                Ids += item["Id"].ToString() + ",";
+            }
+            var Id = "," + Ids;
+            var pos = db.PosMachinesTwo.Where(m => Id.Contains("," + m.Id + ",")).ToList();
+            string[] strids = Ids.TrimEnd(',').Split(',');
+            foreach (var items in strids)
+            {
+                int posId = int.Parse(items);
+                var posInfo = pos.FirstOrDefault(m => m.Id == posId) ?? new PosMachinesTwo();
+                decimal ScanQrTrade = decimal.Parse(posInfo.ScanQrTrade.ToString());
+                var brandInfo = RelationClass.GetKqProductBrandInfo(int.Parse(posInfo.BrandId.ToString()));
+                decimal amount = 0;
+                if (brandInfo.Contains("电签"))
+                {
+                    amount = 200;
+                }
+                if (brandInfo.Contains("大POS"))
+                {
+                    amount = 300;
+                }
+                if (ScanQrTrade > 0 && ScanQrTrade < 999)
+                {
+                    AmountYks += ScanQrTrade;
+                    AmountDks += amount - ScanQrTrade;
+                }
+                if (ScanQrTrade == 999)
+                {
+                    AmountYks += amount;
+                }
+            }
+            other.Add("TotalCount", TotalCount);
+            other.Add("AmountYks", AmountYks);
+            other.Add("AmountDks", AmountDks);
+            obj.Add("other", other);
+            return Json(obj);
+        }
+
+        #endregion
+
     }
 }

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

@@ -132,6 +132,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (TransType == 2) dic["TransType"] = "出货";
                 if (TransType == 3) dic["TransType"] = "退货";
                 if (TransType == 4) dic["TransType"] = "驳回";
+                if (TransType == 5) dic["TransType"] = "回仓退款";
                 if (TransType == 0) dic["TransType"] = "采购";
                 //SN机具类型
                 int SnType = int.Parse(dic["SnType"].ToString());

+ 2 - 0
Areas/Admin/Controllers/MainServer/StoreStockChangeController.cs

@@ -141,6 +141,8 @@ namespace MySystem.Areas.Admin.Controllers
                 if (TransType == 2) dic["TransType"] = "出货";
                 if (TransType == 3) dic["TransType"] = "退货";
                 if (TransType == 0) dic["TransType"] = "采购";
+                if (TransType == 4) dic["TransType"] = "驳回";
+                if (TransType == 5) dic["TransType"] = "回仓退款";
                 //库存操作方向
                 int StockOpDirect = int.Parse(dic["StockOpDirect"].ToString());
                 if (StockOpDirect == 0) dic["StockOpDirect"] = "入库";

+ 308 - 0
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -2163,6 +2163,10 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "机具绑定已超过30天,不支持解绑";
             }
+            if (pos.CreditTrade > 0)
+            {
+                return "该机具已交易,无法解绑";
+            }
             if (forMerNo != null)
             {
                 PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
@@ -4204,5 +4208,309 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
+
+        #region 机具回仓退款
+
+        public IActionResult RefundPosFee(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string RefundPosFeeDo(string PosSn, string BackStoreNo, int IsBack = 0)
+        {
+            if (string.IsNullOrEmpty(PosSn))
+            {
+                return "请输入机具SN";
+            }
+            if (IsBack == 1)
+            {
+                if (string.IsNullOrEmpty(BackStoreNo))
+                {
+                    return "请输入仓库编号";
+                }
+            }
+            string[] PosSnList = PosSn.Replace("\r", "").Split('\n');
+            WebCMSEntities db = new WebCMSEntities();
+            DateTime time = DateTime.Parse(DateTime.Now.ToString(("yyyy-MM-dd") + " 00:00:00"));
+            var endTime = time.AddDays(20 - time.Day).AddDays(-60);
+            StoreForCode storeForBack = new StoreForCode();
+            StoreHouse BackStore = new StoreHouse();
+            foreach (var item in PosSnList)
+            {
+                MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == item) ?? new MachineForSnNo();
+                if (machineForSnNo.SnId == 0)
+                {
+                    return "未找到机具" + item + "关联数据";
+                }
+                PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.Status > -1 && m.RecycEndDate < endTime && m.BindingState == 0) ?? new PosMachinesTwo();
+                if (pos.Id == 0)
+                {
+                    return "机具" + item + "不存在或者不满足条件";
+                }
+                if (IsBack == 1)
+                {
+                    storeForBack = db.StoreForCode.FirstOrDefault(m => m.Code == BackStoreNo) ?? new StoreForCode();
+                    if (storeForBack.StoreId == 0)
+                    {
+                        return "未找到" + BackStoreNo + "关联数据";
+                    }
+                    BackStore = db.StoreHouse.FirstOrDefault(m => m.Status > -1 && m.Id == storeForBack.StoreId && m.BrandId == pos.BrandId.ToString()) ?? new StoreHouse();
+                    if (BackStore.Id == 0)
+                    {
+                        return "仓库" + BackStoreNo + "不存在或与机具品牌不符";
+                    }
+                }
+                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == BackStore.UserId) ?? new UserAccount();
+                var refundUserAccount = db.UserAccount.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new UserAccount();
+                var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
+                var amount = 0;
+                if (brandInfo.Name.Contains("电签"))
+                {
+                    amount = 200;
+                }
+                if (brandInfo.Name.Contains("大POS"))
+                {
+                    amount = 300;
+                }
+                if (IsBack == 1)
+                {
+                    userAccount.ValidAmount -= amount;//扣减分仓可用额度
+                    StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
+                    {
+                        CreateDate = DateTime.Now,
+                        CreateMan = SysUserName,
+                        StoreId = pos.StoreId, //出货仓库
+                        BrandId = pos.BrandId, //产品类型
+                        ProductName = RelationClass.GetKqProductBrandInfo(pos.BrandId), //产品名称
+                        TransType = 5, //交易类型
+                        SnNo = item, //SN编号
+                        StockOpDirect = 0, //库存操作方向
+                        SnStatus = 1, //SN状态
+                        DeviceVendor = pos.DeviceName, //设备厂商
+                        DeviceModel = pos.DeviceKind, //设备型号
+                        DeviceType = pos.DeviceType, //设备类型
+                        FromUserId = pos.BuyUserId, //来源创客
+                        ToRemark = "过期机具回仓退款", //入库备注
+                        ToStoreId = BackStore.Id, //退货收货仓库                        
+                        SourceStoreId = pos.SourceStoreId, //源仓库编号
+                        BrandType = pos.DeviceType, //品牌类型
+                    }).Entity;
+
+                    string ChangeNo = "HCTK";
+                    int StoreStockChangeId = stockchange.Id;
+                    string StoreStockChangeIdString = StoreStockChangeId.ToString();
+                    for (int j = 0; j < 18 - StoreStockChangeId.ToString().Length; j++)
+                    {
+                        StoreStockChangeIdString = "0" + StoreStockChangeIdString;
+                    }
+                    ChangeNo += StoreStockChangeIdString;
+                    stockchange.ChangeNo = ChangeNo; //交易流水编号
+                    db.StoreChangeHistory.Add(new StoreChangeHistory()
+                    {
+                        CreateDate = DateTime.Now,
+                        BrandId = pos.BrandId, //产品类型
+                        ChangeRecordNo = ChangeNo, //变更记录单号
+                        TransType = 5, //交易类型
+                        SnNo = item, //SN编号
+                        SnType = pos.PosSnType, //SN机具类型
+                        StockOpDirect = 0, //库存操作方向
+                        DeviceVendor = pos.DeviceName, //设备厂商
+                        DeviceModel = pos.DeviceKind, //设备型号
+                        DeviceType = pos.DeviceType, //设备类型
+                        FromUserId = pos.BuyUserId, //来源创客
+                        ToRemark = "过期机具回仓退款", //入库备注
+                        SourceStoreId = pos.SourceStoreId, //源仓库
+                        StoreId = pos.StoreId, //出货仓库
+                    });
+                    db.MachineReturn.Add(new MachineReturn()
+                    {
+                        CreateDate = DateTime.Now,
+                        Operator = SysUserName + "_" + SysRealName,//操作人
+                        BrandId = pos.BrandId, //产品类型
+                        DeviceSnNos = pos.PosSn,
+                        ToStoreId = BackStore.Id,
+                        ApplyNo = ChangeNo, //变更记录单号
+                        UserId = pos.BuyUserId, //来源创客
+                        Remark = "过期机具回仓退款", //入库备注
+                    });
+
+                    if (pos.ScanQrTrade > 0)
+                    {
+                        decimal ChangeAmount = 0;
+                        decimal BeforeBalanceAmount = 0;
+                        decimal AfterBalanceAmount = 0;
+                        if (pos.ScanQrTrade == 999)
+                        {
+                            refundUserAccount.BalanceAmount += amount;//退还创客机具货款
+                            BeforeBalanceAmount = refundUserAccount.BalanceAmount;
+                            AfterBalanceAmount = refundUserAccount.BalanceAmount + pos.ScanQrTrade;
+                            ChangeAmount = amount;
+                        }
+                        else
+                        {
+                            refundUserAccount.BalanceAmount += pos.ScanQrTrade;//退还创客机具货款
+                            BeforeBalanceAmount = refundUserAccount.BalanceAmount;
+                            AfterBalanceAmount = refundUserAccount.BalanceAmount + pos.ScanQrTrade;
+                            ChangeAmount = pos.ScanQrTrade;
+                        }
+                        db.UserAccountRecord.Add(new UserAccountRecord()
+                        {
+                            CreateDate = DateTime.Now,
+                            UpdateDate = DateTime.Now,
+                            UserId = pos.BuyUserId, //创客
+                            ChangeType = 126, //变动类型(机具货款退还)
+                            ProductType = 0, //产品类型
+                            ChangeAmount = ChangeAmount, //变更金额
+                            BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                            AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                        });
+                    }
+                    var bInfo = BackStore.UserId + "_" + pos.BrandId;
+                    var userMachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == bInfo) ?? new UserMachineData();
+                    userMachineData.TotalMachineCount += 1;
+                    userMachineData.UnBindCount += 1;
+                    BackStore.LaveNum += 1;
+                    BackStore.TotalNum += 1;
+
+                    var fInfo = pos.BuyUserId + "_" + pos.BrandId;
+                    var userMachineDatas = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fInfo) ?? new UserMachineData();
+                    userMachineDatas.TotalMachineCount -= 1;
+                    userMachineDatas.UnBindCount -= 1;
+
+                    pos.StoreId = BackStore.Id;//变更机具所属仓库,重置为仓库机
+                    pos.Status = 1;
+                    pos.QueryCount = 0;
+                    pos.UpdateDate = null;
+                    pos.ActivityList = null;
+                    pos.SeoKeyword = null;
+                    pos.SeoDescription = null;
+                    pos.OrderId = 0;
+                    pos.RecycEndDate = null;
+                    pos.RecycBackCount = 0;
+                    pos.PrizeParams = null;
+                    pos.ScanQrTrade = 0;
+                    pos.BindMerchantId = 0;
+                    pos.CreditTrade = 0;
+                    pos.DebitCardTrade = 0;
+                    pos.IsVip = 0;
+                    pos.UserNav = null;
+                    pos.TransferTime = null;
+                    pos.IsPurchase = 0;
+                    pos.Detail = null;
+                    pos.BindingTime = null;
+                    pos.BindingState = 0;
+                    pos.ActivationTime = null;
+                    pos.ActivationState = 0;
+                    pos.LeaderUserId = 0;
+                    pos.PreUserId = 0;
+                    pos.IsFirst = 0;
+                    pos.DownFeeMan = null;
+                    pos.DownFeeFlag = 0;
+                    pos.DownFeeDate = null;
+                    pos.UpFeeMan = null;
+                    pos.UpFeeFlag = 0;
+                    pos.UpFeeDate = null;
+                    pos.OpReserve1 = 0;
+                    pos.OpReserve2 = 0;
+                    pos.OpReserve3 = 0;
+                    pos.OpId = 0;
+                    pos.RecycStartDate = null;
+                    pos.SourcePosSn = null;
+                    pos.BuyUserId = 0;
+                    pos.UserId = 0;
+                }
+                else
+                {
+                    if (pos.ScanQrTrade > 0)
+                    {
+                        decimal ChangeAmount = 0;
+                        decimal BeforeBalanceAmount = 0;
+                        decimal AfterBalanceAmount = 0;
+                        if (pos.ScanQrTrade == 999)
+                        {
+                            refundUserAccount.BalanceAmount += amount;//退还创客机具货款
+                            BeforeBalanceAmount = refundUserAccount.BalanceAmount;
+                            AfterBalanceAmount = refundUserAccount.BalanceAmount + pos.ScanQrTrade;
+                            ChangeAmount = amount;
+                        }
+                        else
+                        {
+                            refundUserAccount.BalanceAmount += pos.ScanQrTrade;//退还创客机具货款
+                            BeforeBalanceAmount = refundUserAccount.BalanceAmount;
+                            AfterBalanceAmount = refundUserAccount.BalanceAmount + pos.ScanQrTrade;
+                            ChangeAmount = pos.ScanQrTrade;
+                        }
+                        pos.ScanQrTrade = 0;
+                        db.UserAccountRecord.Add(new UserAccountRecord()
+                        {
+                            CreateDate = DateTime.Now,
+                            UpdateDate = DateTime.Now,
+                            UserId = pos.BuyUserId, //创客
+                            ChangeType = 126, //变动类型(机具货款退还)
+                            ProductType = 0, //产品类型
+                            ChangeAmount = ChangeAmount, //变更金额
+                            BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                            AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                        });
+                    }
+                }
+            }
+            db.SaveChanges();
+            return "success";
+        }
+        #endregion
+
+
+
+        #region 添加商户信息
+
+        public IActionResult AddMerchantnfo(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string AddMerchantnfoDo(string PosSn, string MerSn)
+        {
+            if (string.IsNullOrEmpty(PosSn))
+            {
+                return "请输入机具号";
+            }
+            if (string.IsNullOrEmpty(MerSn))
+            {
+                return "请输入商户号";
+            }
+            var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
+            var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
+            var merchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId) ?? new PosMerchantInfo();
+            if (machineForSnNo.SnId == 0)
+            {
+                return "未找到机具" + PosSn + "关联数据";
+            }
+            if (pos.Id == 0)
+            {
+                return "未找到机具" + PosSn;
+            }
+            if (merchantInfo.Id > 0)
+            {
+                return "机具" + PosSn + "以经绑定了商户";
+            }
+            PosMerchantInfo posMerchantInfo = db.PosMerchantInfo.Add(new PosMerchantInfo()
+            {
+                CreateDate = DateTime.Now,
+                UpdateDate= DateTime.Now,
+            }).Entity;
+            return "";
+        }
+        #endregion
+
+
     }
 }

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

@@ -477,7 +477,7 @@ namespace MySystem.Areas.Admin.Controllers
         public string ImportPost(string ExcelPath)
         {
             string key = function.MD5_16(Guid.NewGuid().ToString());
-            RedisDbconn.Instance.AddList("ExcelImportV2", ExcelPath + "#cut#UserCashRecord#cut#" + key + "#cut#" + SysUserName);
+            RedisDbconn.Instance.AddList("ExcelImportV33", ExcelPath + "#cut#UserCashRecord#cut#" + key + "#cut#" + SysUserName);
             return "success|" + key;
         }
         public string CheckImport(string key)

+ 140 - 0
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -2156,5 +2156,145 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         #endregion
+
+
+        #region 伞下创客列表
+
+        /// <summary>
+        /// 根据条件查询伞下创客列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult SanIndex(Users data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            List<Users> TopUsers = db.Users.Where(m => m.ParentUserId == 0).ToList();
+            ViewBag.TopUsers = TopUsers;
+            List<UserLevelSet> Levels = db.UserLevelSet.OrderBy(m => m.Id).ToList();
+            ViewBag.Levels = Levels;
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询伞下创客列表
+
+        /// <summary>
+        /// 伞下创客列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult SanIndexData(Users data, string MakerCode, string IsLeader, string IsOp, string CreateDateData, string UserYsLevel, string UserLevel, int ShowFlag = 0, int page = 1, int limit = 30)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            if (ShowFlag == 0)
+            {
+                Dictionary<string, object> objs = new Dictionary<string, object>();
+                return Json(objs);
+            }
+            string condition = " and Status>-1";
+            //创客编号
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                var userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new UserForMakerCode();
+                if (userForMakerCode.UserId == 0)
+                {
+                    return Json(new AppResultJson() { Status = "-1", Info = "未找到创客" + MakerCode + "关联数据", Data = "" });
+                }
+                var user = db.Users.FirstOrDefault(m => m.Id == userForMakerCode.UserId) ?? new Users();
+                if (user.Id == 0)
+                {
+                    return Json(new AppResultJson() { Status = "-1", Info = "创客" + MakerCode + "不存在", Data = "" });
+                }
+                condition += " and ParentNav like '%," + user.Id + ",%'";
+            }
+            if (!string.IsNullOrEmpty(IsLeader))
+            {
+                condition += " and LeaderLevel=" + IsLeader;
+            }
+            if (!string.IsNullOrEmpty(UserYsLevel))
+            {
+                var UserIds = "";
+                var Rank = int.Parse(UserYsLevel);
+                var list = db.UserRankWhite.Where(m => m.Status > -1 && m.Rank == Rank).ToList();
+                foreach (var item in list)
+                {
+                    UserIds += item.UserId + ",";
+                }
+                UserIds = UserIds.TrimEnd(',');
+                condition += " and Id IN(" + UserIds + ")";
+            }
+            if (!string.IsNullOrEmpty(UserLevel))
+            {
+                condition += " and UserLevel=" + UserLevel;
+            }
+            if (!string.IsNullOrEmpty(IsOp))
+            {
+                var UserIds = "";
+                DataTable dt = CustomerSqlConn.dtable("SELECT UserId FROM SysAdmin WHERE Status>-1 and Sort>0 and QueryCount>0 and AdminName!='admin'", OpConn);
+                foreach (DataRow item in dt.Rows)
+                {
+                    UserIds += item["UserId"].ToString() + ",";
+                }
+                UserIds = UserIds.TrimEnd(',');
+                if (IsOp == "1")
+                {
+                    condition += " and Id IN(" + UserIds + ")";
+                }
+                if (IsOp == "2")
+                {
+                    condition += " and Id NOT IN(" + UserIds + ")";
+                }
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Users", Fields, "Id desc", "True", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                dic["AuthFlagName"] = dic["AuthFlag"].ToString() == "1" ? "已实名" : "未实名";
+                dic["RiskFlagName"] = dic["RiskFlag"].ToString() == "1" ? "已风控" : "未风控";
+                dic["UserLevel"] = RelationClass.GetUserLevelSetInfo(int.Parse(dic["UserLevel"].ToString()));
+                int UserId = int.Parse(dic["Id"].ToString());
+                int ParentUserId = int.Parse(dic["ParentUserId"].ToString());
+                Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
+                dic["ParentMakerCode"] = puser.MakerCode;
+                dic["ParentRealName"] = puser.RealName;
+                var userRankWhite = db.UserRankWhite.FirstOrDefault(m => m.UserId == UserId) ?? new UserRankWhite();
+                dic["UserYsLevel"] = RelationClass.GetUserLevelSetInfo(userRankWhite.Rank);
+                int LeaderLevel = int.Parse(dic["LeaderLevel"].ToString());
+                if (LeaderLevel == 1)
+                {
+                    dic["IsLeader"] = "小盟主";
+                }
+                else if (LeaderLevel == 2)
+                {
+                    dic["IsLeader"] = "大盟主";
+                }
+                else
+                {
+                    dic["IsLeader"] = "";
+                }
+                var sysAdmin = opdb.SysAdmin.FirstOrDefault(m => m.Status > -1 && m.Sort > 0 && m.QueryCount > 0 && m.AdminName != "admin" && m.UserId == UserId) ?? new OpModels.SysAdmin();
+                if (sysAdmin.Id > 0)
+                {
+                    dic["IsOp"] = sysAdmin.OpCode;
+                }
+                else
+                {
+                    dic["IsOp"] = "";
+                }
+                dic["MerchantType"] = RelationClassForConst.GetMerchantTypeInfo(int.Parse(dic["MerchantType"].ToString()));
+            }
+            return Json(obj);
+        }
+
+        #endregion
     }
 }

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

@@ -345,7 +345,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);//设置提现记录为成功
-                Fields.Add("SeoTitle", DateTime.Now);
+                Fields.Add("SeoTitle", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                 new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("UserCashRecord", Fields, id);                
             }
             opdb.SaveChanges();

+ 140 - 0
Areas/Admin/Views/MainServer/PosMachinesTwo/Indexs.cshtml

@@ -0,0 +1,140 @@
+@{
+    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">
+                <input class="layui-input" type="hidden" name="ShowFlag" autocomplete="off">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">SN编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="PosSn" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="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="StoreMakerCode" 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="RecycEndDateData"
+                                id="ActivationTime" placeholder="循环过期时间" autocomplete="off">
+                        </div>
+                    </div>
+                    @{
+                        Dictionary<string, string> ProfitObjectsActivesDic = new MySystem.DictionaryClass().getKqProductBrandDic();
+                    }
+                    <div class="layui-inline">
+                        <label class="layui-form-label">品牌</label>
+                        <div class="layui-input-inline">
+                            <select id="BrandId" name="BrandId" lay-search="">
+                                <option value="">全部...</option>
+                                @foreach (string key in ProfitObjectsActivesDic.Keys)
+                                {
+                                    <option value="@key">@ProfitObjectsActivesDic[key]</option>
+                                }
+                            </select>
+                        </div>
+                    </div>
+                    @* <div class="layui-inline">
+                        <label class="layui-form-label">应扣金额</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="AmountYk" 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="Amountk" 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="AmountDk" 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">
+                <blockquote class="layui-elem-quote layui-text">
+                    总机具(台):<span style="color: #f00;" id="TotalCount">0</span> | 已扣金额(元):<span style="color: #f00;" id="AmountYks">0.00</span> | 待扣金额(元):<span style="color: #f00;" id="AmountDks">0.00</span>
+                </blockquote>
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                </script>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/PosMachinesTwoTimeOut_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 1 - 2
Areas/Admin/Views/MainServer/SchoolMorningMeet/Add.cshtml

@@ -64,8 +64,7 @@
                                     <div class="layui-upload">
                                         <input type="hidden" id="Photo" name="Photo" value="">
                                         <button class="layui-btn" type="button" id="PhotoBtn">选择图片</button>
-                                        <div class="layui-inline layui-word-aux">@(new
-                                            MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetPhoto"))</div>
+                                        <div class="layui-inline layui-word-aux">@(new MySystem.PublicFunction().GetUploadHint("SchoolMorningMeetPhoto"))</div>
                                     </div>
                                     <div style="margin-top:10px;" id="PhotoImage">
                                     </div>

+ 1 - 0
Areas/Admin/Views/MainServer/StoreChangeHistory/Index.cshtml

@@ -98,6 +98,7 @@
                                 <option value="3">退货</option>
                                 <option value="0">采购</option>
                                 <option value="4">驳回</option>
+                                <option value="5">回仓退款</option>
                             </select>
                         </div>
                     </div>

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

@@ -51,7 +51,7 @@
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">创客创客编号</label>
+                        <label class="layui-form-label">创客编号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="UserIdMakerCode" autocomplete="off">
                         </div>

+ 2 - 0
Areas/Admin/Views/MainServer/StoreStockChange/Index.cshtml

@@ -96,6 +96,8 @@
                                 <option value="10">领取</option>
                                 <option value="11">划拨</option>
                                 <option value="13">退货</option>
+                                <option value="4">驳回</option>
+                                <option value="5">回仓退款</option>
                             </select>
                         </div>
                     </div>

+ 263 - 0
Areas/Admin/Views/MainServer/SysTools/AddMerchantInfo.cshtml

@@ -0,0 +1,263 @@
+@{
+    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">
+        <form class="layui-form" id="confirmFrm">
+            <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 class="layui-form-item">
+                                    <label class="layui-form-label">机具SN</label>
+                                    <div class="layui-input-inline">
+                                        <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
+                                            lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">商户编号</label>
+                                    <div class="layui-input-inline">
+                                        <input class="layui-input" type="text" id="MerSn" name="MerSn" maxlength="50"
+                                            lay-verify="required|" autocomplete="off" placeholder="请输入商户编号">
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="layui-form-item ml10">
+                        <div class="layui-input-block">
+                            <button type="button" class="layui-btn" onclick="save()">提交</button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        function save() {
+            var PosSn = $('#PosSn').val();
+            var MerSn = $('#MerSn').val();
+            if (PosSn == '') {
+                layer.msg('请输入机具SN');
+            }
+            else if (MerSn == '') {
+                layer.msg('请输入商户编号');
+            }
+            else {
+                var index = layer.confirm('确定要添加吗?', function (index) {
+                    var indexs = layer.load(1, {
+                        shade: [0.5, '#000']
+                    });
+                    var userdata = $("#confirmFrm").serialize();
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SysTools/AddMerchantnfoDo?r=" + Math.random(1),
+                        data: userdata,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index); //关闭弹层
+                            if (data == "success") {
+                                layer.close(indexs); //关闭弹层
+                                layer.msg('添加成功', {
+                                    time: 1000
+                                }, function () {
+                                    window.location.reload();
+                                });
+                            } else {
+                                layer.close(indexs); //关闭弹层
+                                layer.msg(data, { time: 1000 }, function () {
+                                    window.location.reload();
+                                });
+                            }
+                        }
+                    });
+                });
+            }
+        }
+
+
+        //编辑器
+        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>

+ 276 - 0
Areas/Admin/Views/MainServer/SysTools/RefundPosFee.cshtml

@@ -0,0 +1,276 @@
+@{
+    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">
+        <form class="layui-form" id="confirmFrm">
+            <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 class="layui-form-item">
+                                    <label class="layui-form-label">机具SN</label>
+                                    <div class="layui-input-block">
+                                        <textarea class="layui-textarea" lay-verify="required|" name="PosSn" id="PosSn"
+                                            placeholder="请输入机具SN,多个SN用回车隔开"></textarea>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">是否回仓</label>
+                                    <div class="layui-input-block">
+                                        <input type="checkbox" id="IsBack" name="IsBack" value="1" lay-skin="switch"
+                                            lay-filter="IsBack" title="开关">
+                                    </div>
+                                </div>
+                                <div class="layui-form-item" id="StoreCode" style="display: none;">
+                                    <label class="layui-form-label">退回仓库编号</label>
+                                    <div class="layui-input-inline">
+                                        <input class="layui-input" type="text" id="BackStoreNo" name="BackStoreNo"
+                                            maxlength="50" lay-verify="required|" autocomplete="off"
+                                            placeholder="请输入退回仓库编号">
+                                    </div>
+                                </div>
+                            </div>
+
+                        </div>
+                    </div>
+                    <div class="layui-form-item ml10">
+                        <div class="layui-input-block">
+                            <button type="button" class="layui-btn" onclick="save()">提交</button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        function save() {
+            var index = layer.load(1, {
+                shade: [0.5, '#000']
+            });
+            var PosSn = $('#PosSn').val();
+            var IsBack = $('#IsBack').val();
+            @* var BackStoreNo = $('#BackStoreNo').val(); *@
+            if (PosSn == '') {
+                layer.msg('请输入机具SN');
+            }
+            @* if (IsBack == '1' && BackStoreNo == '') {
+                    layer.msg('请输入退回仓库编号');
+                    } *@
+            var userdata = $("#confirmFrm").serialize();
+            $.ajax({
+                type: "POST",
+                url: "/Admin/SysTools/RefundPosFeeDo?r=" + Math.random(1),
+                data: userdata,
+                dataType: "text",
+                success: function (data) {
+                    layer.close(index); //关闭弹层
+                    if (data == "success") {
+                        layer.msg("退还成功", { time: 1000 }, function () {
+                            window.location.reload();
+                        });
+                    } else {
+                        layer.msg(data, { time: 5000 }, function () {
+                            window.location.reload();
+                        });
+                    }
+                }
+            });
+        }
+
+
+        //编辑器
+        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');
+            });
+
+            form.on('switch(IsBack)', function (data) {
+                console.log(data);
+                if (this.checked) {
+                    $('#StoreCode').css('display', 'block');
+                } else {
+                    $('#StoreCode').css('display', 'none');
+                }
+                form.render();
+            });
+
+
+            //日期
+
+
+            //上传文件
+
+
+            //穿梭框
+
+
+            //TreeView,比如权限管理
+
+
+            //省市区
+
+        })
+
+    </script>
+</body>
+
+</html>

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

@@ -117,7 +117,7 @@
                     {
                         <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="closeRemark"><i class="layui-icon layui-icon-edit"></i>冻结备注</a>
                     @("{{#if (d.AccountStatus == 0){ }}")
-                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Close"><i class="layui-icon layui-icon-edit"></i>冻结</a>
+                    @* <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Close"><i class="layui-icon layui-icon-edit"></i>冻结</a> *@
                     @("{{#}else{ }}")
                     <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Open"><i class="layui-icon layui-icon-edit"></i>解冻</a>
                     @("{{#} }}")

+ 153 - 0
Areas/Admin/Views/MainServer/Users/SanIndex.cshtml

@@ -0,0 +1,153 @@
+@using MySystem.Models;
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
+    List<UserLevelSet> Levels = ViewBag.Levels as List<UserLevelSet>;
+}
+<!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">
+                    <input class="layui-input" type="hidden" name="ShowFlag" autocomplete="off">
+                    <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" id="MakerCode" name="MakerCode" value="" autocomplete="off">
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">注册时间</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate" autocomplete="off">
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">是否盟主</label>
+                            <div class="layui-input-inline">
+                                <select id="IsLeader" name="IsLeader" lay-search="">
+                                    <option value="">全部...</option>
+                                    <option value="1">小盟主</option>
+                                    <option value="2">大盟主</option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">是否运营中心</label>
+                            <div class="layui-input-inline">
+                                <select id="IsOp" name="IsOp" lay-search="">
+                                    <option value="">全部...</option>
+                                    <option value="1">是</option>
+                                    <option value="2">否</option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">创客等级</label>
+                            <div class="layui-input-inline">
+                                <select id="UserLevel" name="UserLevel" lay-search="">
+                                    <option value="">全部...</option>
+                                    @foreach(UserLevelSet Level in Levels)
+                                    {
+                                    <option value="@Level.Id">@Level.Name</option>
+                                    }
+                                </select>
+                            </div>
+                        </div>
+                        <div class="layui-inline">
+                            <label class="layui-form-label">预设等级</label>
+                            <div class="layui-input-inline">
+                                <select id="UserYsLevel" name="UserYsLevel" lay-search="">
+                                    <option value="">全部...</option>
+                                    @foreach(UserLevelSet Level in Levels)
+                                    {
+                                    <option value="@Level.Id">@Level.Name</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>
+
+            <div class="layui-card-body">
+                <div style="padding-bottom: 10px;">
+                </div>
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/SanUsers_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
+</body>
+</html>

+ 503 - 0
wwwroot/layuiadmin/modules_main/PosMachinesTwoTimeOut_Admin.js

@@ -0,0 +1,503 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/PosMachinesTwo/Import?r=" + Math.random(1),
+        data: "Kind=" + ExcelKind + "&ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else if (data.indexOf("warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[0], { time: 20000 }, 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: '#ActivationTime',
+        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) {
+                $('#ActivationTime').val(value);
+            }
+        }
+    });
+
+    //- 筛选条件-日期
+    var laydates = layui.laydate;
+    var layCreateDate = laydates.render({
+        elem: '#BindingTime',
+        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) {
+                $('#BindingTime').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/PosMachinesTwo/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/PosMachinesTwo/IndexsData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'PosSn', width: 200, title: 'SN编号', sort: true }
+            , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
+            , { field: 'UserIdRealName', width: 200, title: '创客姓名', sort: true }
+            , { field: 'StoreIdCode', width: 200, title: '所在仓库编号', sort: true }
+            , { field: 'StoreIdName', width: 200, title: '所在仓库名称', sort: true }
+            , { field: 'StoreMakerCode', width: 200, title: '仓库所属人', sort: true }
+            , { field: 'RecycEndDate', width: 200, title: '循环截止时间', sort: true }
+            , { field: 'AmountYk', width: 200, title: '应扣金额', sort: true }
+            , { field: 'Amountk', width: 200, title: '已扣金额', sort: true }
+            , { field: 'AmountDk', width: 200, title: '待扣金额', sort: true }
+            // , { field: 'BindMerchantIdMerchantNo', width: 200, title: '绑定商户编号', sort: true }
+            // , { field: 'BindMerchantIdMerchantName', width: 200, title: '绑定商户姓名', sort: true }
+            // , { field: 'PosSnType', width: 200, title: '机具类型', sort: true }
+            // , { field: 'DeviceType', width: 200, title: '设备类型', sort: true }
+            // , { field: 'BindingState', width: 200, title: '绑定状态', sort: true }
+            // , { field: 'ActivationState', width: 200, title: '激活状态', sort: true }
+            // , { field: 'ActivationTime', width: 200, title: '激活时间', sort: true }
+            // , { field: 'BindingTime', width: 200, title: '绑定时间', sort: true }
+            // , { field: 'TransferTime', width: 200, title: '划拨时间', sort: true }
+            // , { field: 'CreateDate', width: 200, title: '入库时间', sort: true }
+            // , { field: 'RecycStartDate', width: 200, title: '循环开始时间', sort: true }
+            // , { field: 'SourcePosSn', width: 200, title: '来源机具', sort: true }
+            // , { field: 'UserInfo', width: 200, title: '大盟主券标记', sort: true }
+            // , { field: 'OpCode', width: 200, title: '所属运营中心', sort: true }
+            // , { field: 'IsFirst', width: 200, title: '是否第一台机具', sort: true }
+            // , { field: 'SeoKeyword', width: 200, title: '实际押金金额', sort: true }
+            // , { field: 'PrizeParams', width: 200, title: '设置押金金额', sort: true }
+        ]]
+        , where: {
+
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-' + String($('.layui-card-header').height() + 130)
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $("#TotalCount").text(res.other.TotalCount);
+            $("#AmountYks").text(res.other.AmountYks);
+            $("#AmountDks").text(res.other.AmountDks);
+            $(".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/PosMachinesTwo/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/PosMachinesTwo/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+        field.ShowFlag = 1;
+        if (field.UserIdMakerCode == "" && field.UserIdRealName == "" && field.StoreIdCode == "" && field.StoreIdName == "" && field.PosSn == "" && field.BindingStateSelect == "" && field.ActivationStateSelect == "" && field.ActivationDateData == "" && field.BindingDateData == "" && field.BrandId == "" && field.IsStoreSelect == "" && field.OpCode == "") {
+            layer.alert('请输入查询条件');
+        }
+        else {
+            //执行重载
+            table.reload('LAY-list-manage', {
+                where: field,
+                page: {
+                    curr: 1
+                }
+            });
+        }
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        var field = data.field;
+        field.ShowFlag = 1;
+        field.UserIdMakerCode = "";
+        field.UserIdRealName = "";
+        field.StoreIdCode = "";
+        field.StoreIdName = "";
+        field.PosSn = "";
+        field.BindingStateSelect = "";
+        field.ActivationStateSelect = "";
+        field.ActivationDateData = "";
+        field.BindingDateData = "";
+        field.BrandId = "";
+        field.IsStoreSelect = "";
+        field.OpCode = "";
+
+        table.reload('LAY-list-manage', {
+            where: field,
+            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/PosMachinesTwo/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/PosMachinesTwo/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);
+        }
+        , RejectStore: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '机具驳回仓库导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/users/机具驳回仓库模版.xlsx">点击下载机具驳回仓库模版</a>');
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            var index = layer.load(1, {
+                shade: [0.5, '#000']
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/PosMachinesTwo/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                    layer.close(index);
+                }
+            });
+        }
+        , 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/PosMachinesTwo/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/PosMachinesTwo/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) : '';
+    });
+});

+ 169 - 0
wwwroot/layuiadmin/modules_main/SanUsers_Admin.js

@@ -0,0 +1,169 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/Users/Import?r=" + Math.random(1),
+        data: "Kind=" + ExcelKind + "&ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else if (data.indexOf("warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[0], { time: 20000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    var 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/Users/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/Users/SanIndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', width: 100, title: 'ID', sort: true }
+            , { field: 'MakerCode', width: 200, title: '创客编号', sort: true }
+            , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
+            , { field: 'UserLevel', width: 200, title: '创客等级', sort: true }
+            , { field: 'UserYsLevel', width: 200, title: '预设等级', sort: true }
+            , { field: 'IsLeader', width: 200, title: '是否盟主', sort: true }
+            , { field: 'IsOp', width: 200, title: '是否运营中心', sort: true }
+            , { field: 'AgentAreas', width: 200, title: '展业地区', sort: true }
+            , { field: 'SettleAmount', width: 200, title: '提现金额(元)', sort: true }
+            , { field: 'FreezeAmount', width: 200, title: '冻结金额(元)', sort: true }
+            , { field: 'CertId', width: 200, title: '身份证号', sort: true }
+            , { field: 'Mobile', width: 200, title: '联系手机', sort: true }
+            , { field: 'MerchantType', width: 200, title: '商户创客类型', sort: true }
+            , { field: 'MerchantDate', width: 200, title: '成为商户创客时间', sort: true }
+            , { field: 'ParentMakerCode', width: 200, title: '直属创客编号', sort: true }
+            , { field: 'ParentRealName', width: 200, title: '直属创客名称', sort: true }
+            , { field: 'AuthFlagName', width: 200, title: '实名状态', sort: true }
+            , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
+            , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
+        ]]
+        , where: {
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-' + String($('.layui-card-header').height() + 130)
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+        field.ShowFlag = 1;
+        if (field.MakerCode == "" && field.CreateDateData == "" && field.IsLeader == "" && field.IsOp == "" && field.UserLevel == "" && field.UserYsLevel == "") {
+            layer.alert('请输入查询条件');
+        }
+        else {
+            //执行重载
+            table.reload('LAY-list-manage', {
+                where: field
+            });
+        }
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        var field = data.field;
+        field.ShowFlag = 1;
+        field.MakerCode = "";
+        field.CreateDateData = "";
+        field.IsLeader = "";
+        field.IsOp = "";
+        field.UserLevel = "";
+        field.UserYsLevel = "";
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    // $('.layui-btn').on('click', function () {
+    //     var type = $(this).data('type');
+    //     active[type] ? active[type].call(this) : '';
+    // });
+});

+ 7 - 2
wwwroot/layuiadmin/modules_main/UserCashLeaderRecord_Admin.js

@@ -186,9 +186,14 @@ layui.config({
                     title: '提现服务返回信息',
                     sort: true
                 }, {
-                    field: 'SeoTitle',
+                    field: 'SeoKeyword',
                     width: 200,
-                    title: '备注/代付返回信息',
+                    title: '备注',
+                    sort: true
+                }, {
+                    field: 'Remark',
+                    width: 200,
+                    title: '代付返回信息',
                     sort: true
                 }, {
                     field: 'CreateDate',

+ 7 - 2
wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

@@ -196,9 +196,14 @@ layui.config({
                     title: '提现服务返回信息',
                     sort: true
                 }, {
-                    field: 'SeoTitle',
+                    field: 'SeoKeyword',
                     width: 200,
-                    title: '备注/代付返回信息',
+                    title: '备注',
+                    sort: true
+                }, {
+                    field: 'Remark',
+                    width: 200,
+                    title: '代付返回信息',
                     sort: true
                 }, {
                     field: 'CreateDate',