Browse Source

居民信息采集-bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
4b079a75bc
  1. 22
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java
  2. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml

22
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java

@ -129,6 +129,9 @@ public class HousingInformationController {
}
List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS = listResult.getData();
for (BasePopulationInformationExportDto basePopulationInformationExportDto : basePopulationInformationExcelList) {
if(StringUtils.isBlank(basePopulationInformationExportDto.getId())){
continue;
}
String educationLevel = basePopulationInformationExportDto.getEducationLevel();
String politicsStatus = basePopulationInformationExportDto.getPoliticsStatus();
String bodyStatus = basePopulationInformationExportDto.getBodyStatus();
@ -167,10 +170,27 @@ public class HousingInformationController {
basePopulationInformationExportDto.setMotorVehicleCategory(motorVehicleCategoryEnd.substring(0,motorVehicleCategoryEnd.lastIndexOf(",")));
}
}
//没有户主信息的房屋,转换excel时,替换是否时会出现null,此时将对应null值替换成空字符
basePopulationInformationExcelList.forEach(basePopulationInformationExportDto ->{
basePopulationInformationExportDto.setResidentsSex("");
basePopulationInformationExportDto.setMilitaryService("");
basePopulationInformationExportDto.setReemploymentPermit("");
basePopulationInformationExportDto.setUnemploymentRegister("");
basePopulationInformationExportDto.setDogStatus("");
});
//根据获取的户主ID查询居住人信息
Map<String,List<BasePopulationInformationExportDto>> baseMap = basePopulationInformationExcelList.stream().collect(Collectors.groupingBy(BasePopulationInformationExportDto::getId));
List<BasePopulationInformationExportDto> basePopulationInformationExcelListWithHouseHead = new ArrayList<>();
basePopulationInformationExcelListWithHouseHead.addAll(basePopulationInformationExcelList);
//先去除没有户主的房屋
for(Iterator<BasePopulationInformationExportDto> car = basePopulationInformationExcelListWithHouseHead.iterator();car.hasNext();){
BasePopulationInformationExportDto basePopulationInformationExportDto = car.next();
if(StringUtils.isBlank(basePopulationInformationExportDto.getId())){
car.remove();
}
}
Map<String,List<BasePopulationInformationExportDto>> baseMap = basePopulationInformationExcelListWithHouseHead.stream().collect(Collectors.groupingBy(BasePopulationInformationExportDto::getId));
//获取所有的户主ID
Set<String> houseHeadIds = baseMap.keySet();
List<BaseResidentInformationExportDto> baseResidentInformationExportDtoList = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds);

4
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml

@ -142,10 +142,10 @@
t2.DOG_STATUS
from epdc_housing_information t
left join epdc_house_resident t1 on t1.HOUSE_ID = t.ID and t1.DEL_FLAG = '0'
left join epdc_population_information t2 on t1.RESIDENT_ID = t2.ID and t2.DEL_FLAG = '0'
left join epdc_population_information t2 on t1.RESIDENT_ID = t2.ID and t2.DEL_FLAG = '0' and t2.RESIDENTS_IDENTITY_NO != '' and t2.RESIDENTS_IDENTITY_NO is not null
left join epdc_house_rent_info t3 on t.ID = t3.HOUSE_ID and t3.DEL_FLAG = '0'
left join epdc_house_business_info t4 on t.ID = t4.HOUSE_ID and t4.DEL_FLAG = '0'
where t.DEL_FLAG = '0' and t2.RESIDENTS_IDENTITY_NO != '' and t2.RESIDENTS_IDENTITY_NO is not null
where t.DEL_FLAG = '0'
<if test="houseAddress != '' and houseAddress != null">and t.HOUSE_ADDRESS like concat('%',#{houseAddress},'%') </if>
<if test="propertyOwner != '' and propertyOwner != null">and t.PROPERTY_OWNER like concat('%',#{propertyOwner},'%')</if>
<if test="propertyOwnerMobile != '' and propertyOwnerMobile != null">and t.PROPERTY_OWNER_MOBILE like concat('%',#{propertyOwnerMobile},'%')</if>

Loading…
Cancel
Save