Browse Source

人员信息改版

origin/epidemic_user
zhangyuan 4 years ago
parent
commit
ab5a16ea9e
  1. 38
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/FeignRequestInterceptor.java
  2. 38
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/config/FeignRequestInterceptor.java
  3. 9
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java
  4. 126
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java
  5. 1
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java
  6. 9
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java
  7. 104
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java
  8. 80
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java
  9. 36
      epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml
  10. 31
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml
  11. 38
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml

38
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/FeignRequestInterceptor.java

@ -0,0 +1,38 @@
package com.elink.esua.epdc.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
*
* feign转发header参数
*
* @Authorliuchuang
* @Date2019/11/26 16:29
*/
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String values = request.getHeader(name);
template.header(name, values);
}
}
template.header("Content-Type","application/json");
template.header("content-type","application/json");
}
}

38
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/config/FeignRequestInterceptor.java

@ -0,0 +1,38 @@
package com.elink.esua.epdc.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
*
* feign转发header参数
*
* @Authorliuchuang
* @Date2019/11/26 16:29
*/
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String values = request.getHeader(name);
template.header(name, values);
}
}
template.header("Content-Type","application/json");
template.header("content-type","application/json");
}
}

9
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java

@ -166,4 +166,13 @@ public interface EpidemicUserInfoDao extends BaseDao<EpidemicUserInfoEntity> {
*/
void updateUserAge();
/**
* @return void
* @Description 清空入党时间
* @Author zhangyuan
* @Date 2020/9/4
* @Param [id]
**/
void setJionTimeToNull(@Param("id") String id);
}

126
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java

@ -17,20 +17,24 @@ import java.util.Date;
@EqualsAndHashCode(callSuper=false)
@TableName("epidemic_user_info")
public class EpidemicUserInfoEntity extends BasePingyinEntity {
private static final long serialVersionUID = 1L;
/**
* 姓名
*/
private String userName;
/**
* 身份证号
*/
private String idCard;
/**
* 户籍地code
*/
private String householdRegisterCode;
/**
* 户籍地名称
*/
@ -45,98 +49,122 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity {
* 性别
*/
private String gender;
/**
* 民族
*/
private String nation;
/**
* 曾用名
*/
private String formerName;
/**
* 出生年月
*/
private String birthday;
/**
* 身高
*/
private String height;
/**
* 文化程度
*/
private String standardOfCulture;
/**
* 健康情况
*/
private String health;
/**
* 婚姻状况
*/
private String maritalStatus;
/**
* 与户主关系
*/
private String relation;
/**
* 国籍
*/
private String nationality;
/**
* 政治面貌
*/
private String politicsStatus;
/**
* 宗教信仰
*/
private String faith;
/**
* 毕业院校
*/
private String graduateSchool;
/**
* 专业
*/
private String professional;
/**
* 工作状态
*/
private String workStatus;
/**
* 行业类别
*/
private String industryCategory;
/**
* 工作单位/
*/
private String workUnits;
/**
* 兵役状况
*/
private String military;
/**
* 人口类别
*/
private String peopleCategories;
/**
* 特殊人群
*/
private String specialCrowd;
/**
* 有无车辆
*/
private String car;
/**
* 车牌号
*/
private String carNo;
/**
* 人户状况
*/
private String hushaiStatus;
/**
* 籍贯
*/
private String nativePlace;
/**
* 血型
*/
@ -158,24 +186,118 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity {
private Integer age;
/**
* 县内居住地名称
* 县内居住地镇街
*/
private String liveAddressName;
/**
* 社区/村庄
*/
private String community;
/**
* 网格名称
*/
private String gridName;
/**
* 核酸检测状态
* 核酸检测状态0已检测 1未检测
*/
private String checkState;
/**
* 核酸检测时间
*/
private Date checkDate;
/**
* 入党时间
*/
private String joinTime;
/**
* 组织关系所在地
*/
private String organizationalRelationshipLocation;
/**
* 手机号或座机号
*/
private String mobile;
/**
* 户口类型 (0城镇 1农业)
*/
private String accountType;
/**
* 现单位地址
*/
private String currentEmployerAddress;
/**
* 失业原因 (0原单位破产 1解除合同 2效益不好 3减员 4其他)
*/
private String unemploymentReason;
/**
* 再就业优惠证 (0 1)
*/
private String reemploymentPermit;
/**
* 失业登记 (0 1)
*/
private String unemploymentRegister;
/**
* 失业登记时间
*/
private String unemploymentRegisterTime;
/**
* 家庭类别 (0普通家庭 1五好家庭 2军烈家庭 3优抚家庭 4单亲家庭 5空巢老人 6困难家庭)
*/
private String familyCategory;
/**
* 救助情况 (0低保 1大病 2廉租 3教育 4临时 5其他)
*/
private String helpStatus;
/**
* 机动车数量
*/
private Integer motorVehicleNum;
/**
* 机动车类型 (0轿车 1摩托 2其他)
*/
private String motorVehicleCategory;
/**
* 宠物犬状况 (0 1)
*/
private String dogStatus;
/**
* 家庭成员数
*/
private Integer familyMemberNum;
/**
* 家庭外出成员数
*/
private Integer familyMemberOutNum;
/**
* 外出原因 (0务工 1上学 2探亲 3其他)
*/
private String familyMemberOutReason;
/**
* 在外月数
*/
private Integer familyMemberOutMonth;
}

1
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java

@ -14,7 +14,6 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity;
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO;
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoV2DTO;
import java.util.List;
import java.util.Map;

9
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java

@ -66,6 +66,15 @@ public interface PopulationInformationDao extends BaseDao<PopulationInformationE
**/
PopulationInformationDTO getHouseHeadInfo(String houseId);
/**
* @return com.elink.esua.epdc.dto.PopulationInformationDTO
* @Description 取房屋户主信息
* @Author songyunpeng
* @Date 2020/8/24
* @Param [houseId]
**/
PopulationInformationDTO getHouseHeadInfoV2(String houseId);
/**
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
* @Description 人口信息列表

104
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java

@ -24,6 +24,7 @@ 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.*;
@ -32,9 +33,15 @@ import com.elink.esua.epdc.constant.PopulationDictConstant;
import com.elink.esua.epdc.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.dto.house.*;
import com.elink.esua.epdc.dto.house.BasePopulationInformationExportDto;
import com.elink.esua.epdc.dto.house.BaseResidentInformationExportDto;
import com.elink.esua.epdc.dto.house.HousingInformationDTO;
import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO;
import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO;
import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService;
import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient;
import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao;
import com.elink.esua.epdc.vaccine.house.dao.HousingInformationDao;
@ -42,7 +49,10 @@ import com.elink.esua.epdc.vaccine.house.entity.*;
import com.elink.esua.epdc.vaccine.house.excel.BasePopulationInformationExcel;
import com.elink.esua.epdc.vaccine.house.excel.BaseResidentInformationExcel;
import com.elink.esua.epdc.vaccine.house.redis.HousingInformationRedis;
import com.elink.esua.epdc.vaccine.house.service.*;
import com.elink.esua.epdc.vaccine.house.service.HouseBusinessInfoService;
import com.elink.esua.epdc.vaccine.house.service.HouseRentInfoService;
import com.elink.esua.epdc.vaccine.house.service.HousingInformationService;
import com.elink.esua.epdc.vaccine.house.service.PopulationInformationService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
@ -50,6 +60,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
@ -75,7 +86,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
private HouseBusinessInfoService houseBusinessInfoService;
@Autowired
private VimAdminFeignClient adminFeignClient;
private VimAdminFeignClient adminVimFeignClient;
@Autowired
private HouseResidentDao houseResidentDao;
@ -83,6 +94,12 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
@Autowired
private PopulationInformationService populationInformationService;
@Autowired
private EpidemicUserInfoService epidemicUserInfoService;
@Resource
private EpidemicUserInfoDao epidemicUserInfoDao;
@Override
public PageData<HousingInformationDTO> page(Map<String, Object> params) {
@ -172,7 +189,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
private void setDept(HousingInformationEntity entity) {
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(String.valueOf(entity.getGridId()));
Result<ParentAndAllDeptDTO> parentAndAllDept = adminVimFeignClient.getParentAndAllDept(String.valueOf(entity.getGridId()));
if (parentAndAllDept == null || !parentAndAllDept.success()) {
throw new RenException("获取部门信息失败");
}
@ -301,7 +318,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
if (StringUtils.isBlank(gridId)) {
return new Result().error("归属部门不能为空");
}
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(gridId);
Result<ParentAndAllDeptDTO> parentAndAllDept = adminVimFeignClient.getParentAndAllDept(gridId);
if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
return new Result().error("获取归属部门信息失败");
}
@ -313,7 +330,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
, 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);
Result<List<SysPopulationSimpleDictDTO>> listResult = adminVimFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO);
if (listResult == null || !listResult.success()) {
return new Result().error("获取字典信息失败");
}
@ -451,19 +468,20 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
//插入居民信息
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, PopulationInformationEntity.class);
populationInformationEntity.setResidentsIdentityNo(baseResidentInformationExcel.getResidentsFamilyIdentityNo());
populationInformationService.insert(populationInformationEntity);
EpidemicUserInfoEntity epidemicUserInfoEntity = convertInformationToUserInfo(populationInformationEntity);
epidemicUserInfoService.insert(epidemicUserInfoEntity);
//插入房屋人员关联关系表
HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class);
houseResidentEntity.setResidentId(populationInformationEntity.getId());
houseResidentEntity.setResidentId(epidemicUserInfoEntity.getId().toString());
//根据身份证获取户主ID
//查找户主ID
String houseHeadId;
PopulationInformationEntity infoByIdentityNo = populationInformationService.getInfoByIdentityNo(baseResidentInformationExcel.getResidentsIdentityNo());
EpidemicUserInfoEntity infoByIdentityNo = epidemicUserInfoDao.selectInfoByIdCard(baseResidentInformationExcel.getResidentsIdentityNo());
if (infoByIdentityNo == null) {
//查找不到户主则从Map中取
houseHeadId = populationIdNoAndIdMap.get(baseResidentInformationExcel.getResidentsIdentityNo());
} else {
houseHeadId = infoByIdentityNo.getId();
houseHeadId = infoByIdentityNo.getId().toString();
}
houseResidentEntity.setHouseHeadId(houseHeadId);
houseResidentEntity.setIsHouseHead("0");
@ -505,25 +523,25 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
//插入户主信息
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, PopulationInformationEntity.class);
PopulationInformationEntity oldPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo());
EpidemicUserInfoEntity epidemicUserInfoEntity = convertInformationToUserInfo(populationInformationEntity);
EpidemicUserInfoEntity oldPopulationInformationEntity = epidemicUserInfoDao.selectInfoByIdCard(populationInformationEntity.getResidentsIdentityNo());
//校验户主信息
validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel);
if (oldPopulationInformationEntity != null) {
//身份证在列表已存在,则更新户主信息,所属辖区以最后一次更新为准
populationInformationEntity.setId(oldPopulationInformationEntity.getId());
populationInformationService.updateById(populationInformationEntity);
epidemicUserInfoEntity.setId(oldPopulationInformationEntity.getId());
epidemicUserInfoService.updateById(epidemicUserInfoEntity);
} else {
//校验户主信息
populationInformationService.insert(populationInformationEntity);
epidemicUserInfoService.insert(epidemicUserInfoEntity);
}
//插入房屋人员关联关系表
HouseResidentEntity houseResidentEntity = new HouseResidentEntity();
houseResidentEntity.setHouseId(housingInformationEntity.getId());
houseResidentEntity.setResidentId(populationInformationEntity.getId());
houseResidentEntity.setResidentId(epidemicUserInfoEntity.getId().toString());
houseResidentEntity.setIsHouseHead("1");
houseResidentDao.insert(houseResidentEntity);
populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(), populationInformationEntity.getId());
populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(), epidemicUserInfoEntity.getId().toString());
}
return populationIdNoAndIdMap;
}
@ -1163,6 +1181,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
}
if ("在岗".equals(employmentStatus)) {
basePopulationInformationExcel.setUnemploymentReason(null);
if (StringUtils.isNotBlank((currentEmployer))) {
if (currentEmployer.length() > 128) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
@ -1316,5 +1335,56 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
return errorLineInfoList;
}
/**
* 转换新旧人员信息实体类
*
* @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.setRelation(NumConstant.ONE_STR);
entity.setLiveAddressName(informationEntity.getCurrentAddress());
return entity;
}
}

80
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java

@ -25,6 +25,7 @@ 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.constant.HouseHeadRelationConstant;
@ -35,7 +36,9 @@ import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.dto.house.*;
import com.elink.esua.epdc.dto.house.form.*;
import com.elink.esua.epdc.dto.house.result.*;
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService;
import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient;
import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao;
import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao;
@ -54,6 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
@ -84,6 +88,12 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Autowired
private VaccinationInfoService vaccinationInfoService;
@Autowired
private EpidemicUserInfoService epidemicUserInfoService;
@Resource
private EpidemicUserInfoDao epidemicUserInfoDao;
@Override
public PageData<PopulationInformationDTO> page(Map<String, Object> params) {
@ -161,8 +171,8 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Override
@Transactional(rollbackFor = Exception.class)
public Result update(PopulationInformationDTO dto) {
PopulationInformationEntity infoByIdentityNo = selectById(dto.getId());
if (dto.getResidentsIdentityNo().equals(infoByIdentityNo.getResidentsIdentityNo())) {
EpidemicUserInfoEntity infoByIdentityNo = epidemicUserInfoService.selectById(dto.getId());
if (dto.getResidentsIdentityNo().equals(infoByIdentityNo.getIdCard())) {
PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class);
//置空其他选择信息-防止导出时数据出错
if ("0".equals(dto.getPoliticsStatus())) {
@ -208,7 +218,9 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
//如果机动车数量为0 清空机动车类型
entity.setMotorVehicleCategory("");
}
updateById(entity);
EpidemicUserInfoEntity userInfoEntity = convertInformationToUserInfo(entity);
epidemicUserInfoService.updateById(userInfoEntity);
// updateById(entity);
return new Result();
} else {
//修改了身份证信息 - 提示信息
@ -228,7 +240,7 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
}
//2.第二次提交,则更新户主信息
PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class);
entity.setId(infoByIdentityNo.getId());
entity.setId(infoByIdentityNo.getId().toString());
//置空其他选择信息-防止导出时数据出错
if ("0".equals(dto.getPoliticsStatus())) {
//如果表单选择的是群众,则清空入党时间和组织关系所在地
@ -255,7 +267,9 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
}
}
this.updateById(entity);
EpidemicUserInfoEntity userInfoEntity = convertInformationToUserInfo(entity);
epidemicUserInfoService.updateById(userInfoEntity);
// this.updateById(entity);
return new Result();
}
}
@ -271,7 +285,7 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Override
public PopulationInformationDTO getHouseHeadInfo(String houseId) {
PopulationInformationDTO houseHeadInfo = baseDao.getHouseHeadInfo(houseId);
PopulationInformationDTO houseHeadInfo = baseDao.getHouseHeadInfoV2(houseId);
//处理机动车类型
if (houseHeadInfo != null && StringUtils.isNotBlank(houseHeadInfo.getMotorVehicleCategory())) {
String[] motorVehicleCategoryStrings = houseHeadInfo.getMotorVehicleCategory().split(",");
@ -323,7 +337,8 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Override
public void setJionTimeToNull(String id) {
baseDao.setJionTimeToNull(id);
// baseDao.setJionTimeToNull(id);
epidemicUserInfoDao.setJionTimeToNull(id);
}
@Override
@ -652,4 +667,55 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
return new Result().error();
}
}
/**
* 转换新旧人员信息实体类
*
* @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.setLiveAddressName(informationEntity.getCurrentAddress());
return entity;
}
}

36
epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml

@ -33,8 +33,8 @@
</update>
<select id="getEpidemicUserRecordList" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO">
select
uir.LIVE_ADDRESS_NAME as street,
uir.LIVE_ADDRESS_NAME,
-- uir.LIVE_ADDRESS_NAME as street,
-- uir.LIVE_ADDRESS_NAME,
ui.USER_NAME,
ui.ID_CARD,
ui.age,
@ -44,21 +44,21 @@
ui.PEOPLE_CATEGORIES,
ui.SPECIAL_CROWD,
ui.HUSHAI_STATUS,
uir.ID,
uir.MOBILE,
uir.COMMUNITY,
uir.GRID_NAME,
uir.PLOT,
uir.BUILDING_NO,
uir.UNIT,
IFNULL(uir.RETURN_STATE,'') AS RETURN_STATE ,
IFNULL(uir.RISK_GRADE,'') AS RISK_GRADE,
uir.ROOM_NO,
uir.OUT_LIVE_ADDRESS_NAME outLiveAddressName,
-- uir.ID,
-- uir.MOBILE,
-- uir.COMMUNITY,
-- uir.GRID_NAME,
-- uir.PLOT,
-- uir.BUILDING_NO,
-- uir.UNIT,
-- IFNULL(uir.RETURN_STATE,'') AS RETURN_STATE ,
-- IFNULL(uir.RISK_GRADE,'') AS RISK_GRADE,
-- uir.ROOM_NO,
-- uir.OUT_LIVE_ADDRESS_NAME outLiveAddressName,
ui.HOUSEHOLD_REGISTER_NAME householdRegisterName,
if(ui.check_state='0','已检测','未检测') as checkStateName
from epidemic_user_info ui
left join epidemic_user_inout_record uir on ui.ID_CARD=uir.ID_CARD and uir.DEL_FLAG='0'
-- left join epidemic_user_inout_record uir on ui.ID_CARD=uir.ID_CARD and uir.DEL_FLAG='0'
where ui.DEL_FLAG='0'
<if test="checkState != null and checkState != '' and checkState== '0'.toString()">
and ui.check_state = #{checkState}
@ -140,7 +140,7 @@
<if test="outLiveAddressName != null and outLiveAddressName.trim() != ''">
and uir.OUT_LIVE_ADDRESS_NAME like '%${outLiveAddressName}%'
</if>
GROUP BY ui.ID
-- GROUP BY ui.ID
ORDER BY ui.UPDATED_TIME DESC
<if test="excelBigDataPageSize != null and excelBigDataPageIndex != null">
limit #{excelBigDataPageIndex},#{excelBigDataPageSize}
@ -525,5 +525,9 @@
i.DEL_FLAG = '0'
and i.id = #{id}
</select>
<update id="setJionTimeToNull">
update epidemic_user_info
set JOIN_TIME = null
where ID = #{id}
</update>
</mapper>

31
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml

@ -18,21 +18,22 @@
</resultMap>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t1.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.CURRENT_EMPLOYER,
t.CURRENT_ADDRESS,
t1.HOUSE_HEAD_RELATION,
t1.HOUSE_HEAD_ID
from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
select t.ID,
t.USER_NAME as RESIDENTS_NAME,
t.GENDER as RESIDENTS_SEX,
t.NATION as RESIDENTS_NATION,
t.BIRTHDAY as RESIDENTS_BIRTHDAY,
t.STANDARD_OF_CULTURE as EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.JOIN_TIME,
t.ORGANIZATIONAL_RELATIONSHIP_LOCATION,
t.ID_CARD as RESIDENTS_IDENTITY_NO,
t.MOBILE as RESIDENTS_PHONE,
t.WORK_UNITS as CURRENT_EMPLOYER,
t.LIVE_ADDRESS_NAME as CURRENT_ADDRESS,
t1.HOUSE_ID as houseId,
t.RELATION as HOUSE_HEAD_RELATION
from epidemic_user_info t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_HEAD_ID = #{houseHeadId}
order by t1.CREATED_TIME desc
</select>

38
epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml

@ -98,6 +98,44 @@
and t1.IS_HOUSE_HEAD = '1'
and t1.HOUSE_ID = #{houseId} limit 1
</select>
<select id="getHouseHeadInfoV2" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select t.ID,
t.USER_NAME as RESIDENTS_NAME,
t.GENDER as RESIDENTS_SEX,
t.NATION as RESIDENTS_NATION,
t.BIRTHDAY as RESIDENTS_BIRTHDAY,
t.STANDARD_OF_CULTURE as EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.JOIN_TIME,
t.ORGANIZATIONAL_RELATIONSHIP_LOCATION,
t.ID_CARD as RESIDENTS_IDENTITY_NO,
t.MOBILE as RESIDENTS_PHONE,
t.HEALTH as BODY_STATUS,
t.MARITAL_STATUS,
t.ACCOUNT_TYPE,
t.MILITARY as MILITARY_SERVICE,
t.HOUSEHOLD_REGISTER_DETAIL as HOUSEHOLD_REGISTRATION_PLACE,
t.WORK_STATUS as EMPLOYMENT_STATUS,
t.WORK_UNITS as CURRENT_EMPLOYER,
t.CURRENT_EMPLOYER_ADDRESS,
t.UNEMPLOYMENT_REASON,
t.REEMPLOYMENT_PERMIT,
t.UNEMPLOYMENT_REGISTER,
t.UNEMPLOYMENT_REGISTER_TIME,
t.FAMILY_CATEGORY,
t.HELP_STATUS,
t.MOTOR_VEHICLE_NUM,
t.MOTOR_VEHICLE_CATEGORY,
t.DOG_STATUS,
t.LIVE_ADDRESS_NAME as CURRENT_ADDRESS,
t1.HOUSE_ID as houseId
from epidemic_user_info t
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG = '0'
and t1.DEL_FLAG = '0'
and t1.IS_HOUSE_HEAD = '1'
and t1.HOUSE_ID = #{houseId} limit 1
</select>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select

Loading…
Cancel
Save