|
|
@ -17,6 +17,9 @@ |
|
|
|
|
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
|
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
@ -24,17 +27,23 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.config.StreamUtils; |
|
|
|
import com.elink.esua.epdc.constant.HouseUseConstant; |
|
|
|
import com.elink.esua.epdc.constant.PopulationDictConstant; |
|
|
|
import com.elink.esua.epdc.dao.HouseResidentDao; |
|
|
|
import com.elink.esua.epdc.dao.HousingInformationDao; |
|
|
|
import com.elink.esua.epdc.dto.HousingInformationDTO; |
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.entity.HouseBusinessInfoEntity; |
|
|
|
import com.elink.esua.epdc.entity.HouseRentInfoEntity; |
|
|
|
import com.elink.esua.epdc.entity.HouseResidentEntity; |
|
|
|
import com.elink.esua.epdc.entity.HousingInformationEntity; |
|
|
|
import com.elink.esua.epdc.dto.SysPopulationSimpleDictDTO; |
|
|
|
import com.elink.esua.epdc.dto.SysSimpleDictDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.SysPopulationSimpleDictFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO; |
|
|
|
import com.elink.esua.epdc.entity.*; |
|
|
|
import com.elink.esua.epdc.excel.BasePopulationInformationExcel; |
|
|
|
import com.elink.esua.epdc.excel.BaseResidentInformationExcel; |
|
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.redis.HousingInformationRedis; |
|
|
|
import com.elink.esua.epdc.service.HouseBusinessInfoService; |
|
|
@ -42,10 +51,14 @@ import com.elink.esua.epdc.service.HouseRentInfoService; |
|
|
|
import com.elink.esua.epdc.service.HousingInformationService; |
|
|
|
import com.elink.esua.epdc.service.PopulationInformationService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
@ -248,4 +261,825 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result importPopulationInfo(MultipartFile file,String gridId) { |
|
|
|
if (StringUtils.isBlank(gridId)) { |
|
|
|
throw new RenException("归属部门不能为空"); |
|
|
|
} |
|
|
|
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(gridId); |
|
|
|
if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) { |
|
|
|
throw new RenException("获取归属部门信息失败"); |
|
|
|
} |
|
|
|
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); |
|
|
|
//获取字典信息
|
|
|
|
SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); |
|
|
|
List<String> dicTypes = new ArrayList<>(); |
|
|
|
Collections.addAll(dicTypes, PopulationDictConstant.ACCOUNT_TYPE,PopulationDictConstant.BODY_STATUS,PopulationDictConstant.EDUCATION_LEVEL |
|
|
|
,PopulationDictConstant.EMPLOYMENT_STATUS,PopulationDictConstant.FAMILY_CATEGORY,PopulationDictConstant.GENDER,PopulationDictConstant.HELP_STATUS,PopulationDictConstant.MARITAL_STATUS |
|
|
|
,PopulationDictConstant.MOTOR_VEHICLE_CATEGORY,PopulationDictConstant.POLITICS_STATUS,PopulationDictConstant.UNEMPLOYMENT_REASON); |
|
|
|
sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); |
|
|
|
Result<List<SysPopulationSimpleDictDTO>> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); |
|
|
|
if(listResult==null || !listResult.success()){ |
|
|
|
throw new RenException("获取字典信息失败"); |
|
|
|
} |
|
|
|
List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS = listResult.getData(); |
|
|
|
|
|
|
|
|
|
|
|
File f = StreamUtils.conversionFile(file); |
|
|
|
ImportParams importParams = new ImportParams(); |
|
|
|
try { |
|
|
|
//获取多个sheet页
|
|
|
|
Workbook workBook = ExcelUtils.getWorkBook(file); |
|
|
|
for(int numSheet = 0; numSheet < workBook.getNumberOfSheets(); numSheet++){ |
|
|
|
//第几个sheet
|
|
|
|
importParams.setStartSheetIndex(numSheet); |
|
|
|
|
|
|
|
if(numSheet==0){//校验和新增房屋和户主信息
|
|
|
|
List<BasePopulationInformationExcel> basePopulationInformationExcels = ExcelImportUtil.importExcel(f, BasePopulationInformationExcel.class, importParams); |
|
|
|
// 校验数据
|
|
|
|
List<EpdcPopulationErrorResultDTO> epdcPartyErrorResultDTOS = this.checkPopulationExcel(basePopulationInformationExcels,sysPopulationSimpleDictDTOS); |
|
|
|
if(epdcPartyErrorResultDTOS.size()>0){ |
|
|
|
return new Result().ok(epdcPartyErrorResultDTOS); |
|
|
|
} |
|
|
|
savePopulationList(basePopulationInformationExcels,parentAndAllDeptDTO); |
|
|
|
|
|
|
|
|
|
|
|
} else if (numSheet == 1){//检验和新增居住人信息
|
|
|
|
List<BaseResidentInformationExcel> baseResidentInformationExcels = ExcelImportUtil.importExcel(f, BaseResidentInformationExcel.class, importParams); |
|
|
|
// 校验数据
|
|
|
|
List<EpdcPopulationErrorResultDTO> epdcPartyErrorResultDTOS = this.checkResidentsExcel(baseResidentInformationExcels,sysPopulationSimpleDictDTOS); |
|
|
|
if(epdcPartyErrorResultDTOS.size()>0){ |
|
|
|
return new Result().ok(epdcPartyErrorResultDTOS); |
|
|
|
} |
|
|
|
saveResidentList(baseResidentInformationExcels); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e1) { |
|
|
|
throw new RenException("导入失败:{}" + e1.getMessage()); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
/** |
|
|
|
* @Description 校验完成后插入居民信息 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/8/31 |
|
|
|
* @Param [baseResidentInformationExcels] |
|
|
|
* @return void |
|
|
|
**/ |
|
|
|
private void saveResidentList(List<BaseResidentInformationExcel> baseResidentInformationExcels) { |
|
|
|
for (BaseResidentInformationExcel baseResidentInformationExcel : baseResidentInformationExcels) { |
|
|
|
//插入居民信息
|
|
|
|
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel,PopulationInformationEntity.class); |
|
|
|
populationInformationEntity.setResidentsIdentityNo(null); |
|
|
|
populationInformationService.insert(populationInformationEntity); |
|
|
|
//插入房屋人员关联关系表
|
|
|
|
HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel,HouseResidentEntity.class); |
|
|
|
houseResidentEntity.setResidentId(populationInformationEntity.getId()); |
|
|
|
//查找户主ID
|
|
|
|
PopulationInformationEntity infoByIdentityNo = populationInformationService.getInfoByIdentityNo(baseResidentInformationExcel.getResidentsIdentityNo()); |
|
|
|
houseResidentEntity.setHouseHeadId(infoByIdentityNo.getId()); |
|
|
|
houseResidentEntity.setIsHouseHead("0"); |
|
|
|
houseResidentDao.insert(houseResidentEntity); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 校验完成后新增人口信息 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/8/31 |
|
|
|
* @Param [basePopulationInformationExcels] |
|
|
|
* @return void |
|
|
|
**/ |
|
|
|
private void savePopulationList(List<BasePopulationInformationExcel> basePopulationInformationExcels,ParentAndAllDeptDTO parentAndAllDeptDTO) { |
|
|
|
for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { |
|
|
|
//插入房屋信息
|
|
|
|
HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HousingInformationEntity.class); |
|
|
|
housingInformationEntity.setBuyingTime(DateUtil.parse(basePopulationInformationExcel.getBuyingTime())); |
|
|
|
housingInformationEntity.setGridId(parentAndAllDeptDTO.getGridId()); |
|
|
|
housingInformationEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); |
|
|
|
housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); |
|
|
|
housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); |
|
|
|
housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); |
|
|
|
baseDao.insert(housingInformationEntity); |
|
|
|
if(HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())){ |
|
|
|
//房屋租赁信息
|
|
|
|
HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HouseRentInfoEntity.class); |
|
|
|
houseRentInfoEntity.setHouseId(housingInformationEntity.getId()); |
|
|
|
houseRentInfoService.insert(houseRentInfoEntity); |
|
|
|
}else if(HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())){ |
|
|
|
//房屋经营信息
|
|
|
|
HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,HouseBusinessInfoEntity.class); |
|
|
|
houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId()); |
|
|
|
houseBusinessInfoService.insert(houseBusinessInfoEntity); |
|
|
|
} |
|
|
|
//插入户主信息
|
|
|
|
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel,PopulationInformationEntity.class); |
|
|
|
PopulationInformationEntity oldPopulationInformationEntity= populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo()); |
|
|
|
if(oldPopulationInformationEntity!=null){ |
|
|
|
//身份证在列表已存在,则更新户主信息
|
|
|
|
populationInformationEntity.setId(oldPopulationInformationEntity.getId()); |
|
|
|
populationInformationService.updateById(populationInformationEntity); |
|
|
|
}else { |
|
|
|
populationInformationService.insert(populationInformationEntity); |
|
|
|
} |
|
|
|
|
|
|
|
//插入房屋人员关联关系表
|
|
|
|
HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); |
|
|
|
houseResidentEntity.setHouseId(housingInformationEntity.getId()); |
|
|
|
houseResidentEntity.setResidentId(populationInformationEntity.getId()); |
|
|
|
houseResidentEntity.setIsHouseHead("1"); |
|
|
|
houseResidentDao.insert(houseResidentEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 校验居住人数据 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/8/31 |
|
|
|
* @Param [basePopulationInformationExcels, basePopulationInformationExcels1] |
|
|
|
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO> |
|
|
|
**/ |
|
|
|
private List<EpdcPopulationErrorResultDTO> checkResidentsExcel(List<BaseResidentInformationExcel> basePopulationInformationExcels,List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS) { |
|
|
|
// 不匹配信息
|
|
|
|
List<EpdcPopulationErrorResultDTO> errorLineInfoList = new ArrayList<>(); |
|
|
|
EpdcPopulationErrorResultDTO errorLineInfoDto; |
|
|
|
for (int i = 0; i < basePopulationInformationExcels.size(); i++) { |
|
|
|
BaseResidentInformationExcel baseResidentInformationExcel = basePopulationInformationExcels.get(i); |
|
|
|
String residentsIdentityNo = baseResidentInformationExcel.getResidentsIdentityNo(); |
|
|
|
String houseHeadRelation = baseResidentInformationExcel.getHouseHeadRelation(); |
|
|
|
String residentsName = baseResidentInformationExcel.getResidentsName(); |
|
|
|
String residentsSex = baseResidentInformationExcel.getResidentsSex(); |
|
|
|
String residentsNation = baseResidentInformationExcel.getResidentsNation(); |
|
|
|
String currentEmployer = baseResidentInformationExcel.getCurrentEmployer(); |
|
|
|
String currentAddress = baseResidentInformationExcel.getCurrentAddress(); |
|
|
|
if (StringUtils.isBlank(residentsIdentityNo)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主身份证号为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(houseHeadRelation)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("与户主关系为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(houseHeadRelation) && !"0".equals(houseHeadRelation) && !"1".equals(houseHeadRelation) && !"2".equals(houseHeadRelation)&& !"3".equals(houseHeadRelation)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("与户主关系数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsName)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("姓名为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsSex)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("性别为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(residentsSex) && !"0".equals(residentsSex) && !"1".equals(residentsSex)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("性别不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsNation)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("民族为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(currentEmployer)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("工作单位或学校地址为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(currentAddress)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("现居住地址为空"); |
|
|
|
errorLineInfoDto.setSheetName("居住人信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return errorLineInfoList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 校验户主和房屋数据 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/8/31 |
|
|
|
* @Param [basePopulationInformationExcels, populationInformationDTOS] |
|
|
|
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPartyErroyResultDTO> |
|
|
|
**/ |
|
|
|
private List<EpdcPopulationErrorResultDTO> checkPopulationExcel(List<BasePopulationInformationExcel> basePopulationInformationExcels,List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS) { |
|
|
|
// 不匹配信息
|
|
|
|
List<EpdcPopulationErrorResultDTO> errorLineInfoList = new ArrayList<>(); |
|
|
|
EpdcPopulationErrorResultDTO errorLineInfoDto; |
|
|
|
for (int i = 0; i < basePopulationInformationExcels.size(); i++) { |
|
|
|
BasePopulationInformationExcel basePopulationInformationExcel = basePopulationInformationExcels.get(i); |
|
|
|
String houseAddress = basePopulationInformationExcel.getHouseAddress(); |
|
|
|
String buyingTime = basePopulationInformationExcel.getBuyingTime(); |
|
|
|
BigDecimal houseArea = basePopulationInformationExcel.getHouseArea(); |
|
|
|
String propertyOwner = basePopulationInformationExcel.getPropertyOwner(); |
|
|
|
String propertyOwnerIdentityNo = basePopulationInformationExcel.getPropertyOwnerIdentityNo(); |
|
|
|
String propertyOwnerMobile = basePopulationInformationExcel.getPropertyOwnerMobile(); |
|
|
|
String propertyOwnerCard = basePopulationInformationExcel.getPropertyOwnerCard(); |
|
|
|
String houseUse = basePopulationInformationExcel.getHouseUse(); |
|
|
|
String tenantName = basePopulationInformationExcel.getTenantName(); |
|
|
|
String tenantIdentityNo = basePopulationInformationExcel.getTenantIdentityNo(); |
|
|
|
String tenantPhone = basePopulationInformationExcel.getTenantPhone(); |
|
|
|
String enterpriseName = basePopulationInformationExcel.getEnterpriseName(); |
|
|
|
String legalRepresentative = basePopulationInformationExcel.getLegalRepresentative(); |
|
|
|
String enterprisePhone = basePopulationInformationExcel.getEnterprisePhone(); |
|
|
|
String socialUniformCode = basePopulationInformationExcel.getSocialUniformCode(); |
|
|
|
String residentsName = basePopulationInformationExcel.getResidentsName(); |
|
|
|
String residentsNation = basePopulationInformationExcel.getResidentsNation(); |
|
|
|
String educationLevel = basePopulationInformationExcel.getEducationLevel(); |
|
|
|
String politicsStatus = basePopulationInformationExcel.getPoliticsStatus(); |
|
|
|
String joinTime = basePopulationInformationExcel.getJoinTime(); |
|
|
|
String organizationalRelationshipLocation = basePopulationInformationExcel.getOrganizationalRelationshipLocation(); |
|
|
|
String residentsIdentityNo = basePopulationInformationExcel.getResidentsIdentityNo(); |
|
|
|
String residentsPhone = basePopulationInformationExcel.getResidentsPhone(); |
|
|
|
String bodyStatus = basePopulationInformationExcel.getBodyStatus(); |
|
|
|
String maritalStatus = basePopulationInformationExcel.getMaritalStatus(); |
|
|
|
String accountType = basePopulationInformationExcel.getAccountType(); |
|
|
|
String militaryService = basePopulationInformationExcel.getMilitaryService(); |
|
|
|
String householdRegistrationPlace = basePopulationInformationExcel.getHouseholdRegistrationPlace(); |
|
|
|
String employmentStatus = basePopulationInformationExcel.getEmploymentStatus(); |
|
|
|
String currentEmployer = basePopulationInformationExcel.getCurrentEmployer(); |
|
|
|
String currentEmployerAddress = basePopulationInformationExcel.getCurrentEmployerAddress(); |
|
|
|
String unemploymentReason = basePopulationInformationExcel.getUnemploymentReason(); |
|
|
|
String reemploymentPermit = basePopulationInformationExcel.getReemploymentPermit(); |
|
|
|
String unemploymentRegister = basePopulationInformationExcel.getUnemploymentRegister(); |
|
|
|
String unemploymentRegisterTime = basePopulationInformationExcel.getUnemploymentRegisterTime(); |
|
|
|
String familyCategory = basePopulationInformationExcel.getFamilyCategory(); |
|
|
|
String helpStatus = basePopulationInformationExcel.getHelpStatus(); |
|
|
|
Integer motorVehicleNum = basePopulationInformationExcel.getMotorVehicleNum(); |
|
|
|
String motorVehicleCategory = basePopulationInformationExcel.getMotorVehicleCategory(); |
|
|
|
String dogStatus = basePopulationInformationExcel.getDogStatus(); |
|
|
|
if (StringUtils.isBlank(houseAddress)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("房屋地址为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(buyingTime)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("购房时间为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (houseArea==null) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("房屋面积为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(propertyOwner)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("产权人为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(propertyOwnerIdentityNo)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("产权人身份证号为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(propertyOwnerMobile)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("产权人电话为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(propertyOwnerCard)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("产权证为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(houseUse)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("房屋用途为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(houseUse) && !"0".equals(houseUse) && !"1".equals(houseUse) && !"2".equals(houseUse)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("房屋用途数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(HouseUseConstant.RENT.equals(houseUse)){ |
|
|
|
if (StringUtils.isBlank(tenantName)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("承租人为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(tenantPhone)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("承租人电话为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(tenantIdentityNo)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("承租人身份证号为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} else if(HouseUseConstant.BUSINESS.equals(houseUse)){ |
|
|
|
if (StringUtils.isBlank(enterpriseName)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("企业名称为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(legalRepresentative)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("法人为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(enterprisePhone)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("企业联系电话为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(socialUniformCode)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("社会统一代码为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsName)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主姓名为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsNation)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("民族为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(educationLevel)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("文化程度为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(educationLevel)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.EDUCATION_LEVEL.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(educationLevel.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setEducationLevel(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("文化程度数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(politicsStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("政治面貌为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(politicsStatus)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.POLITICS_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(politicsStatus.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setPoliticsStatus(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("政治面貌数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if("党员".equals(politicsStatus)){ |
|
|
|
if (StringUtils.isBlank(joinTime)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("入党时间为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(organizationalRelationshipLocation)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("组织关系所在地为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsIdentityNo)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主身份证号码为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(residentsIdentityNo)){ |
|
|
|
String result = IdentityNoUtils.IdentityNoVerification(residentsIdentityNo); |
|
|
|
if(result!=null){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主身份证号码有误"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
basePopulationInformationExcel.setResidentsSex(IdentityNoUtils.getSex(residentsIdentityNo)); |
|
|
|
basePopulationInformationExcel.setResidentsBirthday(DateUtil.parse(IdentityNoUtils.getBirthday(residentsIdentityNo))); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(residentsPhone)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主联系电话为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(bodyStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主身体状况为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(bodyStatus)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.BODY_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(bodyStatus.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setBodyStatus(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("身体状况数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(maritalStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主婚姻状况为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(maritalStatus)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.MARITAL_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(maritalStatus.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setMaritalStatus(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("婚姻状况数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(accountType)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主户口类型为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(accountType)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.ACCOUNT_TYPE.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(accountType.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setAccountType(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户口类型数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(militaryService)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否服兵役为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(militaryService) && !"0".equals(militaryService) && !"1".equals(militaryService)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否服兵役数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(householdRegistrationPlace)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主户籍地为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(employmentStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否就业为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(employmentStatus)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.EMPLOYMENT_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(employmentStatus.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setEmploymentStatus(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否就业数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if("在岗".equals(employmentStatus)){ |
|
|
|
if (StringUtils.isBlank(currentEmployer)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主现工作单位为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(currentEmployerAddress)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主现单位地址为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
}else if("失业".equals(employmentStatus)){ |
|
|
|
if (StringUtils.isBlank(unemploymentReason)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主失业原因为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(unemploymentReason)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.UNEMPLOYMENT_REASON.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(unemploymentReason.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setUnemploymentReason(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主失业原因数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(reemploymentPermit)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否有再就业优惠证为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(reemploymentPermit) && !"0".equals(reemploymentPermit) && !"1".equals(reemploymentPermit)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否有再就业优惠证数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(unemploymentRegister)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否失业登记为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(unemploymentRegister) && !"0".equals(unemploymentRegister) && !"1".equals(unemploymentRegister)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主是否失业登记数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(unemploymentRegisterTime)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主失业登记时间为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(familyCategory)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主家庭类别为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(familyCategory)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.FAMILY_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(familyCategory.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setFamilyCategory(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主家庭类别数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(helpStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主家庭救助情况为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(helpStatus)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.HELP_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(helpStatus.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setHelpStatus(sysSimpleDict.getDictValue()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("户主家庭救助情况数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (motorVehicleNum==null) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("机动车台数为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if (motorVehicleNum.intValue()>0 && StringUtils.isBlank(motorVehicleCategory)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("机动车类型为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
}else if(StringUtils.isNotBlank(motorVehicleCategory)){ |
|
|
|
boolean isMatch = false; |
|
|
|
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { |
|
|
|
if(PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())){ |
|
|
|
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); |
|
|
|
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { |
|
|
|
if(motorVehicleCategory.equals(sysSimpleDict.getDictName())) { |
|
|
|
isMatch = true; |
|
|
|
basePopulationInformationExcel.setMotorVehicleCategory(sysSimpleDict.getDictValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isMatch){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("机动车类型数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dogStatus)) { |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("宠物犬情况为空"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(dogStatus) && !"0".equals(dogStatus) && !"1".equals(dogStatus)){ |
|
|
|
errorLineInfoDto=new EpdcPopulationErrorResultDTO(); |
|
|
|
errorLineInfoDto.setErrorLine((i+2)+""); |
|
|
|
errorLineInfoDto.setErrorInfo("宠物犬情况数据不匹配"); |
|
|
|
errorLineInfoDto.setSheetName("房屋信息和户主信息"); |
|
|
|
errorLineInfoList.add(errorLineInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
return errorLineInfoList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |