Browse Source

居民导入表格验证修改!

feature/syp_points
songyunpeng 5 years ago
parent
commit
6f390e030e
  1. 3
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java
  2. 326
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java
  3. 19
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java
  4. BIN
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/excel/居民信息录入模板.xls

3
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java

@ -50,9 +50,6 @@ public class BasePopulationInformationExcel {
@Excel(name = "产权人联系电话",width = 20)
private String propertyOwnerMobile;
@Excel(name = "产权证")
private String propertyOwnerCard;
@Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"})
private String houseUse;

326
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java

@ -489,142 +489,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
return populationIdNoAndIdMap;
}
/**
* @return void
* @Description 校验完成后新增人口信息 - 因为不填写产权证而废弃
* @Author songyunpeng
* @Date 2020/8/31
* @Param [basePopulationInformationExcels]
**/
@Deprecated
private Map<String,String> savePopulationList(List<BasePopulationInformationExcel> basePopulationInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO) {
//插入房屋信息
List<HousingInformationEntity> housingInformationEntityList = new ArrayList<>();
for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) {
HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HousingInformationEntity.class);
housingInformationEntity.setGridId(parentAndAllDeptDTO.getGridId());
housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds());
housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());
housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
housingInformationEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames());
housingInformationEntity.setBuyingTime(DateUtil.parse(basePopulationInformationExcel.getBuyingTime()));
housingInformationEntityList.add(housingInformationEntity);
}
insertBatch(housingInformationEntityList);
//组装租赁,经营,户主,房屋人员关系表信息
List<HouseRentInfoEntity> houseRentInfoEntities = new ArrayList<>();
List<HouseBusinessInfoEntity> houseBusinessInfoEntities = new ArrayList<>();
//更新户主信息
List<PopulationInformationEntity> updatePopulationInfo = new ArrayList<>();
//插入户主信息
List<PopulationInformationEntity> insertPopulationInfo = new ArrayList<>();
//房屋户主信息 -- 户主更新
List<HouseResidentEntity> houseResidentEntityList = new ArrayList<>();
//身份证校验
List<String> identifyNoValidation = new ArrayList<>();
//存储 key:身份证 value 房子ID 身份证是可重复的
List<Map<String, String>> HouseResidentInfos = new ArrayList<>();
a:
for (HousingInformationEntity housingInformationEntity : housingInformationEntityList) {
for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) {
//以产权证为唯一标识
if (housingInformationEntity.getPropertyOwnerCard().equals(basePopulationInformationExcel.getPropertyOwnerCard())) {
if (HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())) {
//房屋租赁信息
HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseRentInfoEntity.class);
houseRentInfoEntity.setHouseId(housingInformationEntity.getId());
houseRentInfoEntities.add(houseRentInfoEntity);
} else if (HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())) {
//房屋经营信息
HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseBusinessInfoEntity.class);
houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId());
houseBusinessInfoEntities.add(houseBusinessInfoEntity);
}
//插入户主信息
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, PopulationInformationEntity.class);
PopulationInformationEntity oldPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo());
if (oldPopulationInformationEntity != null) {
//身份证在列表已存在,则更新户主信息
populationInformationEntity.setId(oldPopulationInformationEntity.getId());
//先检验下户主的一些信息
validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel);
updatePopulationInfo.add(populationInformationEntity);
//插入房屋人员关联关系表
HouseResidentEntity houseResidentEntity = new HouseResidentEntity();
houseResidentEntity.setHouseId(housingInformationEntity.getId());
houseResidentEntity.setResidentId(oldPopulationInformationEntity.getId());
houseResidentEntity.setIsHouseHead("1");
houseResidentEntityList.add(houseResidentEntity);
} else {
//先检验下户主的一些信息
validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel);
//将新增的人员的身份证存到List,防止excel中重复的身份证增加不同的户主信息
if (!identifyNoValidation.contains(populationInformationEntity.getResidentsIdentityNo())) {
//如果不包含,才新增进去。也就是说如果重复的身份证,只取第一条信息作为户主信息
insertPopulationInfo.add(populationInformationEntity);
}
identifyNoValidation.add(populationInformationEntity.getResidentsIdentityNo());
//方便下面新增房屋人员关系表,此时存储所有的户主身份证+房子ID
Map<String, String> houseResidentInfo = new HashMap<>();
houseResidentInfo.put(populationInformationEntity.getResidentsIdentityNo(), housingInformationEntity.getId());
HouseResidentInfos.add(houseResidentInfo);
}
continue a;
}
}
}
//插入租赁信息
if (houseRentInfoEntities.size() > 0) {
houseRentInfoService.insertBatch(houseRentInfoEntities);
}
//插入经营信息
if (houseBusinessInfoEntities.size() > 0) {
houseBusinessInfoService.insertBatch(houseBusinessInfoEntities);
}
//如果人口信息身份证已有,则更新人口信息
if (updatePopulationInfo.size() > 0) {
populationInformationService.updateBatchById(updatePopulationInfo);
}
//插入人口信息
if (insertPopulationInfo.size() > 0) {
populationInformationService.insertBatch(insertPopulationInfo);
//遍历存储的身份证+房子ID对应信息,组装房屋人员关系
for (Map<String, String> houseResidentInfo : HouseResidentInfos) {
Set<Map.Entry<String, String>> set = houseResidentInfo.entrySet();
for (Map.Entry<String, String> entry : set) {
String identifyNo = entry.getKey();
String houseId = entry.getValue();
//根据身份证取户主ID
for (PopulationInformationEntity populationInformationEntity : insertPopulationInfo) {
if (populationInformationEntity.getResidentsIdentityNo().equals(identifyNo)) {
HouseResidentEntity houseResidentEntity = new HouseResidentEntity();
houseResidentEntity.setHouseId(houseId);
houseResidentEntity.setResidentId(populationInformationEntity.getId());
houseResidentEntity.setIsHouseHead("1");
houseResidentEntityList.add(houseResidentEntity);
break;
}
}
}
}
}
//插入房屋人员关系
if (houseResidentEntityList.size() > 0) {
houseResidentService.insertBatch(houseResidentEntityList);
}
//组装人口身份证和ID信息 辅助添加居民信息
insertPopulationInfo.addAll(updatePopulationInfo);
Map<String,String> populationIdNoAndIdMap = new HashMap<>();
insertPopulationInfo.forEach(i -> {
populationIdNoAndIdMap.put(i.getResidentsIdentityNo(),i.getId());
});
return populationIdNoAndIdMap;
}
/**
@ -637,11 +501,15 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
private void validateHouseHeadInfo(PopulationInformationEntity populationInformationEntity, BasePopulationInformationExcel basePopulationInformationExcel) {
//赋值失业登记时间
if (StringUtils.isNotBlank(basePopulationInformationExcel.getUnemploymentRegisterTime())) {
populationInformationEntity.setUnemploymentRegisterTime(DateUtil.parse(basePopulationInformationExcel.getUnemploymentRegisterTime()));
if(IdentityNoUtils.isStrDate(basePopulationInformationExcel.getUnemploymentRegisterTime())){
populationInformationEntity.setUnemploymentRegisterTime(DateUtil.parse(basePopulationInformationExcel.getUnemploymentRegisterTime()));
}
}
//赋值入党时间
if (StringUtils.isNotBlank(basePopulationInformationExcel.getJoinTime())) {
populationInformationEntity.setJoinTime(DateUtil.parse(basePopulationInformationExcel.getJoinTime()));
if(IdentityNoUtils.isStrDate(basePopulationInformationExcel.getJoinTime())){
populationInformationEntity.setJoinTime(DateUtil.parse(basePopulationInformationExcel.getJoinTime()));
}
}
//如果状态为群众。清空excel中多余的入党时间和组织关系所在地
if ("0".equals(basePopulationInformationExcel.getPoliticsStatus())) {
@ -653,35 +521,56 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
populationInformationEntity.setOrganizationalRelationshipLocation("");
}
if ("0".equals(basePopulationInformationExcel.getEmploymentStatus())) {
//如果选在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
populationInformationEntity.setUnemploymentReason("");
populationInformationEntity.setReemploymentPermit("");
populationInformationEntity.setUnemploymentRegister("");
clearEmployedInfo(populationInformationEntity);
} else if ("1".equals(basePopulationInformationExcel.getEmploymentStatus())) {
clearUnEmployedInfo(populationInformationEntity);
} else {
clearEmployedInfo(populationInformationEntity);
clearUnEmployedInfo(populationInformationEntity);
}
if(basePopulationInformationExcel.getMotorVehicleNum()!=null && basePopulationInformationExcel.getMotorVehicleNum()==0){
//如果机动车数量为0 清空机动车类型
populationInformationEntity.setMotorVehicleCategory("");
}
}
/**
* @Description 清空在岗信息
* @Author songyunpeng
* @Date 2020/9/16
* @Param [populationInformationEntity]
* @return void
**/
private void clearUnEmployedInfo(PopulationInformationEntity populationInformationEntity){
//如果选择失业,也清空 工作单位 和工作单位地址
populationInformationEntity.setCurrentEmployer("");
populationInformationEntity.setCurrentEmployerAddress("");
//如果失业且失业登记为否,清空失业登记时间
if ("0".equals(populationInformationEntity.getUnemploymentRegister())) {
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
} else if ("1".equals(basePopulationInformationExcel.getEmploymentStatus())) {
//如果选择失业,也清空 工作单位 和工作单位地址
populationInformationEntity.setCurrentEmployer("");
populationInformationEntity.setCurrentEmployerAddress("");
//如果失业且失业登记为否,清空失业登记时间
if ("0".equals(populationInformationEntity.getUnemploymentRegister())) {
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
}
}
if(basePopulationInformationExcel.getMotorVehicleNum()!=null && basePopulationInformationExcel.getMotorVehicleNum()==0){
//如果机动车数量为0 清空机动车类型
populationInformationEntity.setMotorVehicleCategory("");
}
/**
* @Description 清空失业
* @Author songyunpeng
* @Date 2020/9/16
* @Param [populationInformationEntity]
* @return void
**/
private void clearEmployedInfo(PopulationInformationEntity populationInformationEntity){
//如果选在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
populationInformationEntity.setUnemploymentReason("");
populationInformationEntity.setReemploymentPermit("");
populationInformationEntity.setUnemploymentRegister("");
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
}
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO>
* @Description 校验居住人数据
@ -854,6 +743,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((houseAddress))){
if(houseAddress.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("房屋地址字数不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setHouseAddress(houseAddress);
}
if (StringUtils.isNotBlank(buyingTime)) {
@ -881,6 +777,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwner))){
if(propertyOwner.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("产权人字数不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setPropertyOwner(propertyOwner);
}
if (StringUtils.isBlank(propertyOwnerIdentityNo)) {
@ -890,6 +793,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwnerIdentityNo))){
if(propertyOwnerIdentityNo.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("产权人身份证号不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setPropertyOwnerIdentityNo(propertyOwnerIdentityNo);
}
if (StringUtils.isBlank(propertyOwnerMobile)) {
@ -899,6 +809,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwnerMobile))){
if(propertyOwnerMobile.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("产权人电话不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setPropertyOwnerMobile(propertyOwnerMobile);
}
if (StringUtils.isBlank(houseUse)) {
@ -925,6 +842,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((tenantName))){
if(tenantName.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("承租人不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setTenantName(tenantName);
}
if (StringUtils.isBlank(tenantPhone)) {
@ -934,6 +858,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((tenantPhone))){
if(tenantPhone.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("承租人电话不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setTenantPhone(tenantPhone);
}
if (StringUtils.isBlank(tenantIdentityNo)) {
@ -957,9 +888,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
} else if (HouseUseConstant.BUSINESS.equals(houseUse)) {
if(StringUtils.isNotBlank((enterpriseName))){
if(enterpriseName.length()>128){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("企业名称不能大于128个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setEnterpriseName(enterpriseName);
}
if(StringUtils.isNotBlank((legalRepresentative))){
if(legalRepresentative.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("法人代表不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setLegalRepresentative(legalRepresentative);
}
if (StringUtils.isBlank(enterprisePhone)) {
@ -969,9 +914,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((enterprisePhone))){
if(enterprisePhone.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("企业联系电话大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setEnterprisePhone(enterprisePhone);
}
if(StringUtils.isNotBlank((socialUniformCode))){
if(socialUniformCode.length()>128){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("社会统一代码不能大于128个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setSocialUniformCode(socialUniformCode);
}
}
@ -982,9 +941,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((residentsName))){
if(residentsName.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("户主姓名不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setResidentsName(residentsName);
}
if(StringUtils.isNotBlank((residentsNation))){
if(residentsNation.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("民族不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setResidentsNation(residentsNation);
}
if (StringUtils.isNotBlank(educationLevel)) {
@ -1049,6 +1022,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
basePopulationInformationExcel.setJoinTime(joinTime);
}
if(StringUtils.isNotBlank((organizationalRelationshipLocation))){
if(organizationalRelationshipLocation.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("组织关系所在地不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setOrganizationalRelationshipLocation(organizationalRelationshipLocation);
}
}
@ -1080,6 +1060,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((residentsPhone))){
if(residentsPhone.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("户主联系电话不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setResidentsPhone(residentsPhone);
}
if (StringUtils.isNotBlank(bodyStatus)) {
@ -1158,6 +1145,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoList.add(errorLineInfoDto);
}
if(StringUtils.isNotBlank((householdRegistrationPlace))){
if(householdRegistrationPlace.length()>32){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("户籍地不能大于32个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setHouseholdRegistrationPlace(householdRegistrationPlace);
}
if (StringUtils.isNotBlank(employmentStatus)) {
@ -1183,9 +1177,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
if ("在岗".equals(employmentStatus)) {
if(StringUtils.isNotBlank((currentEmployer))){
if(currentEmployer.length()>128){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("现工作单位不能大于128个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setCurrentEmployer(currentEmployer);
}
if(StringUtils.isNotBlank((currentEmployerAddress))){
if(currentEmployerAddress.length()>128){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("现单位地址不能大于128个字符");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}
basePopulationInformationExcel.setCurrentEmployerAddress(currentEmployerAddress);
}
} else if ("失业".equals(employmentStatus)) {

19
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java

@ -157,8 +157,22 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
entity.setUnemploymentRegister("");
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
if("1".equals(dto.getEmploymentStatus())){
} else if("1".equals(dto.getEmploymentStatus())){
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
if("0".equals(dto.getUnemploymentRegister())){
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
} else {
//如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
entity.setUnemploymentReason("");
entity.setReemploymentPermit("");
entity.setUnemploymentRegister("");
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
@ -166,7 +180,6 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
}

BIN
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/excel/居民信息录入模板.xls

Binary file not shown.
Loading…
Cancel
Save