|
|
|
@ -35,9 +35,7 @@ import com.elink.esua.epdc.dto.BaseResidentInformationExportDto; |
|
|
|
import com.elink.esua.epdc.dto.HousingInformationDTO; |
|
|
|
import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; |
|
|
|
import com.elink.esua.epdc.dto.PopulationInformationDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleDetailFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.*; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.*; |
|
|
|
import com.elink.esua.epdc.entity.HouseResidentEntity; |
|
|
|
import com.elink.esua.epdc.entity.HousingInformationEntity; |
|
|
|
@ -326,8 +324,31 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population |
|
|
|
if (StringUtils.isBlank(dto.getPopulationId())) { |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询产权人信息失败:人口ID为空"); |
|
|
|
} |
|
|
|
//根据户主ID组装信息
|
|
|
|
setHouseHeadInfo(dto.getPopulationId(),epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
} else if (PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) { |
|
|
|
if (StringUtils.isBlank(dto.getPopulationId())) { |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询居住人信息失败:人口ID为空"); |
|
|
|
} |
|
|
|
//查找居住人对应的户主细腻
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("RESIDENT_ID", dto.getPopulationId()); |
|
|
|
List<HouseResidentEntity> houseResidentEntityList = houseResidentDao.selectByMap(params); |
|
|
|
if(houseResidentEntityList==null || houseResidentEntityList.size()==0){ |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("根据居住人查询户主失败"); |
|
|
|
} |
|
|
|
HouseResidentEntity houseResidentEntity = houseResidentEntityList.get(0); |
|
|
|
//根据户主ID组装信息
|
|
|
|
setHouseHeadInfo(houseResidentEntity.getHouseHeadId(),epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
} |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询错误:身份标识参数无法匹配"); |
|
|
|
} |
|
|
|
|
|
|
|
private void setHouseHeadInfo(String houseHeadId,EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO ){ |
|
|
|
//如果是户主,人口信息从人口表拿
|
|
|
|
PopulationInformationEntity populationInformationEntity = this.selectById(dto.getPopulationId()); |
|
|
|
PopulationInformationEntity populationInformationEntity = this.selectById(houseHeadId); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName()); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex()) ? "女" : "男"); |
|
|
|
if (IdentityNoUtils.IdentityNoVerification(populationInformationEntity.getResidentsIdentityNo()) == null) { |
|
|
|
@ -337,7 +358,7 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population |
|
|
|
} |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setPhone(populationInformationEntity.getResidentsPhone()); |
|
|
|
//房屋信息
|
|
|
|
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(dto.getPopulationId()); |
|
|
|
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId); |
|
|
|
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class); |
|
|
|
housingInfoList.forEach(housingInfo -> { |
|
|
|
setHouseUse(housingInfo.getHouseUse(), housingInfo); |
|
|
|
@ -346,11 +367,12 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population |
|
|
|
//居住人信息
|
|
|
|
List<FamilyMember> familyMemberList = new ArrayList<>(); |
|
|
|
Set<String> houseHeadIds = new HashSet<>(1); |
|
|
|
houseHeadIds.add(dto.getPopulationId()); |
|
|
|
houseHeadIds.add(houseHeadId); |
|
|
|
List<BaseResidentInformationExportDto> baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds); |
|
|
|
FamilyMember familyMember = new FamilyMember(); |
|
|
|
baseResidentInformationExportDtos.forEach(a -> { |
|
|
|
familyMember.setName(a.getResidentsName()); |
|
|
|
familyMember.setCurrentAddress(a.getCurrentAddress()); |
|
|
|
switch (a.getHouseHeadRelation()) { |
|
|
|
case HouseHeadRelationConstant.CHILDREN: |
|
|
|
familyMember.setRelation("子女"); |
|
|
|
@ -371,37 +393,6 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population |
|
|
|
familyMemberList.add(familyMember); |
|
|
|
}); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setFamilyMember(familyMemberList); |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
} else if(PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) { |
|
|
|
if(StringUtils.isBlank(dto.getPopulationId())){ |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询产权人信息失败:人口ID为空"); |
|
|
|
} |
|
|
|
//居住人,人口信息从人口表拿
|
|
|
|
PopulationInformationEntity populationInformationEntity = this.selectById(dto.getPopulationId()); |
|
|
|
if(populationInformationEntity==null){ |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("未查找到此人信息!"); |
|
|
|
} |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName()); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex())?"女":"男"); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setAge(""); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setPhone(""); |
|
|
|
//房屋信息 - 继承户主的房屋信息
|
|
|
|
//查询该居住人的户主ID
|
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
params.put("RESIDENT_ID",dto.getPopulationId()); |
|
|
|
params.put("IS_HOUSE_HEAD","0"); |
|
|
|
List<HouseResidentEntity> houseResidentEntityList = houseResidentDao.selectByMap(params); |
|
|
|
String houseHeadId = houseResidentEntityList.get(0).getHouseHeadId(); |
|
|
|
//房屋信息
|
|
|
|
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId); |
|
|
|
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class); |
|
|
|
housingInfoList.forEach(housingInfo -> { |
|
|
|
setHouseUse(housingInfo.getHouseUse(),housingInfo); |
|
|
|
}); |
|
|
|
epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList); |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO); |
|
|
|
} |
|
|
|
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询错误:身份标识参数无法匹配"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -424,6 +415,29 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population |
|
|
|
return new PageData<>(list, baseDao.selectCountListGridRanking(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) { |
|
|
|
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); |
|
|
|
dto.setPageIndex(pageIndex); |
|
|
|
List<EpdcScreenHouseInfoByPeopleResultDTO> list = baseDao.selectHouseByPeople(dto); |
|
|
|
return new PageData<>(list, baseDao.selectCountHouseByPeople(dto)); } |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) { |
|
|
|
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); |
|
|
|
dto.setPageIndex(pageIndex); |
|
|
|
List<EpdcScreenPopulationInfoByHouseResultDTO> list = baseDao.selectPeopleByHouse(dto); |
|
|
|
return new PageData<>(list, baseDao.selectCountPeopleByHouse(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) { |
|
|
|
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); |
|
|
|
dto.setPageIndex(pageIndex); |
|
|
|
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> list = baseDao.selectPeopleByCurrentAddress(dto); |
|
|
|
return new PageData<>(list, baseDao.selectCountPeopleByCurrentAddress(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
private void setHouseUse(String houseUse, HousingInfo housingInfo) { |
|
|
|
switch (houseUse) { |
|
|
|
case HouseUseConstant.RENT: |
|
|
|
|