diff --git a/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoDTO.java b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoDTO.java index 86e2597..64abd2d 100644 --- a/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoDTO.java @@ -80,6 +80,14 @@ public class PopulationInfoDTO { private String motherIdcard; @ApiModelProperty(name = "motherPhone", value = "母亲电话") private String motherPhone; + @ApiModelProperty(name = "spouseId", value = "配偶ID") + private String spouseId; + @ApiModelProperty(name = "spouseName", value = "配偶姓名") + private String spouseName; + @ApiModelProperty(name = "spouseIdcard", value = "配偶证件") + private String spouseIdcard; + @ApiModelProperty(name = "spousePhone", value = "配偶电话") + private String spousePhone; @ApiModelProperty(name = "relationship", value = "与户主关系") private String relationship; @ApiModelProperty(name = "domicileAddress", value = "户籍详细地址") @@ -184,6 +192,38 @@ public class PopulationInfoDTO { @ApiModelProperty(name = "创建人所在社区名称", value = "创建人所在社区名称") private String creatorArea2; + public String getSpouseId() { + return spouseId == null ? "" : spouseId.trim(); + } + + public void setSpouseId(String spouseId) { + this.spouseId = spouseId; + } + + public String getSpouseName() { + return spouseName == null ? "" : spouseName.trim(); + } + + public void setSpouseName(String spouseName) { + this.spouseName = spouseName; + } + + public String getSpouseIdcard() { + return spouseIdcard == null ? "" : spouseIdcard.trim(); + } + + public void setSpouseIdcard(String spouseIdcard) { + this.spouseIdcard = spouseIdcard; + } + + public String getSpousePhone() { + return spousePhone == null ? "" : spousePhone.trim(); + } + + public void setSpousePhone(String spousePhone) { + this.spousePhone = spousePhone; + } + public String getCreatorArea1() { return creatorArea1; } diff --git a/src/main/java/com/cm/population/pojo/vos/populationinfo/PopulationInfoVO.java b/src/main/java/com/cm/population/pojo/vos/populationinfo/PopulationInfoVO.java index e741886..ad35d6e 100644 --- a/src/main/java/com/cm/population/pojo/vos/populationinfo/PopulationInfoVO.java +++ b/src/main/java/com/cm/population/pojo/vos/populationinfo/PopulationInfoVO.java @@ -91,6 +91,14 @@ public class PopulationInfoVO { private String motherIdcard; @ApiModelProperty(name = "motherPhone", value = "母亲电话") private String motherPhone; + @ApiModelProperty(name = "spouseId", value = "配偶ID") + private String spouseId; + @ApiModelProperty(name = "spouseName", value = "配偶姓名") + private String spouseName; + @ApiModelProperty(name = "spouseIdcard", value = "配偶证件") + private String spouseIdcard; + @ApiModelProperty(name = "spousePhone", value = "配偶电话") + private String spousePhone; @ApiModelProperty(name = "relationship", value = "与户主关系") @CheckEmptyAnnotation(name = "与户主关系") private String relationship; @@ -182,6 +190,38 @@ public class PopulationInfoVO { @ApiModelProperty(name = "othertext", value = "其他说明") private String othertext; + public String getSpouseId() { + return spouseId == null ? "" : spouseId.trim(); + } + + public void setSpouseId(String spouseId) { + this.spouseId = spouseId; + } + + public String getSpouseName() { + return spouseName == null ? "" : spouseName.trim(); + } + + public void setSpouseName(String spouseName) { + this.spouseName = spouseName; + } + + public String getSpouseIdcard() { + return spouseIdcard == null ? "" : spouseIdcard.trim(); + } + + public void setSpouseIdcard(String spouseIdcard) { + this.spouseIdcard = spouseIdcard; + } + + public String getSpousePhone() { + return spousePhone == null ? "" : spousePhone.trim(); + } + + public void setSpousePhone(String spousePhone) { + this.spousePhone = spousePhone; + } + public String getLabel() { return label; } 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 bd2ca92..5f5e09d 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 @@ -163,6 +163,21 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul } private void getSpouse(PopulationInfoRelationDTO relationDTO, PopulationInfoDTO dto) { + // 找出系统内的配偶信息 + String spouseIdcard = ""; + if (!StringUtils.isEmpty(dto.getSpouseIdcard())) { + PopulationInfoDTO dto1 = getByIdcardOrId(dto.getSpouseId(), dto.getSpouseIdcard()); + if (dto1 != null) { + PopulationInfoRelationDTO newDto = new PopulationInfoRelationDTO(); + newDto.setSex(dto1.getSex()); + newDto.setOrder(0); + newDto.setName(dto1.getName()); + newDto.setCall("配偶"); + newDto.setPopulationInfoId(dto1.getPopulationInfoId()); + spouseIdcard = dto1.getIdcard(); + relationDTO.getSpouse().add(newDto); + } + } // 找出所有的孩子 List infoDTOList = getByMotherIdOrFatherId(dto.getPopulationInfoId(), dto.getIdcard()); int index = 1; @@ -174,7 +189,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul }else{ dto1 = getByIdcardOrId(tempDTO.getFatherId(), tempDTO.getFatherIdcard()); } - if (dto1 != null) { + if (dto1 != null && !spouseIdcard.equals(dto1.getIdcard())) { PopulationInfoRelationDTO newDto = new PopulationInfoRelationDTO(); newDto.setSex(dto1.getSex()); newDto.setOrder(index++); @@ -238,6 +253,9 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul for (PopulationInfoDTO infoDTO : infoDTOList) { String call = ""; PopulationInfoRelationDTO newDto = new PopulationInfoRelationDTO(); + // 找出配偶 + getSpouse(newDto, infoDTO); + newDto.setSex(infoDTO.getSex()); newDto.setOrder(indexOrder++); newDto.setName(infoDTO.getName()); @@ -339,6 +357,19 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul subDTO.setLevel(level); subDTO.setOrder(dto.getOrder()); resultList.add(subDTO); + // 封装儿子女儿的配偶信息 + if (dto.getSpouse().size() > 0) { + for(PopulationInfoRelationDTO dto1 : dto.getSpouse()) { + PopulationInfoRelationSubDTO subDTO1 = new PopulationInfoRelationSubDTO(); + subDTO1.setId(dto1.getPopulationInfoId()); + subDTO1.setSource(dto.getName() + "(" + dto.getCall() + ")"); + subDTO1.setTarget(dto1.getName() + "(" + dto1.getCall() + ")"); + subDTO1.setSex(dto1.getSex()); + subDTO1.setLevel(level); + subDTO1.setOrder(dto1.getOrder()); + resultList.add(subDTO1); + } + } buiderAfter(subDTO, resultList, dto.getAfter(), level-1); } } 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 74cb10f..aafa347 100644 --- a/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml +++ b/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml @@ -68,6 +68,10 @@ + + + + @@ -321,6 +325,10 @@ mother_name, mother_idcard, mother_phone, + spouse_id, + spouse_name, + spouse_idcard, + spouse_phone, relationship, domicile_address, domicile_address_type, @@ -404,6 +412,10 @@ #{motherName}, #{motherIdcard}, #{motherPhone}, + #{spouseId}, + #{spouseName}, + #{spouseIdcard}, + #{spousePhone}, #{relationship}, #{domicileAddress}, #{domicileAddressType}, @@ -580,6 +592,18 @@ mother_phone = #{motherPhone}, + + spouse_id = #{spouseId}, + + + spouse_name = #{spouseName}, + + + spouse_idcard = #{spouseIdcard}, + + + spouse_phone = #{spousePhone}, + relationship = #{relationship}, @@ -770,6 +794,8 @@ t1.mother_idcard, t1.father_id, t1.father_idcard, + t1.spouse_id, + t1.spouse_idcard, t1.birthday FROM population_population_info t1 @@ -796,6 +822,8 @@ t1.mother_idcard, t1.father_id, t1.father_idcard, + t1.spouse_id, + t1.spouse_idcard, t1.birthday FROM population_population_info t1 @@ -820,6 +848,8 @@ t1.mother_idcard, t1.father_id, t1.father_idcard, + t1.spouse_id, + t1.spouse_idcard, t1.sex, t1.birthday FROM @@ -845,6 +875,8 @@ t1.mother_idcard, t1.father_id, t1.father_idcard, + t1.spouse_id, + t1.spouse_idcard, t1.birthday FROM population_population_info t1 @@ -869,6 +901,8 @@ t1.mother_idcard, t1.father_id, t1.father_idcard, + t1.spouse_id, + t1.spouse_idcard, t1.birthday FROM population_population_info t1 @@ -917,6 +951,10 @@ t1.mother_name, t1.mother_idcard, t1.mother_phone, + t1.spouse_id, + t1.spouse_name, + t1.spouse_idcard, + t1.spouse_phone, t1.relationship, t1.domicile_address, t1.domicile_address_type, @@ -1159,6 +1197,10 @@ t1.mother_name, t1.mother_idcard, t1.mother_phone, + t1.spouse_id, + t1.spouse_name, + t1.spouse_idcard, + t1.spouse_phone, t1.is_oldage, t1.is_disability, t1.is_military, @@ -1330,12 +1372,17 @@ t1.phone, t1.father_id, t1.father_name, + t1.domicile_area_name, t1.father_idcard, t1.father_phone, t1.mother_id, t1.mother_name, t1.mother_idcard, t1.mother_phone, + t1.spouse_id, + t1.spouse_name, + t1.spouse_idcard, + t1.spouse_phone, t1.flow_time, t1.is_oldage, t1.is_disability, @@ -1350,6 +1397,12 @@ population_population_info t1 WHERE t1.is_delete = 0 + + AND t1.creator_area1 = #{creatorArea1} + + + AND t1.creator_area2 = #{creatorArea2} + AND @@ -1452,6 +1505,10 @@ t1.mother_name, t1.mother_idcard, t1.mother_phone, + t1.spouse_id, + t1.spouse_name, + t1.spouse_idcard, + t1.spouse_phone, -- t1.relationship, -- t1.domicile_address, -- t1.domicile_address_type, @@ -2042,6 +2099,10 @@ t1.mother_name, t1.mother_idcard, t1.mother_phone, + t1.spouse_id, + t1.spouse_name, + t1.spouse_idcard, + t1.spouse_phone, t1.relationship, t1.domicile_address, t1.domicile_address_type, diff --git a/src/main/resources/templates/populationinfo/list.html b/src/main/resources/templates/populationinfo/list.html index 2a95b02..1269fa3 100644 --- a/src/main/resources/templates/populationinfo/list.html +++ b/src/main/resources/templates/populationinfo/list.html @@ -1013,6 +1013,10 @@ top.dialog.close(layIndex); }); }else if(layEvent === 'excelOutEvent') { + if ($("#creatorArea1").val() == undefined || $("#creatorArea1").val() == "" || $("#creatorArea1").val() == "请选择街道" ) { + layer.msg("为了提升导出速度 , 请至少选择一个街道"); + return; + } var loadLayerIndex; var data1 = getParams(); top.restAjax.get(top.restAjax.path('api/populationinfo/list', []), data1, null, function(code, data) { @@ -1072,7 +1076,9 @@ birthday: getExcelFormat("出生日期", true , '000000'), sex: getExcelFormat("性别", true , '000000'), nation: getExcelFormat("民族", true , '000000'), + domicileAreaName: getExcelFormat("户籍地址", true , '000000'), label: getExcelFormat("标签", true , '000000'), + creatorArea: getExcelFormat("信息归属", true , '000000'), creatorName: getExcelFormat("当前认领人", true , '000000'), } ]; @@ -1090,7 +1096,9 @@ birthday:getExcelFormat(list[i].birthday, false, '000000'), sex:getExcelFormat(list[i].sex, false, '000000'), nation:getExcelFormat(list[i].nation, false, '000000'), + domicileAreaName:getExcelFormat(list[i].domicileAreaName, false, '000000'), label:getExcelFormat(label, false, '000000'), + creatorArea:getExcelFormat(list[i].creatorArea1 + "/" + list[i].creatorArea2, false, '000000'), creatorName:getExcelFormat(list[i].creatorName, false, '000000') }); } @@ -1103,16 +1111,24 @@ 'D': 150, 'E': 100, 'F': 100, - 'G': 350, - 'H': 150, + 'G': 300, + 'H': 300, + 'I': 350, + 'J': 180, }, 140); // 每一行的行高, 默认给20 var rowConf = excel.makeRowConfig({ 1: 30, }, 20) + var creatorArea1 = $("#creatorArea1").val(); + var creatorArea2 = $("#creatorArea2").val(); + if ($("#creatorArea2").val() == undefined || $("#creatorArea2").val() == "" || $("#creatorArea2").val() == "请选择社区" ) { + }else{ + creatorArea1 = creatorArea1 + "-" + creatorArea2; + } excel.exportExcel({ sheet1: data - }, '人口信息.xlsx', 'xlsx', { + }, creatorArea1 + '人口信息.xlsx', 'xlsx', { extend: { sheet1: { '!cols': colConf diff --git a/src/main/resources/templates/populationinfo/save.html b/src/main/resources/templates/populationinfo/save.html index 6e0167a..b8f925d 100644 --- a/src/main/resources/templates/populationinfo/save.html +++ b/src/main/resources/templates/populationinfo/save.html @@ -358,6 +358,39 @@ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
@@ -1509,6 +1542,19 @@ top.layer.msg("不能这么个填哇!"); return; } + var sex = $("#sex").val(); + if(sex) { + if(population == 'spouse') { + if(sex == '男性' && dataObj.sex.indexOf("男") != -1) { + top.layer.msg("不能这么个填哇!"); + return; + } + if(sex == '女性' && dataObj.sex.indexOf("女") != -1) { + top.layer.msg("不能这么个填哇!"); + return; + } + } + } $("#" + population + "Id").val(dataObj.populationInfoId); $("#" + population + "Name").val(dataObj.name); $("#" + population + "Idcard").val(dataObj.idcard); diff --git a/src/main/resources/templates/populationinfo/update.html b/src/main/resources/templates/populationinfo/update.html index 5e3c7ed..29f0153 100644 --- a/src/main/resources/templates/populationinfo/update.html +++ b/src/main/resources/templates/populationinfo/update.html @@ -357,6 +357,39 @@
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
@@ -740,7 +773,6 @@
- @@ -1421,6 +1453,19 @@ top.layer.msg("不能这么个填哇!"); return; } + var sex = $("#sex").val(); + if(sex) { + if(population == 'spouse') { + if(sex == '男性' && dataObj.sex.indexOf("男") != -1) { + top.layer.msg("不能这么个填哇!"); + return; + } + if(sex == '女性' && dataObj.sex.indexOf("女") != -1) { + top.layer.msg("不能这么个填哇!"); + return; + } + } + } $("#" + population + "Id").val(dataObj.populationInfoId); $("#" + population + "Name").val(dataObj.name); $("#" + population + "Idcard").val(dataObj.idcard);