diff --git a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java index eccb467..bd2ca92 100644 --- a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java +++ b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java @@ -901,6 +901,33 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul params.put("populationInfoIds", list); } } + List tabLevelList = new ArrayList<>(); + if(params.get("tabLevel") != null) { + Object obj = params.get("tabLevel"); + if (obj instanceof String) { + List 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 groupList = Arrays.asList(params.get("tabLevelGroup").toString().split(",")); + List 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 listList = populationInfoDao.list(params); LinkedHashSet arr1 = new LinkedHashSet<>(); for(PopulationInfoDTO dto : listList) { diff --git a/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml b/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml index 4b31c1f..74cb10f 100644 --- a/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml +++ b/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml @@ -1241,10 +1241,10 @@ AND ( t1.organization != '中国共产党党员' AND t1.organization != '中国共产主义青年团团员' AND t1.organization != '中国共产党预备党员') - 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) - 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) ) AND t1.domicile_address_type = '3' @@ -1357,14 +1357,35 @@ - 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) - 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) ) AND t1.domicile_address_type = '3' + + AND EXISTS (SELECT 1 FROM population_dispute temp WHERE temp.is_delete = 0 AND temp.party_population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_cult temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_drug temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_security temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_petition temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_correct temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_release temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + AND t1.creator = #{creator} @@ -1500,14 +1521,35 @@ - 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) - 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) ) AND t1.domicile_address_type = '3' + + AND EXISTS (SELECT 1 FROM population_dispute temp WHERE temp.is_delete = 0 AND temp.party_population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_cult temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_drug temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_security temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_petition temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_correct temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + + + AND EXISTS (SELECT 1 FROM population_release temp WHERE temp.is_delete = 0 AND temp.population_info_id = t1.population_info_id) + AND hh.residential_id = #{residentialId} diff --git a/src/main/resources/templates/populationinfo/list-creator.html b/src/main/resources/templates/populationinfo/list-creator.html index 62cca35..b263076 100644 --- a/src/main/resources/templates/populationinfo/list-creator.html +++ b/src/main/resources/templates/populationinfo/list-creator.html @@ -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 ''; diff --git a/src/main/resources/templates/populationinfo/list.html b/src/main/resources/templates/populationinfo/list.html index 944be91..2a95b02 100644 --- a/src/main/resources/templates/populationinfo/list.html +++ b/src/main/resources/templates/populationinfo/list.html @@ -152,12 +152,24 @@
+
+ +
@@ -254,6 +266,9 @@ + @@ -278,6 +293,7 @@ + @@ -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 = "数据正在查询 .
请勿关闭窗口 ...."; + 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 = "数据正在导出 .
请勿关闭窗口 ...."; + 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 + ' 秒'); + } });