整理数据字典,优化代码
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index 5e91f80..b16d5a4 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -506,5 +506,34 @@
 INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
 VALUES ('cancel','dtlStatusList', '交易取消', '流水状态', '{tenantid}');
 
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('1', 'idtypeList', '身份证', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('2', 'idtypeList', '护照', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('3', 'idtypeList', '驾照', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('4', 'idtypeList', '港澳通行证', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('5', 'idtypeList', '学工号', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('9', 'idtypeList', '其他', '证件类型', '{tenantid}');
+
+
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('male', 'sexList', '男', '性别', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('female', 'sexList', '女', '性别', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('unknown', 'sexList', '未知', '性别', '{tenantid}');
+
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('normal', 'accountStatusList', '正常', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('closed', 'accountStatusList', '注销', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('locked', 'accountStatusList', '锁定', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('unknown', 'accountStatusList', '异常', '账户状态', '{tenantid}');
 ----------------------------------------------------
 commit;
\ No newline at end of file
diff --git a/src/main/resources/static/libs/custom.js b/src/main/resources/static/libs/custom.js
index e91928d..21e9601 100644
--- a/src/main/resources/static/libs/custom.js
+++ b/src/main/resources/static/libs/custom.js
@@ -15,7 +15,7 @@
             pool: {},
             addNewDict: function (dictType) {
                 var that = this;
-                console.log("正在加载<"+dictType+">");
+                console.log("正在加载<" + dictType + ">");
                 $.ajax(that.url, {
                         method: "GET",
                         data: "dicttype=" + dictType,
@@ -25,11 +25,11 @@
                                 that.storage.removeItem(dictType);
                             } else {
                                 that.storage.setItem(dictType, JSON.stringify(data));
-                                console.log("<"+dictType+">加载成功!");
+                                console.log("<" + dictType + ">加载成功!");
                             }
                         },
-                        error: function(e){
-                            console.log("<"+dictType+">加载失败!");
+                        error: function (e) {
+                            console.log("<" + dictType + ">加载失败!");
                         }
                     }
                 );
@@ -48,7 +48,7 @@
                                 that.storage.removeItem(dictType);
                             } else {
                                 that.storage.setItem(dictType, JSON.stringify(data));
-                                console.log("<"+dictType+">加载成功!");
+                                console.log("<" + dictType + ">加载成功!");
                             }
                         },
                         error: function (e) {
@@ -60,7 +60,11 @@
             },
             initAll: function (url) {
                 this.url = url;
-                this.addNewDict("sourcetypeList").addNewDict("reverseFlagList");
+                this.addNewDict("sourcetypeList")
+                    .addNewDict("reverseFlagList")
+                    .addNewDict("idtypeList")
+                    .addNewDict("sexList")
+                    .addNewDict("accountStatusList")
             },
             getDict: function (dictType) {
                 var dict, that = this;
diff --git a/src/main/resources/templates/system/user/account.html b/src/main/resources/templates/system/user/account.html
index cd9cc57..988fa72 100644
--- a/src/main/resources/templates/system/user/account.html
+++ b/src/main/resources/templates/system/user/account.html
@@ -9,8 +9,10 @@
     <div class="layui-card-body">
         <div class="layui-form toolbar">
             搜索:
-            <input id="search-value-account" class="layui-input search-input" type="text" placeholder="输入用户名称"/>&emsp;
-            <button id="btn-search-account" class="layui-btn icon-btn" data-type="search"><i class="layui-icon">&#xe615;</i>搜索
+            <input id="search-value-account" class="layui-input search-input" type="text"
+                   placeholder="输入用户名称"/>&emsp;
+            <button id="btn-search-account" class="layui-btn icon-btn" data-type="search"><i
+                    class="layui-icon">&#xe615;</i>搜索
             </button>
         </div>
         <table class="layui-table" id="accounttable" lay-filter="accounttable"></table>
@@ -29,36 +31,53 @@
             page: true,
             cols: [
                 [
-                    {field: 'accno', title: '账号',fixed: 'left', width: 100},
-                    {field: 'person', title: '名称', width: 80,fixed: 'left', sort: true, templet: function (item) {
-                            if(item.accname!=null){
+                    {field: 'accno', title: '账号', fixed: 'left', width: 100},
+                    {
+                        field: 'person',
+                        title: '名称',
+                        width: 80,
+                        fixed: 'left',
+                        sort: true,
+                        templet: function (item) {
+                            if (item.accname != null) {
                                 return item.accname;
                             }
                             return item.person.name;
-                    }},
-                    {field: 'transStatus', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
-                            if (item.transStatus == 'normal') {
-                                return '<span class="layui-badge layui-bg-green">正常</span>'
-                            } else if (item.transStatus == 'closed') {
-                                return '<span class="layui-badge">注销</span>'
-                            } else if (item.transStatus == 'locked') {
-                                return '<span class="layui-badge layui-bg-orange">锁定</span>'
-                            }  else {
+                        }
+                    },
+                    {
+                        field: 'transStatus',
+                        title: '状态',
+                        fixed: 'left',
+                        width: 80,
+                        templet: function (item) {
+                            let desc = getTempDictValue('accountStatusList', item.transStatus)
+                            if (item.transStatus === 'normal') {
+                                return '<span class="layui-badge layui-bg-green">' + desc + '</span>'
+                            } else if (item.transStatus === 'closed') {
+                                return '<span class="layui-badge">' + desc + '</span>'
+                            } else if (item.transStatus === 'locked') {
+                                return '<span class="layui-badge layui-bg-orange">' + desc + '</span>'
+                            } else {
                                 return '异常'
                             }
                         }
                     },
-                    {field: 'availbal', title: '可用余额', width: 100,fixed: 'left', sort: true},
-                    {field: 'balance', title: '总余额', width: 100,fixed: 'left', sort: true},
-                    {field: 'frozebal', title: '冻结余额', width: 100,fixed: 'left', sort: true},
-                    {field: 'lasttranstime', title: '最后交易日期', width: 120,fixed: 'left', sort: true},
-                    {field: 'opendate', title: '开户日期', width: 100,fixed: 'left', sort: true},
+                    {field: 'availbal', title: '可用余额', width: 100, fixed: 'left', sort: true},
+                    {field: 'balance', title: '总余额', width: 100, fixed: 'left', sort: true},
+                    {field: 'frozebal', title: '冻结余额', width: 100, fixed: 'left', sort: true},
+                    {field: 'lasttranstime', title: '最后交易日期', width: 120, fixed: 'left', sort: true},
+                    {field: 'opendate', title: '开户日期', width: 100, fixed: 'left', sort: true},
                     {
-                        field: 'accno', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
-                            if (item.transStatus != 'closed') {
+                        field: 'accno',
+                        align: 'center',
+                        title: '操作',
+                        fixed: 'right',
+                        templet: function (item) {
+                            if (item.transStatus !== 'closed') {
                                 let html = ' <a class="layui-btn  layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>注销</a> ';
                                 return html;
-                            }else {
+                            } else {
                                 return '';
                             }
                         }
@@ -93,9 +112,9 @@
                 }, function (data) {
                     console.log(data.code);
                     layer.closeAll('loading');
-                    if (data.code == 200) {
+                    if (data.code === 200) {
                         layer.msg(data.msg, {icon: 1});
-                    } else if (data.code == 401) {
+                    } else if (data.code === 401) {
                         layer.msg(data.msg, {icon: 2, time: 1500}, function () {
                             location.replace('[[@{/login}]]');
                         }, 1000);
@@ -107,9 +126,9 @@
                 }, function (ret) {
                     console.log(ret);
                     layer.closeAll('loading');
-                    if(ret.transStatus==403){
+                    if (ret.transStatus === 403) {
                         layer.msg('没有权限', {icon: 2});
-                    }else{
+                    } else {
                         layer.msg('请求失败了,请稍后再试', {icon: 2});
                     }
                 });
diff --git a/src/main/resources/templates/system/user/index.html b/src/main/resources/templates/system/user/index.html
index dc009c7..8e13364 100644
--- a/src/main/resources/templates/system/user/index.html
+++ b/src/main/resources/templates/system/user/index.html
@@ -12,7 +12,8 @@
             <input id="search-value-user" class="layui-input search-input" type="text" placeholder="输入用户名称"/>&emsp;
             <button id="btn-search-user" class="layui-btn icon-btn" data-type="search"><i class="layui-icon">&#xe615;</i>搜索
             </button>
-            <button id="btn-add-user" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户</button>
+            <button id="btn-add-user" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户
+            </button>
         </div>
         <table class="layui-table" id="usertable" lay-filter="usertable"></table>
     </div>
@@ -30,55 +31,47 @@
             page: true,
             cols: [
                 [
-                    {field: 'name', title: '名称', width: 80,fixed: 'left', sort: true},
-                    {field: 'sex', title: '性别',fixed: 'left', width: 80, templet: function (item) {
-                            if (item.sex === 'male') {
-                                return '男'
-                            } else if (item.sex === 'female') {
-                                return '女'
-                            } else {
-                                return '男'
-                            }
+                    {field: 'name', title: '名称', width: 80, fixed: 'left', sort: true},
+                    {
+                        field: 'sex', title: '性别', fixed: 'left', width: 80,
+                        templet: function (item) {
+                            return getTempDictValue('sexList', item.sex);
                         }
                     },
-                    {field: 'status', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
+                    {
+                        field: 'status', title: '状态', fixed: 'left', width: 80, templet: function (item) {
+                            let desc = getTempDictValue('accountStatusList', item.status)
                             if (item.status === 'normal') {
-                                return '<span class="layui-badge layui-bg-green">正常</span>'
+                                return '<span class="layui-badge layui-bg-green">' + desc + '</span>'
                             } else if (item.status === 'closed') {
-                                return '<span class="layui-badge">注销</span>'
+                                return '<span class="layui-badge">' + desc + '</span>'
                             } else if (item.status === 'locked') {
-                                return '<span class="layui-badge layui-bg-orange">锁定</span>'
-                            }  else {
+                                return '<span class="layui-badge layui-bg-orange">' + desc + '</span>'
+                            } else {
                                 return '异常'
                             }
                         }
                     },
-                    {field: 'idtype', align: 'center',width: 100,  title: '证件类型', fixed: 'left', templet: function (item) {
-                            if (item.idtype === '1') {
-                                return '身份证'
-                            } else if (item.idtype === '2') {
-                                return '护照'
-                            } else if (item.idtype === '3') {
-                                return '驾照'
-                            } else if (item.idtype === '4') {
-                                return '港澳通行证'
-                            } else if (item.idtype === '5') {
-                                return '学工号'
-                            } else {
-                                return '其他'
-                            }
+                    {
+                        field: 'idtype', align: 'center', width: 100, title: '证件类型', fixed: 'left',
+                        templet: function (item) {
+                            return getTempDictValue('idtypeList', item.idtype);
                         }
                     },
-                    {field: 'idno', title: '证件号', width: 120,fixed: 'left', sort: true},
-                    {field: 'email', title: '邮箱', width: 100,fixed: 'left', sort: true},
-                    {field: 'mobile', title: '手机', width: 120,fixed: 'left', sort: true},
-                    {field: 'tel', title: '电话', width: 100,fixed: 'left', sort: true},
-                    {field: 'addr', title: '地址', width: 200,fixed: 'left', sort: true},
-                    {field: 'lastsaved', title: '最后修改时间', width: 140,fixed: 'left', sort: true},
+                    {field: 'idno', title: '证件号', width: 120, fixed: 'left', sort: true},
+                    {field: 'email', title: '邮箱', width: 100, fixed: 'left', sort: true},
+                    {field: 'mobile', title: '手机', width: 120, fixed: 'left', sort: true},
+                    {field: 'tel', title: '电话', width: 100, fixed: 'left', sort: true},
+                    {field: 'addr', title: '地址', width: 200, fixed: 'left', sort: true},
+                    {field: 'lastsaved', title: '最后修改时间', width: 140, fixed: 'left', sort: true},
                     {
-                        field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
-                            let html =  ' <a class="layui-btn  layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ';
-                            html +='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
+                        field: 'userid',
+                        align: 'center',
+                        title: '操作',
+                        fixed: 'right',
+                        templet: function (item) {
+                            let html = ' <a class="layui-btn  layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ';
+                            html += '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
                             /*html +=  '<a class="layui-btn  layui-btn-xs" lay-event="other"><i class="layui-icon layui-icon-link"></i>交易记录</a> ';*/
                             return html;
                         }
@@ -142,9 +135,9 @@
                 }, function (ret) {
                     console.log(ret);
                     layer.closeAll('loading');
-                    if(ret.transStatus===403){
+                    if (ret.transStatus === 403) {
                         layer.msg('没有权限', {icon: 2});
-                    }else{
+                    } else {
                         layer.msg('请求失败了,请稍后再试', {icon: 2});
                     }
                 });