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

Merge branch 'DuGuYang' of http://47.109.31.237:13000/kxs-end/admin-server into feature-dgy-后台优化

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

+ 49 - 25
Areas/Admin/Controllers/HomeController.cs

@@ -75,7 +75,7 @@ namespace MySystem.Areas.Admin.Controllers
                     int count = 0;
                     DataTable dt = dbconn.dtable("select count(Id) from " + table);
                     if (dt.Rows.Count > 0)
-                    { 
+                    {
                         count = int.Parse(dt.Rows[0][0].ToString());
                     }
                     item.Add("Count", count);
@@ -149,35 +149,59 @@ 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 = "";
-            if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
+            Pwd = function.MD5_32(Pwd);
+            var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            if (user != null)
             {
-                result = "验证码错误!!";
+                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
             {
-                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 = "用户名或密码错误";
-                }
+                result = "用户名或密码错误";
             }
             return result;
         }

+ 1 - 1
Areas/Admin/Controllers/SpServer/BindRecordController.cs

@@ -61,7 +61,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("MerName", "1"); //商户名称
             Fields.Add("MerSnNo", "1"); //终端机身号
             Fields.Add("MerNewSnNo", "1"); //新终端机身号
-            Fields.Add("CreateTime", "3"); //创建时间
+            // Fields.Add("CreateTime", "3"); //创建时间
             Fields.Add("ChannelSerial", "1"); //渠道流水号
 
 

+ 1 - 1
Areas/Admin/Controllers/SpServer/ChangeBindRecordController.cs

@@ -61,7 +61,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("MerName", "1"); //商户名称
             Fields.Add("MerSnNo", "1"); //终端机身号
             Fields.Add("MerNewSnNo", "1"); //新终端机身号
-            Fields.Add("ConfirmTime", "3"); //提交时间
+            // Fields.Add("ConfirmTime", "3"); //提交时间
             Fields.Add("ChannelSerial", "1"); //渠道流水号
 
 

+ 11 - 0
Areas/Admin/Controllers/SpServer/TradeFluxRecordController.cs

@@ -100,6 +100,17 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BankCardType == "0001") dic["BankCardType"] = "贷记卡";
                 if (BankCardType == "0002") dic["BankCardType"] = "借记卡";
                 if (BankCardType == "") dic["BankCardType"] = "";
+                //流量费
+                decimal FeeAmount = Convert.ToDecimal(dic["FeeAmount"].ToString());
+                var Brand = dic["ProductType"].ToString();
+                if (Brand == "1" || Brand == "4" || Brand == "6" || Brand == "8" || Brand == "9")
+                {
+                    dic["FeeAmount"] = FeeAmount / 100;
+                }
+                if (Brand == "2" || Brand == "7")
+                {
+                    dic["FeeAmount"] = FeeAmount;
+                }
                 //产品类型
                 dic["ProductType"] = RelationClass.GetKqProductBrandList(dic["ProductType"].ToString());
                 // //产品类型

+ 1 - 1
Areas/Admin/Controllers/SpServer/UnBindRecordController.cs

@@ -60,7 +60,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("MerNo", "1"); //商户编号
             Fields.Add("MerName", "1"); //商户名称
             Fields.Add("MerSnNo", "1"); //终端机身号
-            Fields.Add("UnBindTime", "3"); //解绑时间
+            // Fields.Add("UnBindTime", "3"); //解绑时间
             Fields.Add("ChannelSerial", "1"); //渠道流水号
 
 

+ 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/SpServer/BindRecord/Index.cshtml

@@ -73,7 +73,7 @@
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">终端机身号</label>
+                        <label class="layui-form-label">终端机身号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="MerSnNo" placeholder="" autocomplete="off">
                         </div>

+ 1 - 1
Areas/Admin/Views/SpServer/ChangeBindRecord/Index.cshtml

@@ -73,7 +73,7 @@
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">终端机身号</label>
+                        <label class="layui-form-label">终端机身号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="MerSnNo" placeholder="" autocomplete="off">
                         </div>

+ 26 - 0
Startup.cs

@@ -93,8 +93,10 @@ namespace MySystem
             initMainServer();
             initBsServer();
             initCashServer();
+            initSpServer();
 
             RedisDbconn.csredis = new CSRedis.CSRedisClient(Configuration["Setting:RedisConnStr"]);
+            // TendisDbconn.csredis = new CSRedis.CSRedisClient(Configuration["Setting:TendisConnStr"]);
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -217,5 +219,29 @@ namespace MySystem
             Library.OtherMySqlConn.connstr = "";
             PublicFunction.CashTables = tables;
         }
+
+        private void initSpServer()
+        {
+            Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
+            Library.OtherMySqlConn.connstr = Configuration["Setting:SpSqlConnStr"];
+            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsSpServer'");
+            foreach (System.Data.DataRow subtable in tablecollection.Rows)
+            {
+                Dictionary<string, string> Columns = new Dictionary<string, string>();
+                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsSpServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                foreach (System.Data.DataRow column in columncollection.Rows)
+                {
+                    string datatype = column["DATA_TYPE"].ToString();
+                    if (datatype == "decimal")
+                    {
+                        datatype = "numeric";
+                    }
+                    Columns.Add(column["COLUMN_NAME"].ToString(), datatype);
+                }
+                tables.Add(subtable["TABLE_NAME"].ToString(), Columns);
+            }
+            Library.OtherMySqlConn.connstr = "";
+            PublicFunction.SpTables = tables;
+        }
     }
 }

+ 27 - 0
wwwroot/layuiadmin/modules_sp/ActivateRecord_Admin.js

@@ -30,6 +30,33 @@ layui.config({
 
     //- 筛选条件-日期
     var laydate = layui.laydate;
+    var layCreateTime = laydate.render({
+        elem: '#ActivateDate',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#ActivateDate').val(value);
+            }
+        }
+    });
 
 
     //excel导入

+ 4 - 4
wwwroot/layuiadmin/modules_sp/BindRecord_Admin.js

@@ -33,7 +33,7 @@ layui.config({
     var layCreateTime = laydate.render({
         elem: '#CreateTime',
         trigger: 'click',
-        type: 'datetime',
+        type: 'date',
         range: true,
         change: function (value, date, endDate) {
             var op = true;
@@ -93,15 +93,15 @@ layui.config({
             { type: 'checkbox', fixed: 'left' }
             // , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Status', width: 200, title: '状态', sort: true }
-            , { field: 'CreateTime', width: 200, title: '创建时间', sort: true }
+            , { field: 'CreateTime', width: 200, title: '绑定时间', sort: true }
             , { field: 'SeoTitle', width: 200, title: '名称', sort: true }
             , { field: 'SeoKeyword', width: 200, title: '交易卡号', sort: true }
             , { field: 'ChannelSerial', width: 200, title: '渠道流水号', sort: true }
             , { field: 'AgentName', width: 200, title: '机构名称', sort: true }
             , { field: 'MerNo', width: 200, title: '商户编号', sort: true }
             , { field: 'MerName', width: 200, title: '商户名称', sort: true }
-            , { field: 'MerSnNo', width: 200, title: '终端机身号', sort: true }
-            , { field: 'MerOperateDate', width: 200, title: '操作时间', sort: true }
+            , { field: 'MerSnNo', width: 200, title: '终端机身号', sort: true }
+            // , { field: 'MerOperateDate', width: 200, title: '操作时间', sort: true }
             // , { field: 'MerOperateType', width: 200, title: '操作类型', sort: true }
             // , { field: 'MerStatus', width: 200, title: '商户状态', sort: true }
             , { field: 'ProductType', width: 200, title: '产品类型', sort: true }

+ 30 - 3
wwwroot/layuiadmin/modules_sp/ChangeBindRecord_Admin.js

@@ -33,7 +33,7 @@ layui.config({
     var layConfirmTime = laydate.render({
         elem: '#ConfirmTime',
         trigger: 'click',
-        type: 'datetime',
+        type: 'date',
         range: true,
         change: function (value, date, endDate) {
             var op = true;
@@ -57,6 +57,33 @@ layui.config({
             }
         }
     });
+    var layReBindTime = laydate.render({
+        elem: '#ReBindTime',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layReBindTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layReBindTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#ReBindTime').val(value);
+            }
+        }
+    });
 
 
     //excel导入
@@ -93,12 +120,12 @@ layui.config({
             { type: 'checkbox', fixed: 'left' }
             // , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Status', width: 200, title: '状态', sort: true }
-            , { field: 'CreateTime', width: 200, title: '创建时间', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'AgentNo', width: 200, title: '机构号', sort: true }
             , { field: 'AgentName', width: 200, title: '机构名称', sort: true }
             , { field: 'MerNo', width: 200, title: '商户编号', sort: true }
             , { field: 'MerName', width: 200, title: '商户名称', sort: true }
-            , { field: 'MerSnNo', width: 200, title: '终端机身号', sort: true }
+            , { field: 'MerSnNo', width: 200, title: '终端机身号', sort: true }
             , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
             , { field: 'MerNewSnNo', width: 200, title: '新终端机身号', sort: true }
             , { field: 'ConfirmTime', width: 200, title: '提交时间', sort: true }

+ 28 - 1
wwwroot/layuiadmin/modules_sp/TradeFluxRecord_Admin.js

@@ -30,6 +30,33 @@ layui.config({
 
     //- 筛选条件-日期
     var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    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导入
@@ -80,7 +107,7 @@ layui.config({
             // , { field: 'BankCardType', width: 200, title: '银行卡类型', sort: true }
             // , { field: 'DigAmt', width: 200, title: '挖款金额', sort: true }
             // , { field: 'BankCardNo', width: 200, title: '交易卡号', sort: true }
-            , { field: 'FeeAmount', width: 200, title: '手续费', sort: true }
+            , { field: 'FeeAmount', width: 200, title: '流量费', sort: true }
             , { field: 'KqTradeSeq', width: 200, title: '快钱交易流水号', sort: true }
             , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
             , { field: 'AgentNo', width: 200, title: '代理商编号', sort: true }

+ 27 - 0
wwwroot/layuiadmin/modules_sp/TradeRecord_Admin.js

@@ -30,6 +30,33 @@ layui.config({
 
     //- 筛选条件-日期
     var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    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导入

+ 3 - 3
wwwroot/layuiadmin/modules_sp/UnBindRecord_Admin.js

@@ -33,7 +33,7 @@ layui.config({
     var layUnBindTime = laydate.render({
         elem: '#UnBindTime',
         trigger: 'click',
-        type: 'datetime',
+        type: 'date',
         range: true,
         change: function (value, date, endDate) {
             var op = true;
@@ -93,13 +93,13 @@ layui.config({
             { type: 'checkbox', fixed: 'left' }
             // , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Status', width: 200, title: '状态', sort: true }
-            , { field: 'CreateTime', width: 200, title: '创建时间', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'AgentName', width: 200, title: '机构名称', sort: true }
             , { field: 'MerNo', width: 200, title: '商户编号', sort: true }
             , { field: 'MerName', width: 200, title: '商户名称', sort: true }
             , { field: 'MerSnNo', width: 200, title: '终端机身号', sort: true }
             , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
-            // , { field: 'UnBindTime', width: 200, title: '解绑时间', sort: true }
+            , { field: 'UnBindTime', width: 200, title: '解绑时间', sort: true }
             // , { field: 'ChannelSerial', width: 200, title: '渠道流水号', sort: true }
             , { field: 'AgentNo', width: 200, title: '机构号', sort: true }