Browse Source

140shiy

master
yinzuomei 3 years ago
parent
commit
9b41acc36c
  1. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatCompareRecordServiceImpl.java

37
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatCompareRecordServiceImpl.java

@ -218,7 +218,7 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR
public void persisNat(IcNatCompareRecordEntity data, CustomerStaffInfoCacheResult staffInfo, String importDate, Date importTime) { public void persisNat(IcNatCompareRecordEntity data, CustomerStaffInfoCacheResult staffInfo, String importDate, Date importTime) {
// 查询是否本辖区居民 // 查询是否本辖区居民
IcResiUserDTO icResiUserDTO = SpringContextUtils.getBean(IcResiUserService.class).getByIdCard(data.getCustomerId(), data.getIdCard(), null); IcResiUserDTO icResiUserDTO = SpringContextUtils.getBean(IcResiUserService.class).getByIdCard(data.getCustomerId(), data.getIdCard(), null);
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
//根据身份证号判断是否存在基础信息 //根据身份证号判断是否存在基础信息
IcNatCompareRecordEntity existEntity=baseDao.selectByIdCard(data.getCustomerId(),data.getIdCard()); IcNatCompareRecordEntity existEntity=baseDao.selectByIdCard(data.getCustomerId(),data.getIdCard());
if (null == existEntity) { if (null == existEntity) {
@ -237,13 +237,12 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR
relationEntity.setImportDate(importDate); relationEntity.setImportDate(importDate);
relationEntity.setImportTime(importTime); relationEntity.setImportTime(importTime);
relationEntity.setAgencyId(staffInfo.getAgencyId()); relationEntity.setAgencyId(staffInfo.getAgencyId());
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); relationEntity.setStaffId(staffInfo.getStaffId());
relationEntity.setStaffName(staffInfo.getRealName());
if (null != agencyInfoCache) { if (null != agencyInfoCache) {
relationEntity.setPid(agencyInfoCache.getPid()); relationEntity.setPid(agencyInfoCache.getPid());
relationEntity.setPids(agencyInfoCache.getPids()); relationEntity.setPids(agencyInfoCache.getPids());
} }
relationEntity.setStaffId(staffInfo.getStaffId());
relationEntity.setStaffName(staffInfo.getRealName());
// 是否本社区(agency_id)下居民(0:否 1:是) // 是否本社区(agency_id)下居民(0:否 1:是)
if (null != icResiUserDTO && icResiUserDTO.getAgencyId().equals(staffInfo.getAgencyId())) { if (null != icResiUserDTO && icResiUserDTO.getAgencyId().equals(staffInfo.getAgencyId())) {
relationEntity.setIsAgencyUser(NumConstant.ONE_STR); relationEntity.setIsAgencyUser(NumConstant.ONE_STR);
@ -262,9 +261,35 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR
baseDao.updateById(origin); baseDao.updateById(origin);
IcNatCompareRecRelationEntity existRelationEntity=icNatCompareRecRelationDao.selectExist(data.getCustomerId(),origin.getId(),staffInfo.getAgencyId(),importDate); IcNatCompareRecRelationEntity existRelationEntity=icNatCompareRecRelationDao.selectExist(data.getCustomerId(),origin.getId(),staffInfo.getAgencyId(),importDate);
if(null!=existRelationEntity){ if(null!=existRelationEntity){
// 是否本社区(agency_id)下居民(0:否 1:是)
if (null != icResiUserDTO && icResiUserDTO.getAgencyId().equals(staffInfo.getAgencyId())) {
existRelationEntity.setIsAgencyUser(NumConstant.ONE_STR);
} else {
existRelationEntity.setIsAgencyUser(NumConstant.ZERO_STR);
}
existRelationEntity.setImportTime(importTime);
icNatCompareRecRelationDao.updateById(existRelationEntity);
}else{ }else{
IcNatCompareRecRelationEntity relationEntity = new IcNatCompareRecRelationEntity();
relationEntity.setCustomerId(data.getCustomerId());
relationEntity.setCompareRecId(origin.getId());
relationEntity.setImportDate(importDate);
relationEntity.setImportTime(importTime);
relationEntity.setAgencyId(staffInfo.getAgencyId());
relationEntity.setStaffId(staffInfo.getStaffId());
relationEntity.setStaffName(staffInfo.getRealName());
if (null != agencyInfoCache) {
relationEntity.setPid(agencyInfoCache.getPid());
relationEntity.setPids(agencyInfoCache.getPids());
}
// 是否本社区(agency_id)下居民(0:否 1:是)
if (null != icResiUserDTO && icResiUserDTO.getAgencyId().equals(staffInfo.getAgencyId())) {
relationEntity.setIsAgencyUser(NumConstant.ONE_STR);
} else {
relationEntity.setIsAgencyUser(NumConstant.ZERO_STR);
}
//插入关系表
icNatCompareRecRelationDao.insert(relationEntity);
} }
} }

Loading…
Cancel
Save