人口基本信息- 增加了按照人员类型查询 , 增加了Excel导出功能(不脱敏) , 修正了流动人口和常住人口的判定条件

This commit is contained in:
java_cuibaocheng@163.com 2024-01-15 11:19:25 +08:00
parent 3ecd546459
commit bdca0434e7
4 changed files with 219 additions and 11 deletions

View File

@ -901,6 +901,33 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul
params.put("populationInfoIds", list);
}
}
List<String> tabLevelList = new ArrayList<>();
if(params.get("tabLevel") != null) {
Object obj = params.get("tabLevel");
if (obj instanceof String) {
List<String> list = Arrays.asList(params.get("tabLevel").toString().split(","));
tabLevelList.addAll(list);
}
}
if(params.get("tabLevelGroup") != null) {
Object obj = params.get("tabLevelGroup");
if (obj instanceof String) {
List<String> groupList = Arrays.asList(params.get("tabLevelGroup").toString().split(","));
List<DataDictionaryDTO> list = iDataDictionaryService.listDictionaryByParentId("5ea50f00-3d76-492c-8680-9c30d50cce21");
a:for(DataDictionaryDTO dto : list) {
if (groupList.contains(dto.getDictionarySummary())) {
for(String s : tabLevelList) {
if (dto.getDictionaryId().equals(s)) {
continue a;
}
}
tabLevelList.add(dto.getDictionaryId());
}
}
}
}
params.put("tabLevelIds", tabLevelList);
List<PopulationInfoDTO> listList = populationInfoDao.list(params);
LinkedHashSet<String> arr1 = new LinkedHashSet<>();
for(PopulationInfoDTO dto : listList) {

View File

@ -1241,10 +1241,10 @@
AND ( t1.organization != '中国共产党党员' AND t1.organization != '中国共产主义青年团团员' AND t1.organization != '中国共产党预备党员')
</if>
<if test="type != null and type != '' and type == '常住人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' OR 6 > DATE_ADD(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR DATE_SUB(CURDATE(), INTERVAL 6 MONTH) > t1.flow_time)
</if>
<if test="type != null and type != '' and type == '流动人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' AND t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
</if>
<if test="type != null and type != '' and type == '户籍人口'">
AND t1.domicile_address_type = '3'
@ -1357,14 +1357,35 @@
</foreach>
</if>
<if test="type != null and type != '' and type == '常住人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' OR 6 > DATE_ADD(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR DATE_SUB(CURDATE(), INTERVAL 6 MONTH) > t1.flow_time)
</if>
<if test="type != null and type != '' and type == '流动人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' AND t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
</if>
<if test="type != null and type != '' and type == '户籍人口'">
AND t1.domicile_address_type = '3'
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '矛盾纠纷'">
AND EXISTS (SELECT 1 FROM population_dispute temp WHERE temp.is_delete = 0 AND temp.party_population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '涉邪人员'">
AND EXISTS (SELECT 1 FROM population_cult temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '吸毒人员'">
AND EXISTS (SELECT 1 FROM population_drug temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '社会治安'">
AND EXISTS (SELECT 1 FROM population_security temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '重点上访'">
AND EXISTS (SELECT 1 FROM population_petition temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="teshu != null and teshu != '' and teshu == '社区矫正'">
AND EXISTS (SELECT 1 FROM population_correct temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="teshu != null and teshu != '' and teshu == '刑满释放'">
AND EXISTS (SELECT 1 FROM population_release temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="creator != null and creator != ''">
AND t1.creator = #{creator}
</if>
@ -1500,14 +1521,35 @@
</foreach>
</if>
<if test="type != null and type != '' and type == '常住人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' OR 6 > DATE_ADD(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR DATE_SUB(CURDATE(), INTERVAL 6 MONTH) > t1.flow_time)
</if>
<if test="type != null and type != '' and type == '流动人口'">
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NULL OR t1.flow_time = '' OR t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
AND t1.domicile_address_type != '3' AND (t1.flow_time IS NOT NULL AND t1.flow_time != '' AND t1.flow_time >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) )
</if>
<if test="type != null and type != '' and type == '户籍人口'">
AND t1.domicile_address_type = '3'
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '矛盾纠纷'">
AND EXISTS (SELECT 1 FROM population_dispute temp WHERE temp.is_delete = 0 AND temp.party_population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '涉邪人员'">
AND EXISTS (SELECT 1 FROM population_cult temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '吸毒人员'">
AND EXISTS (SELECT 1 FROM population_drug temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '社会治安'">
AND EXISTS (SELECT 1 FROM population_security temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="xinfang != null and xinfang != '' and xinfang == '重点上访'">
AND EXISTS (SELECT 1 FROM population_petition temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="teshu != null and teshu != '' and teshu == '社区矫正'">
AND EXISTS (SELECT 1 FROM population_correct temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="teshu != null and teshu != '' and teshu == '刑满释放'">
AND EXISTS (SELECT 1 FROM population_release temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id)
</if>
<if test="(residentialId != null and residentialId != '') or (buildingId != null and buildingId != '') or (houseId != null and houseId != '')">
<if test="residentialId != null and residentialId != ''"><!-- 小区 -->
AND hh.residential_id = #{residentialId}

View File

@ -593,7 +593,7 @@
return rowData;
}
},
{field: 'label', width: 380, title: '标签', align:'center',
/*{field: 'label', width: 380, title: '标签', align:'center',
templet: function(row) {
var rowData = row['labelList'];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -605,7 +605,7 @@
}
return b;
}
}/*,
},
{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>';

View File

@ -152,12 +152,24 @@
<div class="layui-inline layui-form search-item" id="idcardTypeSelectTemplateBox" lay-filter="idcardTypeSelectTemplateBox"></div>
<div class="layui-inline layui-form search-item" >
<select id="type" name="type">
<option value="">请选择人类型</option>
<option value="">请选择人类型</option>
<option value="户籍人口">户籍人口</option>
<option value="常住人口">常住人口</option>
<option value="流动人口">流动人口</option>
</select>
</div>
<div class="layui-inline layui-form search-item" >
<select id="xinfang" name="xinfang">
<option value="">请选择人员类型</option>
<option value="社区矫正">社区矫正</option>
<option value="刑满释放">刑满释放</option>
<option value="矛盾纠纷">矛盾纠纷</option>
<option value="社会治安">社会治安</option>
<option value="吸毒人员">吸毒人员</option>
<option value="涉邪人员">涉邪人员</option>
<option value="重点上访">重点上访</option>
</select>
</div>
<div class="layui-inline">
<input type="text" id="idcard" class="layui-input search-item" placeholder="请输入证件号">
</div>
@ -254,6 +266,9 @@
<button type="button" class="layui-btn layui-btn-sm" lay-event="showEvent">
<i class="fa fa-lg fa-edit"></i> 查看
</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="excelOutEvent">
Excel导出(未脱敏)
</button>
<!-- <button type="button" class="layui-btn layui-btn-sm" style="display: none" lay-event="excelEvent">-->
<!-- <i class="fa fa-lg fa-file-excel-o"></i>Excel导入-->
<!-- </button>-->
@ -278,6 +293,7 @@
<button type="button" class="layui-btn layui-btn-sm" lay-event="petitionEvent">
重点上访户
</button>
<!-- <button type="button" class="layui-btn layui-btn-sm" lay-event="tiaoshiEvent">
调试
</button>-->
@ -302,13 +318,15 @@
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'form', 'laytpl', 'laydate', 'common'], function() {
index: 'lib/index', //主入口模块
excel: 'layui_exts/excel'
}).use(['index', 'table', 'form', 'laytpl', 'laydate', 'excel', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var excel = layui.excel;
var form = layui.form;
var laytpl = layui.laytpl;
var common = layui.common;
@ -520,6 +538,7 @@
}
initIdcardTypeSelect();
var totalCount = 0;
// 初始化表格
function initTable() {
table.render({
@ -625,6 +644,7 @@
],
page: true,
parseData: function(data) {
totalCount = data.total;
return {
'code': 0,
'msg': '',
@ -664,6 +684,14 @@
buildingId: "",
houseId:""
};
var xinfang = $("#xinfang").val();
if(xinfang != "") {
if(xinfang == '社区矫正' || xinfang == '刑满释放') {
dataParams.teshu = xinfang;
}else{
dataParams.xinfang = xinfang;
}
}
if ($("#creatorArea1").val() == undefined || $("#creatorArea1").val() == "" || $("#creatorArea1").val() == "请选择街道" ) {
return dataParams;
}else{
@ -984,8 +1012,119 @@
}, function () {
top.dialog.close(layIndex);
});
}else if(layEvent === 'excelOutEvent') {
var loadLayerIndex;
var data1 = getParams();
top.restAjax.get(top.restAjax.path('api/populationinfo/list', []), data1, null, function(code, data) {
exportApi(data);
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
var logMsg = "数据正在查询 . </br>请勿关闭窗口 ....";
loadLayerIndex = top.dialog.msg(logMsg, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
});
/**
* 封装导出的格式
* */
function getExcelFormat(content, bold, color) {
return {
v: content,// 内容
t:"s", // 单元格的类型 'b'布尔值、'n'数字、'e'错误、's'字符串、'd'日期
s:{
alignment: {
horizontal: 'center',// "left"、"center" 或 "right" 水平对齐
vertical: 'center',// "bottom"、"center" 或 "top" 垂直对齐
},
font: {
bold: bold, // 是否加粗
// sz: 12 字号
color: {
rgb: color // 文字颜色
}
}
}
};
}
/**
* 将传入的数据导出
*/
function exportApi(list) {
var timestart = Date.now();
var logMsg = "数据正在导出 . </br>请勿关闭窗口 ....";
var loadLayerIndex = top.dialog.msg(logMsg, {icon: 16, time: 0, shade: 0.3});
/**
* v单元格的值
* t单元格的类型 'b'布尔值、'n'数字、'e'错误、's'字符串、'd'日期
* s单元格的样式
*/
var data = [
{
name: getExcelFormat("姓名", true , '000000'),
idcardType: getExcelFormat("证件类型", true , '000000'),
idcard: getExcelFormat("证件号码", true , '000000'),
birthday: getExcelFormat("出生日期", true , '000000'),
sex: getExcelFormat("性别", true , '000000'),
nation: getExcelFormat("民族", true , '000000'),
label: getExcelFormat("标签", true , '000000'),
creatorName: getExcelFormat("当前认领人", true , '000000'),
}
];
for(var i = 0 ; i < list.length; i++) {
var rowData = list[i].labelList;
var label = "";
for(var j = 0 ; j < rowData.length; j++) {
label = label + rowData[j].name + "、";
}
console.log(rowData);
data.push({
name:getExcelFormat(list[i].name, false , '000000'),
idcardType:getExcelFormat(list[i].idcardType, false, 'FF0000'),
idcard:getExcelFormat(list[i].idcard, false, '000000'),
birthday:getExcelFormat(list[i].birthday, false, '000000'),
sex:getExcelFormat(list[i].sex, false, '000000'),
nation:getExcelFormat(list[i].nation, false, '000000'),
label:getExcelFormat(label, false, '000000'),
creatorName:getExcelFormat(list[i].creatorName, false, '000000')
});
}
console.log("data" , data);
// A列宽 200, 默认给80
var colConf = excel.makeColConfig({
'A': 100,
'B': 150,
'C': 150,
'D': 150,
'E': 100,
'F': 100,
'G': 350,
'H': 150,
}, 140);
// 每一行的行高, 默认给20
var rowConf = excel.makeRowConfig({
1: 30,
}, 20)
excel.exportExcel({
sheet1: data
}, '人口信息.xlsx', 'xlsx', {
extend: {
sheet1: {
'!cols': colConf
, '!rows': rowConf
}
}
})
var timeend = Date.now()
var spent = (timeend - timestart) / 1000
top.dialog.close(loadLayerIndex);
layer.msg('导入耗时 :' + spent + ' 秒');
}
});
</script>
</body>