DuGuYang 3 سال پیش
والد
کامیت
44c58a6ad9

+ 48 - 48
Areas/Admin/Controllers/HomeController.cs

@@ -149,60 +149,60 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string Login(string UserName, string Pwd, string CheckCode)
         {
-            string result = "";
-            if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
-            {
-                result = "验证码错误!!";
-            }
-            else
-            {
-                Pwd = function.MD5_32(Pwd);
-                var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
-                if (user != null)
-                {
-                    user.LastLoginDate = DateTime.Now;
-                    db.SaveChanges();
-                    function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
-                    function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
-                    function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
-                    int RoleId = int.Parse(function.CheckInt(user.Role));
-                    BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
-                    string RightInfo = function.CheckNull(Role.RightInfo);
-                    function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
-                    string UserId = user.Id.ToString();
-                    function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
-                    function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
-                    result = "success";
-                }
-                else
-                {
-                    result = "用户名或密码错误";
-                }
-            }
-
             // string result = "";
-            // Pwd = function.MD5_32(Pwd);
-            // var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
-            // if (user != null)
+            // if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
             // {
-            //     user.LastLoginDate = DateTime.Now;
-            //     db.SaveChanges();
-            //     function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
-            //     function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
-            //     function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
-            //     int RoleId = int.Parse(function.CheckInt(user.Role));
-            //     BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
-            //     string RightInfo = function.CheckNull(Role.RightInfo);
-            //     function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
-            //     string UserId = user.Id.ToString();
-            //     function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
-            //     function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
-            //     result = "success";
+            //     result = "验证码错误!!";
             // }
             // else
             // {
-            //     result = "用户名或密码错误";
+            //     Pwd = function.MD5_32(Pwd);
+            //     var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            //     if (user != null)
+            //     {
+            //         user.LastLoginDate = DateTime.Now;
+            //         db.SaveChanges();
+            //         function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+            //         function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+            //         function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+            //         int RoleId = int.Parse(function.CheckInt(user.Role));
+            //         BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+            //         string RightInfo = function.CheckNull(Role.RightInfo);
+            //         function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+            //         string UserId = user.Id.ToString();
+            //         function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+            //         function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+            //         result = "success";
+            //     }
+            //     else
+            //     {
+            //         result = "用户名或密码错误";
+            //     }
             // }
+
+            string result = "";
+            Pwd = function.MD5_32(Pwd);
+            var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            if (user != null)
+            {
+                user.LastLoginDate = DateTime.Now;
+                db.SaveChanges();
+                function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+                function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+                function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+                int RoleId = int.Parse(function.CheckInt(user.Role));
+                BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+                string RightInfo = function.CheckNull(Role.RightInfo);
+                function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+                string UserId = user.Id.ToString();
+                function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+                function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+                result = "success";
+            }
+            else
+            {
+                result = "用户名或密码错误";
+            }
             return result;
         }
         #endregion

+ 10 - 3
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -445,7 +445,7 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
@@ -555,7 +555,7 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from Users where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
@@ -576,7 +576,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
 
             var Ids = "";
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,UserId,UseAmount", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,CreateDate,UserId,UseAmount", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -597,6 +597,11 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //记录Id
                 int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                var storeHouseAmountRecord = db.StoreHouseAmountRecord.FirstOrDefault(m => m.Id == Id) ?? new StoreHouseAmountRecord();
+                if (storeHouseAmountRecord.Status == 0) dic["Status"] = "待处理";
+                if (storeHouseAmountRecord.Status == 2) dic["Status"] = "处理中";
+                if (storeHouseAmountRecord.Status == 1) dic["Status"] = "成功";
+                if (storeHouseAmountRecord.Status == -1) dic["Status"] = "失败";
                 dic["Id"] = Id;
                 Ids += Id + ",";
             }
@@ -608,6 +613,8 @@ namespace MySystem.Areas.Admin.Controllers
             result.Add("Obj", diclist);
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("Id", "记录ID");
+            ReturnFields.Add("CreateDate", "提现申请时间");
+            ReturnFields.Add("Status", "提现结果");
             ReturnFields.Add("UserIdRealName", "创客真实姓名");
             ReturnFields.Add("UserIdMakerCode", "创客编号");
             ReturnFields.Add("UseAmount", "申请提现临额");

+ 95 - 28
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -473,7 +473,7 @@ namespace MySystem.Areas.Admin.Controllers
                 else if (pos.BrandId == 9)
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
-                }                
+                }
                 else if (pos.BrandId == 10 || pos.BrandId == 11)
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
@@ -689,7 +689,7 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             prizes.Add(50);
                         }
-                        else if((pos.BrandId == 10 || pos.BrandId == 11) && pos.IsFirst == 1 && ActPrize == 0) //联动首台无押金机返50
+                        else if ((pos.BrandId == 10 || pos.BrandId == 11) && pos.IsFirst == 1 && ActPrize == 0) //联动首台无押金机返50
                         {
                             prizes.Add(50);
                         }
@@ -4065,6 +4065,70 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
+        // public string TransferPosDo(string PosSn, string FromMakerCode, string ToMakerCode)
+        // {
+        //     if (string.IsNullOrEmpty(PosSn))
+        //     {
+        //         return "请输入机具SN";
+        //     }
+        //     if (string.IsNullOrEmpty(FromMakerCode))
+        //     {
+        //         return "请输入机具来源创客编号";
+        //     }
+        //     if (string.IsNullOrEmpty(ToMakerCode))
+        //     {
+        //         return "请输入划拨对象创客编号";
+        //     }
+        //     var query = PosSn + "," + FromMakerCode + "," + ToMakerCode;
+        //     var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
+        //     var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
+        //     if (posInfo.Id == 0)
+        //     {
+        //         return "机具" + PosSn + "不存在";
+        //     }
+        //     var user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == FromMakerCode) ?? new UserForMakerCode();
+        //     var tuser = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == ToMakerCode) ?? new UserForMakerCode();
+        //     var fUserId = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
+        //     if (fUserId.Id == 0)
+        //     {
+        //         return "来源创客" + FromMakerCode + "不存在";
+        //     }
+        //     var tUserId = db.Users.FirstOrDefault(m => m.Id == tuser.UserId) ?? new Users();
+        //     if (tUserId.Id == 0)
+        //     {
+        //         return "划拨创客" + ToMakerCode + "不存在";
+        //     }
+        //     if (posInfo.BindingState == 0)
+        //     {
+        //         if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+        //         {
+        //             posInfo.BuyUserId = tUserId.Id;
+        //             posInfo.UserId = tUserId.Id;
+        //         }
+        //         else
+        //         {
+        //             posInfo.BuyUserId = tUserId.Id;
+        //         }
+        //         var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+        //         var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+        //         fUserPos.TotalMachineCount -= 1;
+        //         fUserPos.UnBindCount -= 1;
+        //         tUserPos.TotalMachineCount += 1;
+        //         tUserPos.UnBindCount += 1;
+        //         db.SaveChanges();
+        //         function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
+        //     }
+        //     else
+        //     {
+        //         return "机具" + PosSn + "已使用";
+        //     }
+
+        //     return "success";
+        // }
+        // #endregion
+
+
+
         public string TransferPosDo(string PosSn, string FromMakerCode, string ToMakerCode)
         {
             if (string.IsNullOrEmpty(PosSn))
@@ -4079,13 +4143,6 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "请输入划拨对象创客编号";
             }
-            var query = PosSn + "," + FromMakerCode + "," + ToMakerCode;
-            var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
-            var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
-            if (posInfo.Id == 0)
-            {
-                return "机具" + PosSn + "不存在";
-            }
             var user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == FromMakerCode) ?? new UserForMakerCode();
             var tuser = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == ToMakerCode) ?? new UserForMakerCode();
             var fUserId = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
@@ -4098,30 +4155,40 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "划拨创客" + ToMakerCode + "不存在";
             }
-            if (posInfo.BindingState == 0)
+            var SnIds = "";
+            string[] PosSnList = PosSn.Replace("\r", "").Replace("\n", ",").Split(',');
+            foreach (string Sn in PosSnList)
             {
-                if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+                var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == Sn) ?? new MachineForSnNo();
+                var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
+                if (posInfo.Id == 0)
                 {
-                    posInfo.BuyUserId = tUserId.Id;
-                    posInfo.UserId = tUserId.Id;
+                    return "机具" + PosSn + "不存在";
                 }
-                else
+                if (posInfo.BindingState == 0)
                 {
-                    posInfo.BuyUserId = tUserId.Id;
+                    SnIds += posInfo.Id + ",";
+                    if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
+                    {
+                        posInfo.BuyUserId = tUserId.Id;
+                        posInfo.UserId = tUserId.Id;
+                    }
+                    else
+                    {
+                        posInfo.BuyUserId = tUserId.Id;
+                    }
+                    var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+                    var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
+                    fUserPos.TotalMachineCount -= 1;
+                    fUserPos.UnBindCount -= 1;
+                    tUserPos.TotalMachineCount += 1;
+                    tUserPos.UnBindCount += 1;
                 }
-                var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
-                var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
-                fUserPos.TotalMachineCount -= 1;
-                fUserPos.UnBindCount -= 1;
-                tUserPos.TotalMachineCount += 1;
-                tUserPos.UnBindCount += 1;
-                db.SaveChanges();
-                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
-            }
-            else
-            {
-                return "机具" + PosSn + "已使用";
             }
+            var query = SnIds + ";" + FromMakerCode + ";" + ToMakerCode;
+            function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
+            db.SaveChanges();
+            db.Dispose();
 
             return "success";
         }
@@ -4266,7 +4333,7 @@ namespace MySystem.Areas.Admin.Controllers
                     opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
                 }
                 oldpos.Status = 1;
-                oldpos.PosSnType= 0;
+                oldpos.PosSnType = 0;
                 oldpos.QueryCount = 0;
                 oldpos.UpdateDate = null;
                 oldpos.ActivityList = null;

+ 2 - 2
Areas/Admin/Views/Home/Login.cshtml

@@ -26,11 +26,11 @@
                     <label for="password">密码 / Password</label>
                     <input class="form-input" type="password" name="Pwd" id="Pwd" onKeyUp="if(event.keyCode==13){$('#CheckCode').focus();}" placeholder="请填写密码">
                 </div>
-                <div class="form-group pb10">
+                @* <div class="form-group pb10">
                     <label for="password">验证码 / Verification</label>
                     <input class="form-input" type="text" name="CheckCode" id="CheckCode" onkeyup="if(event.keyCode==13){syslogin();}" placeholder="请填写验证码" style="width: 70%; display: inline-block; margin-right: 2%">
                     <img src="/Api/PublicMethod/CheckCode" onclick="$(this).attr('src','/Api/PublicMethod/CheckCode?r='+Math.random())" style="width: 26%; height:38px;" />
-                </div>
+                </div> *@
                 @*<div class="form-group pb10 cf">
                         <label class="remembermetext fl" for="rememberme">
                             <input type="checkbox" checked name="rememberme">&nbsp;记住我的登录

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

@@ -8,7 +8,7 @@
 
 <head>
     <meta charset="utf-8">
-    <title>分仓机具额度记录</title>
+    <title>银行卡临额提现</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport"

+ 7 - 1
Areas/Admin/Views/MainServer/SysTools/TransferPos.cshtml

@@ -30,12 +30,18 @@
                         </ul>
                         <div class="layui-tab-content mt20">
                             <div class="layui-tab-item layui-show">
-                                <div class="layui-form-item">
+                                @* <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">机具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>

+ 1 - 1
wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js

@@ -99,7 +99,7 @@ layui.config({
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Status', width: 200, title: '状态', sort: true }
             , { field: 'UserIdRealName', width: 200, title: '创客真实姓名', sort: true }
-            , { field: 'UserIdMakerCode', width: 200, title: '创客创客编号', sort: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'UseAmount', width: 200, title: '申请提现临额', sort: true }
             , { field: 'CertId', width: 200, title: '身份证号', sort: true }