人口基本信息- 增加了条件查询跳转页
This commit is contained in:
parent
fe65dc6801
commit
280c35d76f
@ -0,0 +1,44 @@
|
||||
package com.cm.population.controller.route.populationinfo;
|
||||
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.component.SecurityComponent;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.pojo.bos.UserInfoBO;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @ClassName: PopulationInfoController
|
||||
* @Description: 基础人口信息
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2023-10-24 11:55:46
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "基础人口信息路由")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/populationinfo-data")
|
||||
public class PopulationInfoBigdataRouteController extends AbstractController {
|
||||
|
||||
@Autowired
|
||||
protected SecurityComponent securityComponent;
|
||||
|
||||
@GetMapping("nation")
|
||||
public ModelAndView nation(@RequestParam String nation) {
|
||||
ModelAndView mv = new ModelAndView("populationinfo/list-bigdata");
|
||||
mv.addObject("params", "nation=" + nation);
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("sex")
|
||||
public ModelAndView sex(@RequestParam String sex) {
|
||||
ModelAndView mv = new ModelAndView("populationinfo/list-bigdata");
|
||||
mv.addObject("params", "sex=" + sex);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
@ -1045,6 +1045,12 @@
|
||||
<if test="idcardType != null and idcardType != ''">
|
||||
AND t1.idcard_type = #{idcardType}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
AND t1.nation = #{nation}
|
||||
</if>
|
||||
<if test="sex != null and sex != ''">
|
||||
AND t1.sex = #{sex}
|
||||
</if>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
|
481
src/main/resources/templates/populationinfo/list-bigdata.html
Normal file
481
src/main/resources/templates/populationinfo/list-bigdata.html
Normal file
@ -0,0 +1,481 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<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="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
.layui-form-select{
|
||||
min-width:200px!important;
|
||||
}
|
||||
.layui-select-title{
|
||||
min-width:200px!important;
|
||||
}
|
||||
.layui-select-title input{
|
||||
min-width:200px!important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="name" class="layui-input search-item" placeholder="请输入姓名">
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item" id="idcardTypeSelectTemplateBox" lay-filter="idcardTypeSelectTemplateBox"></div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="idcard" class="layui-input search-item" placeholder="请输入证件号">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<script type="text/html" id="headerToolBar">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
|
||||
<i class="fa fa-lg fa-edit"></i> 查看详情
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script id="idcardTypeSelectTemplate" type="text/html" lay-search>
|
||||
<select id="idcardType" name="idcardType">
|
||||
<option value="">请选择证件类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictionaryName}}">{{item.dictionaryName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'form', 'laytpl', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/populationinfo/listpage?[[${params}]]';
|
||||
|
||||
// 初始化证件类型下拉选择
|
||||
function initIdcardTypeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('idcardTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('idcardTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'idcardTypeSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initIdcardTypeSelect();
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'name', width: 130, title: '姓名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'idcardType', width: 130, title: '证件类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'idcard', width: 180, title: '证件号码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'birthday', width: 130, title: '出生日期', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'sex', width: 130, title: '性别', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'nation', width: 130, title: '民族', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'label', width: 380, title: '标签', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row['labelList'];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
var b = "";
|
||||
for(var i = 0 ; i < rowData.length; i++) {
|
||||
b = b + '<button type="button" class="layui-btn layui-btn-xs" style="background-color: ' + rowData[i].color + ';">' + rowData[i].name + '</button>';
|
||||
}
|
||||
return b;
|
||||
}
|
||||
},
|
||||
{field: 'creatorName', width: 120, title: '当前认领人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'creator', width:120, title: '认领记录', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button type="button" lay-event="bindEvent" class="layui-btn layui-btn-xs" >认领记录</button>';
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
name: $('#name').val(),
|
||||
idcardType: $('#idcardType').val(),
|
||||
idcard: $('#idcard').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
|
||||
// 表格行中按钮事件
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var data = obj.data;
|
||||
if(layEvent === 'bindEvent') {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: data.name + "[" + data.idcard + "](近50条)",
|
||||
closeBtn: 1,
|
||||
offset:"r",
|
||||
area: ['500px', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/populationinfo/log?populationInfoId={populationInfoId}', [data.populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/populationinfo/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/populationinfo/save', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/populationinfo/update?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'removeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['populationInfoId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
}else if(layEvent === 'excelEvent') {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 1,
|
||||
area: ['70%', '90%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/populationinfo/importexcel', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'correctEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "社区矫正人员",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/correct/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'releaseEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "刑满释放人员",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/release/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'disputeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "矛盾纠纷",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/dispute/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'securityEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "社会治安",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/security/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'drugEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "吸毒人员",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/drug/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'cultEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "涉邪人员",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/cult/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'petitionEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: "重点上访户",
|
||||
closeBtn: 1,
|
||||
area: ['95%', '95%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/petition/list?populationInfoId={populationInfoId}', [checkDatas[0].populationInfoId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user