DuGuYang 3 лет назад
Родитель
Сommit
9fd4d72e4f

+ 4 - 0
AppStart/ExcelHelper.cs

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

+ 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 OpConn = Library.ConfigurationManager.AppSettings["OpSqlConnStr"].ToString();
+        public string SqlConn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         
         
         public int SysId;
         public int SysId;
         public int SysRealRole;
         public int SysRealRole;

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

@@ -729,5 +729,268 @@ namespace MySystem.Areas.Admin.Controllers
 
 
         #endregion
         #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
+
     }
     }
 }
 }

+ 199 - 133
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -4205,7 +4205,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
 
 
 
 
-        #region 更换机具
+        #region 机具回仓退款
 
 
         public IActionResult RefundPosFee(string right)
         public IActionResult RefundPosFee(string right)
         {
         {
@@ -4216,16 +4216,25 @@ namespace MySystem.Areas.Admin.Controllers
         }
         }
 
 
         [HttpPost]
         [HttpPost]
-        public string RefundPosFeeDo(string PosSn, string BackStoreNo)
+        public string RefundPosFeeDo(string PosSn, string BackStoreNo, int IsBack = 0)
         {
         {
             if (string.IsNullOrEmpty(PosSn))
             if (string.IsNullOrEmpty(PosSn))
             {
             {
                 return "请输入机具SN";
                 return "请输入机具SN";
             }
             }
-            string[] PosSnList = PosSn.Split('\n');
+            if (IsBack == 1)
+            {
+                if (string.IsNullOrEmpty(BackStoreNo))
+                {
+                    return "请输入仓库编号";
+                }
+            }
+            string[] PosSnList = PosSn.Replace("\r", "").Split('\n');
             WebCMSEntities db = new WebCMSEntities();
             WebCMSEntities db = new WebCMSEntities();
             DateTime time = DateTime.Parse(DateTime.Now.ToString(("yyyy-MM-dd") + " 00:00:00"));
             DateTime time = DateTime.Parse(DateTime.Now.ToString(("yyyy-MM-dd") + " 00:00:00"));
             var endTime = time.AddDays(20 - time.Day).AddDays(-60);
             var endTime = time.AddDays(20 - time.Day).AddDays(-60);
+            StoreForCode storeForBack = new StoreForCode();
+            StoreHouse BackStore = new StoreHouse();
             foreach (var item in PosSnList)
             foreach (var item in PosSnList)
             {
             {
                 MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == item) ?? new MachineForSnNo();
                 MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == item) ?? new MachineForSnNo();
@@ -4238,15 +4247,18 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                 {
                     return "机具" + item + "不存在或者不满足条件";
                     return "机具" + item + "不存在或者不满足条件";
                 }
                 }
-                StoreForCode storeForBack = db.StoreForCode.FirstOrDefault(m => m.Code == BackStoreNo) ?? new StoreForCode();
-                if (storeForBack.StoreId == 0)
+                if (IsBack == 1)
                 {
                 {
-                    return "未找到" + BackStoreNo + "关联数据";
-                }
-                StoreHouse 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 + "不存在或与机具品牌不符";
+                    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 userAccount = db.UserAccount.FirstOrDefault(m => m.Id == BackStore.UserId) ?? new UserAccount();
                 var refundUserAccount = db.UserAccount.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new UserAccount();
                 var refundUserAccount = db.UserAccount.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new UserAccount();
@@ -4260,136 +4272,190 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                 {
                     amount = 300;
                     amount = 300;
                 }
                 }
-                userAccount.ValidAmount -= amount;//扣减分仓可用额度
-                if (pos.ScanQrTrade > 0 && pos.ScanQrTrade != 999)
+                if (IsBack == 1)
                 {
                 {
-                    var BeforeBalanceAmount = refundUserAccount.BalanceAmount;
-                    var AfterBalanceAmount = refundUserAccount.BalanceAmount + pos.ScanQrTrade;
-                    refundUserAccount.BalanceAmount += pos.ScanQrTrade;//退还创客机具货款
-                    db.UserAccountRecord.Add(new UserAccountRecord()
+                    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,
                         CreateDate = DateTime.Now,
-                        UpdateDate = DateTime.Now,
-                        UserId = pos.BuyUserId, //创客
-                        ChangeType = 126, //变动类型(机具货款退还)
-                        ProductType = 0, //产品类型
-                        ChangeAmount = pos.ScanQrTrade, //变更金额
-                        BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
-                        AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                        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 (userAccount.ValidAmount - amount > 0)
-                // {
-                //     userAccount.ValidAmount -= amount;//扣减分仓可用额度
-                // }
-                // else
-                // {
-                //     return "仓库" + BackStoreNo + "可用额度不足";
-                // }
-                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;
+                    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;
                 }
                 }
-                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()
+                else
                 {
                 {
-                    CreateDate = DateTime.Now,
-                    Operator= SysUserName + "_" + SysRealName,//操作人
-                    BrandId = pos.BrandId, //产品类型
-                    DeviceSnNos = pos.PosSn,
-                    ToStoreId = BackStore.Id,
-                    ApplyNo = ChangeNo, //变更记录单号
-                    UserId = pos.BuyUserId, //来源创客
-                    Remark = "过期机具回仓退款", //入库备注
-                });
-
-                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;
-
-                db.SaveChanges();
-                db.Dispose();
+                    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";
             return "success";
         }
         }
         #endregion
         #endregion

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

@@ -477,7 +477,7 @@ namespace MySystem.Areas.Admin.Controllers
         public string ImportPost(string ExcelPath)
         public string ImportPost(string ExcelPath)
         {
         {
             string key = function.MD5_16(Guid.NewGuid().ToString());
             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;
             return "success|" + key;
         }
         }
         public string CheckImport(string key)
         public string CheckImport(string key)

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

@@ -2156,5 +2156,145 @@ namespace MySystem.Areas.Admin.Controllers
         }
         }
 
 
         #endregion
         #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 LeaderLeave=" + IsLeader;
+            }
+            if (!string.IsNullOrEmpty(UserYsLevel))
+            {
+                var UserIds = "";
+                var Rank = int.Parse(UserYsLevel);
+                DataTable dts = CustomerSqlConn.dtable("SELECT UserId FROM UserRankWhite WHERE Status>-1 and Rank=" + Rank + "", SqlConn);
+                foreach (var item in dts.Rows)
+                {
+                    UserIds += item + ",";
+                }
+                UserIds = UserIds.TrimEnd(',');
+                condition += " or 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 (var item in dt.Rows)
+                {
+                    UserIds += item + ",";
+                }
+                UserIds = UserIds.TrimEnd(',');
+                if (IsOp == "1")
+                {
+                    condition += " or Id IN(" + UserIds + ")";
+                }
+                if (IsOp == "2")
+                {
+                    condition += " or 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);
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);//设置提现记录为成功
                 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);                
                 new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("UserCashRecord", Fields, id);                
             }
             }
             opdb.SaveChanges();
             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">
                                     <div class="layui-upload">
                                         <input type="hidden" id="Photo" name="Photo" value="">
                                         <input type="hidden" id="Photo" name="Photo" value="">
                                         <button class="layui-btn" type="button" id="PhotoBtn">选择图片</button>
                                         <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>
                                     <div style="margin-top:10px;" id="PhotoImage">
                                     <div style="margin-top:10px;" id="PhotoImage">
                                     </div>
                                     </div>

+ 35 - 3
Areas/Admin/Views/MainServer/SysTools/RefundPosFee.cshtml

@@ -38,6 +38,13 @@
                                     </div>
                                     </div>
                                 </div>
                                 </div>
                                 <div class="layui-form-item">
                                 <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>
                                     <label class="layui-form-label">退回仓库编号</label>
                                     <div class="layui-input-inline">
                                     <div class="layui-input-inline">
                                         <input class="layui-input" type="text" id="BackStoreNo" name="BackStoreNo"
                                         <input class="layui-input" type="text" id="BackStoreNo" name="BackStoreNo"
@@ -60,7 +67,8 @@
     </div>
     </div>
 
 
     <script src="/layuiadmin/layui/layui.js"></script>
     <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script
+        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
     <script src="/other/mybjq/kindeditor-min.js"></script>
     <script src="/other/mybjq/kindeditor-min.js"></script>
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
     <script>
@@ -68,6 +76,15 @@
             var index = layer.load(1, {
             var index = layer.load(1, {
                 shade: [0.5, '#000']
                 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();
             var userdata = $("#confirmFrm").serialize();
             $.ajax({
             $.ajax({
                 type: "POST",
                 type: "POST",
@@ -77,9 +94,13 @@
                 success: function (data) {
                 success: function (data) {
                     layer.close(index); //关闭弹层
                     layer.close(index); //关闭弹层
                     if (data == "success") {
                     if (data == "success") {
-                        layer.msg("退还成功");
+                        layer.msg("退还成功", { time: 1000 }, function () {
+                            window.location.reload();
+                        });
                     } else {
                     } else {
-                        layer.msg(data);
+                        layer.msg(data, { time: 5000 }, function () {
+                            window.location.reload();
+                        });
                     }
                     }
                 }
                 }
             });
             });
@@ -222,6 +243,17 @@
                 location.hash = 'test=' + $(this).attr('lay-id');
                 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();
+            });
+
+
             //日期
             //日期
 
 
 
 

+ 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: '提现服务返回信息',
                     title: '提现服务返回信息',
                     sort: true
                     sort: true
                 }, {
                 }, {
-                    field: 'SeoTitle',
+                    field: 'SeoKeyword',
                     width: 200,
                     width: 200,
-                    title: '备注/代付返回信息',
+                    title: '备注',
+                    sort: true
+                }, {
+                    field: 'Remark',
+                    width: 200,
+                    title: '代付返回信息',
                     sort: true
                     sort: true
                 }, {
                 }, {
                     field: 'CreateDate',
                     field: 'CreateDate',

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

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