Administrator 4 years ago
parent
commit
467f674b1b

+ 13 - 10
leiSP-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -91,7 +91,7 @@ var table = {
                     pagination: options.pagination,                     // 是否显示分页(*)
                     paginationLoop: options.paginationLoop,             // 是否启用分页条无限循环的功能
                     pageNumber: 1,                                      // 初始化加载第一页,默认第一页
-                    pageSize: options.pageSize,                         // 每页的记录行数(*) 
+                    pageSize: options.pageSize,                         // 每页的记录行数(*)
                     pageList: options.pageList,                         // 可供选择的每页的行数(*)
                     firstLoad: options.firstLoad,                       // 是否首次请求加载数据,对于数据较大可以配置false
                     escape: options.escape,                             // 转义HTML字符串
@@ -141,7 +141,7 @@ var table = {
             // 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符
             getOptionsIds: function(separator) {
             	var _separator = $.common.isEmpty(separator) ? "," : separator;
-            	var optionsIds = "";  
+            	var optionsIds = "";
             	$.each(table.config, function(key, value){
             		optionsIds += "#" + key + _separator;
             	});
@@ -158,7 +158,7 @@ var table = {
                         isAsc:          params.order
             		};
             	var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
-            	return $.extend(curParams, $.common.formToJSON(currentId)); 
+            	return $.extend(curParams, $.common.formToJSON(currentId));
             },
             // 请求获取数据后处理回调函数
             responseHandler: function(res) {
@@ -794,9 +794,9 @@ var table = {
             },
             // 弹出层指定参数选项
             openOptions: function (options) {
-            	var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; 
-            	var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title; 
-                var _width = $.common.isEmpty(options.width) ? "800" : options.width; 
+            	var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url;
+            	var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title;
+                var _width = $.common.isEmpty(options.width) ? "800" : options.width;
                 var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height;
                 var _btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'];
                 if ($.common.isEmpty(options.yes)) {
@@ -946,7 +946,7 @@ var table = {
             detail: function(id, width, height) {
             	table.set();
             	var _url = $.operate.detailUrl(id);
-            	var _width = $.common.isEmpty(width) ? "800" : width; 
+            	var _width = $.common.isEmpty(width) ? "800" : width;
                 var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height;
             	//如果是移动端,就使用自适应大小弹窗
             	if ($.common.isMobile()) {
@@ -958,7 +958,7 @@ var table = {
        				width: _width,
        				height: _height,
        				url: _url,
-       				skin: 'layui-layer-gray', 
+       				skin: 'layui-layer-gray',
        				btn: ['关闭'],
        				yes: function (index, layero) {
        	                layer.close(index);
@@ -993,7 +993,7 @@ var table = {
 	            	    $.operate.submit(url, "post", "json", data);
 	                }
             	});
-            	
+
             },
             // 批量删除信息
             removeAll: function() {
@@ -1161,6 +1161,7 @@ var table = {
             },
             // 保存结果弹出msg刷新table表格
             ajaxSuccess: function (result) {
+
             	if (result.code == web_status.SUCCESS && table.options.type == table_type.bootstrapTable) {
                 	$.modal.msgSuccess(result.msg);
             		$.table.refresh();
@@ -1178,6 +1179,7 @@ var table = {
             },
             // 成功结果提示msg(父窗体全局更新)
             saveSuccess: function (result) {
+
             	if (result.code == web_status.SUCCESS) {
             		$.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
                 } else if (result.code == web_status.WARNING) {
@@ -1189,6 +1191,7 @@ var table = {
             },
             // 成功回调执行事件(父窗体静默更新)
             successCallback: function(result) {
+
                 if (result.code == web_status.SUCCESS) {
                 	var parent = window.parent;
                     if (parent.table.options.type == table_type.bootstrapTable) {
@@ -1604,4 +1607,4 @@ modal_status = {
     SUCCESS: "success",
     FAIL: "error",
     WARNING: "warning"
-};
+};

+ 1 - 1
mybusiness/src/main/java/com/sooka/system/controller/TUSfzController.java

@@ -65,7 +65,7 @@ public class TUSfzController extends BaseController {
         tUSfz.setIpaddress(ipaddress);
         List<TUSfz> list = tUSfzService.selectTUSfzList(tUSfz);
         if(list == null){
-            return getDataTable("错了");
+            return getDataTable("秘钥错误或过期,请联系管理员");
         }
         return getDataTable(list);
     }

+ 2 - 0
mybusiness/src/main/java/com/sooka/system/domain/BaseBusinessEntity.java

@@ -12,5 +12,7 @@ public class BaseBusinessEntity extends BaseEntity {
     private String ipaddress;
     private String os;
 
+    private String secretKey;
+
 
 }

+ 2 - 1
mybusiness/src/main/java/com/sooka/system/service/impl/TUSfzServiceImpl.java

@@ -63,7 +63,8 @@ public class TUSfzServiceImpl implements ITUSfzService {
     @Override
     public List<TUSfz> selectTUSfzList(TUSfz tUSfz) {
         Map map = new HashMap();
-        map.put("secretKey", "0f0806f206544597840df9cade4127bb");
+        map.put("secretKey", tUSfz.getSecretKey());
+        map.put("intCode", "00001");
         String r = HttpUtil.doGet("http://127.0.0.1:88/api/test/sfz", "", map);
         JSONObject jsonpObject = JSONObject.parseObject(r);
         if(jsonpObject != null && jsonpObject.getString("code").equals("1000")){

+ 80 - 67
mybusiness/src/main/resources/templates/system/sfz/sfz.html

@@ -1,73 +1,86 @@
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
-    <th:block th:include="include :: header('身份证列表')" />
+    <th:block th:include="include :: header('身份证列表')"/>
 </head>
 <body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                <label>姓名:</label>
-                                <input type="text" name="name"/>
-                            </li>
-                            <li>
-                                <label>公民身份号码:</label>
-                                <input type="text" name="idcardNo"/>
-                            </li>
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>姓名:</label>
+                            <input type="text" name="name"/>
+                        </li>
+                        <li>
+                            <label>公民身份号码:</label>
+                            <input type="text" name="idcardNo"/>
+                        </li>
+                        <li>
+                            <label>授权码:</label>
+                            <input type="text" id="secretKey" name="secretKey"/>
+                        </li>
 
-                            <li>
-                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                            </li>
-                        </ul>
-                    </div>
-                </form>
-            </div>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i
+                                    class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
+                                    class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
 
-            <div class="btn-group-sm" id="toolbar" role="group">
-                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:sfz:add">-->
-                    <!--<i class="fa fa-plus"></i> 添加-->
-                <!--</a>-->
-                <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:sfz:edit">-->
-                    <!--<i class="fa fa-edit"></i> 修改-->
-                <!--</a>-->
-                <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:sfz:remove">-->
-                    <!--<i class="fa fa-remove"></i> 删除-->
-                <!--</a>-->
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sfz:export">
-                    <i class="fa fa-download"></i> 导出
-                </a>
-            </div>
-            <div class="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:sfz:add">-->
+            <!--<i class="fa fa-plus"></i> 添加-->
+            <!--</a>-->
+            <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:sfz:edit">-->
+            <!--<i class="fa fa-edit"></i> 修改-->
+            <!--</a>-->
+            <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:sfz:remove">-->
+            <!--<i class="fa fa-remove"></i> 删除-->
+            <!--</a>-->
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sfz:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
         </div>
     </div>
+</div>
 
-     <input type="hidden" id="birthDate">
+<input type="hidden" id="birthDate">
 
 
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('system:sfz:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('system:sfz:remove')}]];
-        var prefix = ctx + "system/sfz";
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('system:sfz:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('system:sfz:remove')}]];
+    var prefix = ctx + "system/sfz";
 
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                modalName: "身份证",
-                columns: [{
-                    checkbox: true
-                },
+    function query() {
+
+        var secretKey = $("#secretKey").val();
+        if (secretKey == null || secretKey === '') {
+            $.modal.msgError('请输入授权码!');
+            return;
+        }
+
+        var options = {
+            url: prefix + "/list",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            exportUrl: prefix + "/export",
+            modalName: "身份证",
+            columns: [{
+                checkbox: true
+            },
                 {
                     field: 'id',
                     title: '主键ID',
@@ -118,29 +131,29 @@
                 {
                     field: 'photograph',
                     title: '相片',
-                    formatter: function(value, row, index) {
-                        return  "<image src='data:image/jpg;base64,"+value+"'>"+"</image>";
+                    formatter: function (value, row, index) {
+                        return "<image src='data:image/jpg;base64," + value + "'>" + "</image>";
                     }
                 },
                 {
                     title: '操作',
                     align: 'center',
-                    formatter: function(value, row, index) {
+                    formatter: function (value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
                         return actions.join('');
                     }
                 }]
-            };
-            $.table.init(options);
-        });
+        };
+        $.table.init(options);
+    }
 
-        function detail(id) {
-            $.modal.open("身份证详情","/system/sfz/detail/"+id);
-        }
 
+    function detail(id) {
+        $.modal.open("身份证详情", "/system/sfz/detail/" + id);
+    }
 
 
-    </script>
+</script>
 </body>
 </html>