|
|
@ -22,12 +22,17 @@ 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; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
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.DateUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.house.HouseResidentDTO; |
|
|
|
import com.elink.esua.epdc.dto.house.PopulationInformationDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService; |
|
|
|
import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao; |
|
|
|
import com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity; |
|
|
@ -44,7 +49,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 房屋人员关系表 |
|
|
|
* 房屋人员关系表 |
|
|
|
* |
|
|
|
* @author qu qu@elink-cn.com |
|
|
|
* @since v1.0.0 2020-08-19 |
|
|
@ -60,6 +65,10 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private HousingInformationService housingInformationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpidemicUserInfoService epidemicUserInfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private HouseResidentDao houseResidentDao; |
|
|
|
|
|
|
@ -79,8 +88,8 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
return ConvertUtils.sourceToTarget(entityList, HouseResidentDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<HouseResidentEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
private QueryWrapper<HouseResidentEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<HouseResidentEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
@ -90,41 +99,42 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
|
|
|
|
@Override |
|
|
|
public PopulationInformationDTO get(String id) { |
|
|
|
PopulationInformationDTO populationInformationDTO = baseDao.selectByHouseResidentId(id); |
|
|
|
PopulationInformationDTO populationInformationDTO = baseDao.selectByHouseResidentIdV2(id); |
|
|
|
return populationInformationDTO; |
|
|
|
} |
|
|
|
/** 居住人的新增和更新逻辑: |
|
|
|
* 新增:1.判断填写的身份证是否已存在 |
|
|
|
* 不存在:直接新增人口信息和关联表信息 |
|
|
|
* 存在:更新原有的人口信息和关联信息(若是有户主身份,且在此是第一次新增居住信息,则直接更新原有人口信息和新增关联信息) |
|
|
|
* 更新:1.若是身份证被修改:判断填写的身份证是否存在 |
|
|
|
* 不存在:代表更新关联表信息和新增人口信息,原先的人口信息如果只有居住人身份的话则直接删除 |
|
|
|
* ****存在(只有人才才会走到这个逻辑): |
|
|
|
* 1.判断修改的身份证信息是不是在当前房屋下,存在则返回错误信息 |
|
|
|
* 2.不在此房屋下: |
|
|
|
* 若是此身份证有户主身份: |
|
|
|
* (1)更新原先的人口信息 |
|
|
|
* (2)新增居民关联关系为表单的身份证和表单房子关联 |
|
|
|
* (3)删除被更新的人口信息(非户主)和人口关系 |
|
|
|
* 若是此身份证有居住人身份(或者既有户主又有居民身份): |
|
|
|
* (1)更新原先居民关联关系为表单的身份证和表单房子关联 |
|
|
|
* (2)更新原先的人口信息 |
|
|
|
* (3)删除被更新的人口信息(非户主)和人口关系 |
|
|
|
* |
|
|
|
* */ |
|
|
|
|
|
|
|
/** |
|
|
|
* 居住人的新增和更新逻辑: |
|
|
|
* 新增:1.判断填写的身份证是否已存在 |
|
|
|
* 不存在:直接新增人口信息和关联表信息 |
|
|
|
* 存在:更新原有的人口信息和关联信息(若是有户主身份,且在此是第一次新增居住信息,则直接更新原有人口信息和新增关联信息) |
|
|
|
* 更新:1.若是身份证被修改:判断填写的身份证是否存在 |
|
|
|
* 不存在:代表更新关联表信息和新增人口信息,原先的人口信息如果只有居住人身份的话则直接删除 |
|
|
|
* ****存在(只有人才才会走到这个逻辑): |
|
|
|
* 1.判断修改的身份证信息是不是在当前房屋下,存在则返回错误信息 |
|
|
|
* 2.不在此房屋下: |
|
|
|
* 若是此身份证有户主身份: |
|
|
|
* (1)更新原先的人口信息 |
|
|
|
* (2)新增居民关联关系为表单的身份证和表单房子关联 |
|
|
|
* (3)删除被更新的人口信息(非户主)和人口关系 |
|
|
|
* 若是此身份证有居住人身份(或者既有户主又有居民身份): |
|
|
|
* (1)更新原先居民关联关系为表单的身份证和表单房子关联 |
|
|
|
* (2)更新原先的人口信息 |
|
|
|
* (3)删除被更新的人口信息(非户主)和人口关系 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result saveWithIdentifyNo(HouseResidentDTO dto) { |
|
|
|
//先判断身份证是否合法
|
|
|
|
String result = IdentityNoUtils.IdentityNoVerification(dto.getResidentsIdentityNo()); |
|
|
|
if(result != null){ |
|
|
|
if (result != null) { |
|
|
|
return new Result().error(result); |
|
|
|
} |
|
|
|
String sex = IdentityNoUtils.getSex(dto.getResidentsIdentityNo()); |
|
|
|
String birthday = IdentityNoUtils.getBirthday(dto.getResidentsIdentityNo()); |
|
|
|
//根据身份证查询新人口信息
|
|
|
|
PopulationInformationEntity newPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(dto.getResidentsIdentityNo()); |
|
|
|
if(newPopulationInformationEntity==null){ |
|
|
|
if (newPopulationInformationEntity == null) { |
|
|
|
newPopulationInformationEntity = new PopulationInformationEntity(); |
|
|
|
newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); |
|
|
|
newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); |
|
|
@ -145,11 +155,11 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
entity.setResidentId(newPopulationInformationEntity.getId()); |
|
|
|
entity.setIsHouseHead("0"); |
|
|
|
insert(entity); |
|
|
|
}else if(newPopulationInformationEntity!=null){ |
|
|
|
} else if (newPopulationInformationEntity != null) { |
|
|
|
//人口信息不是空,则新人口信息转变为旧人口信息
|
|
|
|
//1.查询表单身份证的人口的和房子的关联关系(查询条件是非户主身份的)
|
|
|
|
HouseResidentEntity oldHouseResidentEntity = baseDao.getHouseResidentInfoByResidentId(newPopulationInformationEntity.getId()); |
|
|
|
if(oldHouseResidentEntity==null){ |
|
|
|
if (oldHouseResidentEntity == null) { |
|
|
|
//此时说明此人有户主身份,则直接更新人口信息和新增关联信息
|
|
|
|
newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); |
|
|
|
newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); |
|
|
@ -173,11 +183,11 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
//2.查询表单身份证的人口的房子的信息
|
|
|
|
HousingInformationEntity oldHousingInformationEntity = housingInformationService.selectById(oldHouseResidentEntity.getHouseId()); |
|
|
|
//3.第一次修改
|
|
|
|
//比较当前房屋和表单身份证的旧房屋信息
|
|
|
|
//如果不同则提示是否要进行修改
|
|
|
|
if("0".equals(dto.getIsEditResidentInfo()) && !dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())){ |
|
|
|
return new Result().ok("您在地址为"+oldHousingInformationEntity.getHouseAddress()+"房屋下已有居住信息,确认要更新吗?"); |
|
|
|
}else if("1".equals(dto.getIsEditResidentInfo())){//第二次确认修改居住信息
|
|
|
|
//比较当前房屋和表单身份证的旧房屋信息
|
|
|
|
//如果不同则提示是否要进行修改
|
|
|
|
if ("0".equals(dto.getIsEditResidentInfo()) && !dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())) { |
|
|
|
return new Result().ok("您在地址为" + oldHousingInformationEntity.getHouseAddress() + "房屋下已有居住信息,确认要更新吗?"); |
|
|
|
} else if ("1".equals(dto.getIsEditResidentInfo())) {//第二次确认修改居住信息
|
|
|
|
newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); |
|
|
|
newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); |
|
|
|
newPopulationInformationEntity.setEducationLevel(dto.getEducationLevel()); |
|
|
@ -194,7 +204,7 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
oldHouseResidentEntity.setHouseId(dto.getHouseId()); |
|
|
|
oldHouseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); |
|
|
|
updateById(oldHouseResidentEntity); |
|
|
|
}else if ("0".equals(dto.getIsEditResidentInfo()) && dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())){ |
|
|
|
} else if ("0".equals(dto.getIsEditResidentInfo()) && dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())) { |
|
|
|
//如果相同,则表示新增时,填写的身份证在房屋居住人列表中已存在!
|
|
|
|
return new Result().error("当前房屋下已存在此人!"); |
|
|
|
} else { |
|
|
@ -211,7 +221,7 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
HouseResidentEntity oldHouseResident = baseDao.selectById(dto.getId()); |
|
|
|
PopulationInformationEntity oldPopulationInformation = populationInformationService.selectById(oldHouseResident.getResidentId()); |
|
|
|
//如果身份证相同,则更新人口信息和关系表信息
|
|
|
|
if(dto.getResidentsIdentityNo().equals(oldPopulationInformation.getResidentsIdentityNo())){ |
|
|
|
if (dto.getResidentsIdentityNo().equals(oldPopulationInformation.getResidentsIdentityNo())) { |
|
|
|
oldPopulationInformation.setResidentsName(dto.getResidentsName()); |
|
|
|
oldPopulationInformation.setResidentsNation(dto.getResidentsNation()); |
|
|
|
oldPopulationInformation.setEducationLevel(dto.getEducationLevel()); |
|
|
@ -227,7 +237,7 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
} else { |
|
|
|
//先判断身份证是否合法
|
|
|
|
String result = IdentityNoUtils.IdentityNoVerification(dto.getResidentsIdentityNo()); |
|
|
|
if(result != null){ |
|
|
|
if (result != null) { |
|
|
|
return new Result().error(result); |
|
|
|
} |
|
|
|
String sex = IdentityNoUtils.getSex(dto.getResidentsIdentityNo()); |
|
|
@ -235,7 +245,7 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
//根据身份证判断此人是否已有居住信息
|
|
|
|
//新的居住人信息
|
|
|
|
PopulationInformationEntity populationInformationEntity = populationInformationService.getInfoByIdentityNo(dto.getResidentsIdentityNo()); |
|
|
|
if(populationInformationEntity==null){ |
|
|
|
if (populationInformationEntity == null) { |
|
|
|
//新的居住人信息是空,代表添加新的人口信息到表中。并且由于此处是更新,则当前选择的被更新人的数据要从人口信息表中删除,且之前的关联关系也得更新
|
|
|
|
populationInformationEntity = new PopulationInformationEntity(); |
|
|
|
populationInformationEntity.setResidentsName(dto.getResidentsName()); |
|
|
@ -251,11 +261,11 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
//获取原先关联表信息
|
|
|
|
HouseResidentEntity entity = selectById(dto.getId()); |
|
|
|
//查询原先绑定的居住人的信息,如果此居住人只有居住人身份则删除此人人口信息
|
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
params.put("RESIDENT_ID",entity.getResidentId()); |
|
|
|
params.put("IS_HOUSE_HEAD","0"); |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("RESIDENT_ID", entity.getResidentId()); |
|
|
|
params.put("IS_HOUSE_HEAD", "0"); |
|
|
|
List<HouseResidentEntity> houseResidentEntities = baseDao.selectByMap(params); |
|
|
|
if(houseResidentEntities!=null && houseResidentEntities.size()>0){ |
|
|
|
if (houseResidentEntities != null && houseResidentEntities.size() > 0) { |
|
|
|
//没有户主身份,删除人口信息
|
|
|
|
populationInformationService.deleteById(entity.getResidentId()); |
|
|
|
} |
|
|
@ -265,16 +275,16 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
entity.setResidentId(populationInformationEntity.getId()); |
|
|
|
//更新关联表信息
|
|
|
|
updateById(entity); |
|
|
|
}else if(populationInformationEntity!=null){ |
|
|
|
} else if (populationInformationEntity != null) { |
|
|
|
//1.判断查出的表单身份证的这个人是不是已经在这个房屋下了
|
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
//当前表单身份证对应的人口ID
|
|
|
|
params.put("RESIDENT_ID",populationInformationEntity.getId()); |
|
|
|
params.put("RESIDENT_ID", populationInformationEntity.getId()); |
|
|
|
//当前表单房屋ID
|
|
|
|
params.put("HOUSE_ID",dto.getHouseId()); |
|
|
|
params.put("IS_HOUSE_HEAD","0"); |
|
|
|
params.put("HOUSE_ID", dto.getHouseId()); |
|
|
|
params.put("IS_HOUSE_HEAD", "0"); |
|
|
|
List<HouseResidentEntity> houseResidentEntities = houseResidentDao.selectByMap(params); |
|
|
|
if(houseResidentEntities!=null && houseResidentEntities.size()>0){ |
|
|
|
if (houseResidentEntities != null && houseResidentEntities.size() > 0) { |
|
|
|
return new Result().error("当前房屋下已存在此人!"); |
|
|
|
} |
|
|
|
//2.此人不在此屋子下
|
|
|
@ -290,30 +300,30 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
//获取原先关联表信息
|
|
|
|
HouseResidentEntity entity = selectById(dto.getId()); |
|
|
|
//查询原先绑定的居住人的信息,如果此居住人只有居住人身份则删除此人人口信息
|
|
|
|
Map<String,Object> oldParams = new HashMap<>(); |
|
|
|
oldParams.put("RESIDENT_ID",entity.getResidentId()); |
|
|
|
oldParams.put("IS_HOUSE_HEAD","0"); |
|
|
|
Map<String, Object> oldParams = new HashMap<>(); |
|
|
|
oldParams.put("RESIDENT_ID", entity.getResidentId()); |
|
|
|
oldParams.put("IS_HOUSE_HEAD", "0"); |
|
|
|
List<HouseResidentEntity> oldHouseResidentEntities = baseDao.selectByMap(oldParams); |
|
|
|
//(3)更新表单身份证与房屋关联关系为当前房屋(若是表单身份证存在户主身份,且第一次添加居住人,则新增关联关系)
|
|
|
|
//获取表单身份证之前的居住地关联关系表的信息
|
|
|
|
HouseResidentEntity newHouseResidentEntity = houseResidentDao.getHouseResidentInfoByResidentId(populationInformationEntity.getId()); |
|
|
|
if(newHouseResidentEntity==null){ |
|
|
|
if (newHouseResidentEntity == null) { |
|
|
|
//此处判断代表此人有户主身份,且第一次更新为居民身份,此时新增关联关系
|
|
|
|
newHouseResidentEntity.setHouseId(dto.getHouseId()); |
|
|
|
newHouseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); |
|
|
|
newHouseResidentEntity.setResidentId(populationInformationEntity.getId()); |
|
|
|
houseResidentDao.insert(newHouseResidentEntity); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
houseResidentDao.updateById(newHouseResidentEntity); |
|
|
|
} |
|
|
|
baseDao.deleteById(entity.getId()); |
|
|
|
if(oldHouseResidentEntities!=null && oldHouseResidentEntities.size()>0){ |
|
|
|
if (oldHouseResidentEntities != null && oldHouseResidentEntities.size() > 0) { |
|
|
|
//没有户主身份,删除人口信息
|
|
|
|
populationInformationService.deleteById(entity.getResidentId()); |
|
|
|
} |
|
|
|
|
|
|
|
populationInformationService.updateById(populationInformationEntity); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return new Result().error("参数传递出错"); |
|
|
|
} |
|
|
|
} |
|
|
@ -334,10 +344,10 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
public PageData<PopulationInformationDTO> listPage(Map<String, Object> params) { |
|
|
|
IPage<PopulationInformationDTO> page = getPage(params); |
|
|
|
PopulationInformationDTO populationInformationDTO = populationInformationService.getHouseHeadInfo(params.get("houseId") + ""); |
|
|
|
if(populationInformationDTO==null){ |
|
|
|
if (populationInformationDTO == null) { |
|
|
|
return new PageData<>(new ArrayList<>(), page.getTotal()); |
|
|
|
} |
|
|
|
params.put("houseHeadId",populationInformationDTO.getId()); |
|
|
|
params.put("houseHeadId", populationInformationDTO.getId()); |
|
|
|
List<PopulationInformationDTO> list = baseDao.selectListOfPopulationInformationDTO(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
|
} |
|
|
@ -346,14 +356,19 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
public Result saveWithoutIdentifyNo(HouseResidentDTO dto) { |
|
|
|
//先取房屋的户主ID
|
|
|
|
PopulationInformationDTO houseHeadInfo = populationInformationService.getHouseHeadInfo(dto.getHouseId()); |
|
|
|
if(houseHeadInfo==null){ |
|
|
|
return new Result().error("请先填写户主信息!"); |
|
|
|
if (houseHeadInfo == null) { |
|
|
|
return new Result().error("请先填写户主信息!"); |
|
|
|
} |
|
|
|
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(dto,PopulationInformationEntity.class); |
|
|
|
populationInformationService.insert(populationInformationEntity); |
|
|
|
EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(dto.getResidentsIdentityNo()); |
|
|
|
if (null != check && null != houseHeadInfo) { |
|
|
|
throw new RenException("身份证号已存在"); |
|
|
|
} |
|
|
|
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); |
|
|
|
EpidemicUserInfoEntity userInfoEntity = convertInformationToUserInfo(populationInformationEntity); |
|
|
|
epidemicUserInfoService.insert(userInfoEntity); |
|
|
|
HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); |
|
|
|
//居住人与户主关联,与房屋不关联
|
|
|
|
houseResidentEntity.setResidentId(populationInformationEntity.getId()); |
|
|
|
houseResidentEntity.setResidentId(userInfoEntity.getId().toString()); |
|
|
|
houseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); |
|
|
|
houseResidentEntity.setHouseHeadId(houseHeadInfo.getId()); |
|
|
|
houseResidentEntity.setIsHouseHead("0"); |
|
|
@ -363,13 +378,19 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result updateWithoutIdentifyNo(HouseResidentDTO dto) { |
|
|
|
PopulationInformationEntity populationInformationEntity = populationInformationService.selectById(dto.getResidentId()); |
|
|
|
populationInformationEntity.setResidentsName(dto.getResidentsName()); |
|
|
|
populationInformationEntity.setResidentsSex(dto.getResidentsSex()); |
|
|
|
populationInformationEntity.setResidentsNation(dto.getResidentsNation()); |
|
|
|
populationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); |
|
|
|
populationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); |
|
|
|
populationInformationService.updateById(populationInformationEntity); |
|
|
|
|
|
|
|
EpidemicUserInfoEntity epidemicUserInfoEntity = epidemicUserInfoService.selectById(dto.getResidentId()); |
|
|
|
epidemicUserInfoEntity.setUserName(dto.getResidentsName()); |
|
|
|
epidemicUserInfoEntity.setMobile(dto.getResidentsPhone()); |
|
|
|
epidemicUserInfoEntity.setPeopleCategories(dto.getPeopleCategories()); |
|
|
|
epidemicUserInfoEntity.setSpecialCrowd(dto.getSpecialCrowd()); |
|
|
|
epidemicUserInfoEntity.setPoliticsStatus(dto.getPoliticsStatus()); |
|
|
|
epidemicUserInfoEntity.setGender(dto.getResidentsSex()); |
|
|
|
epidemicUserInfoEntity.setNation(dto.getResidentsNation()); |
|
|
|
epidemicUserInfoEntity.setRelation(dto.getHouseHeadRelation()); |
|
|
|
epidemicUserInfoEntity.setWorkUnits(dto.getCurrentEmployer()); |
|
|
|
epidemicUserInfoEntity.setLiveAddressName(dto.getCurrentAddress()); |
|
|
|
epidemicUserInfoService.updateById(epidemicUserInfoEntity); |
|
|
|
HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); |
|
|
|
houseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); |
|
|
|
houseResidentEntity.setId(dto.getId()); |
|
|
@ -377,4 +398,57 @@ public class HouseResidentServiceImpl extends BaseServiceImpl<HouseResidentDao, |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 转换新旧人员信息实体类 |
|
|
|
* |
|
|
|
* @param informationEntity |
|
|
|
* @return com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity |
|
|
|
* @author zhy |
|
|
|
* @date 2021/9/3 16:36 |
|
|
|
*/ |
|
|
|
private EpidemicUserInfoEntity convertInformationToUserInfo(PopulationInformationEntity informationEntity) { |
|
|
|
EpidemicUserInfoEntity entity = new EpidemicUserInfoEntity(); |
|
|
|
if (informationEntity.getId() != null) { |
|
|
|
entity.setId(Long.parseLong(informationEntity.getId())); |
|
|
|
} |
|
|
|
entity.setUserName(informationEntity.getResidentsName()); |
|
|
|
entity.setGender(informationEntity.getResidentsSex()); |
|
|
|
entity.setNation(informationEntity.getResidentsNation()); |
|
|
|
if (informationEntity.getResidentsBirthday() != null) { |
|
|
|
entity.setBirthday(DateUtils.format(informationEntity.getResidentsBirthday())); |
|
|
|
} |
|
|
|
entity.setStandardOfCulture(informationEntity.getEducationLevel()); |
|
|
|
entity.setPoliticsStatus(informationEntity.getPoliticsStatus()); |
|
|
|
entity.setJoinTime(informationEntity.getJoinTime()); |
|
|
|
entity.setOrganizationalRelationshipLocation(informationEntity.getOrganizationalRelationshipLocation()); |
|
|
|
entity.setIdCard(informationEntity.getResidentsIdentityNo()); |
|
|
|
entity.setMobile(informationEntity.getResidentsPhone()); |
|
|
|
entity.setHealth(informationEntity.getBodyStatus()); |
|
|
|
entity.setMaritalStatus(informationEntity.getMaritalStatus()); |
|
|
|
entity.setAccountType(informationEntity.getAccountType()); |
|
|
|
entity.setMilitary(informationEntity.getMilitaryService()); |
|
|
|
entity.setHouseholdRegisterDetail(informationEntity.getHouseholdRegistrationPlace()); |
|
|
|
entity.setWorkStatus(informationEntity.getEmploymentStatus()); |
|
|
|
entity.setWorkUnits(informationEntity.getCurrentEmployer()); |
|
|
|
entity.setCurrentEmployerAddress(informationEntity.getCurrentEmployerAddress()); |
|
|
|
entity.setUnemploymentReason(informationEntity.getUnemploymentReason()); |
|
|
|
entity.setReemploymentPermit(informationEntity.getReemploymentPermit()); |
|
|
|
entity.setUnemploymentRegister(informationEntity.getUnemploymentRegister()); |
|
|
|
entity.setUnemploymentRegisterTime(informationEntity.getUnemploymentRegisterTime()); |
|
|
|
entity.setSpecialCrowd(informationEntity.getSpecialCrowd()); |
|
|
|
entity.setFamilyCategory(informationEntity.getFamilyCategory()); |
|
|
|
entity.setHelpStatus(informationEntity.getHelpStatus()); |
|
|
|
entity.setMotorVehicleNum(informationEntity.getMotorVehicleNum()); |
|
|
|
entity.setMotorVehicleCategory(informationEntity.getMotorVehicleCategory()); |
|
|
|
entity.setDogStatus(informationEntity.getDogStatus()); |
|
|
|
entity.setFamilyMemberNum(informationEntity.getFamilyMemberNum()); |
|
|
|
entity.setFamilyMemberOutNum(informationEntity.getFamilyMemberOutNum()); |
|
|
|
entity.setFamilyMemberOutMonth(informationEntity.getFamilyMemberOutMonth()); |
|
|
|
entity.setFamilyMemberOutReason(informationEntity.getFamilyMemberOutReason()); |
|
|
|
entity.setSpecialCrowd(informationEntity.getSpecialCrowd()); |
|
|
|
entity.setPeopleCategories(informationEntity.getPeopleCategories()); |
|
|
|
entity.setRelation(NumConstant.ONE_STR); |
|
|
|
entity.setLiveAddressName(informationEntity.getCurrentAddress()); |
|
|
|
return entity; |
|
|
|
} |
|
|
|
} |