|  |  | @ -218,7 +218,7 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR | 
			
		
	
		
			
				
					|  |  |  |     public void persisNat(IcNatCompareRecordEntity data, CustomerStaffInfoCacheResult staffInfo, String importDate, Date importTime) { | 
			
		
	
		
			
				
					|  |  |  |         // 查询是否本辖区居民
 | 
			
		
	
		
			
				
					|  |  |  |         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()); | 
			
		
	
		
			
				
					|  |  |  |         if (null == existEntity) { | 
			
		
	
	
		
			
				
					|  |  | @ -237,13 +237,12 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setImportDate(importDate); | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setImportTime(importTime); | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setAgencyId(staffInfo.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |             AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setStaffId(staffInfo.getStaffId()); | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setStaffName(staffInfo.getRealName()); | 
			
		
	
		
			
				
					|  |  |  |             if (null != agencyInfoCache) { | 
			
		
	
		
			
				
					|  |  |  |                 relationEntity.setPid(agencyInfoCache.getPid()); | 
			
		
	
		
			
				
					|  |  |  |                 relationEntity.setPids(agencyInfoCache.getPids()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setStaffId(staffInfo.getStaffId()); | 
			
		
	
		
			
				
					|  |  |  |             relationEntity.setStaffName(staffInfo.getRealName()); | 
			
		
	
		
			
				
					|  |  |  |             // 是否本社区(agency_id)下居民(0:否  1:是)
 | 
			
		
	
		
			
				
					|  |  |  |             if (null != icResiUserDTO && icResiUserDTO.getAgencyId().equals(staffInfo.getAgencyId())) { | 
			
		
	
		
			
				
					|  |  |  |                 relationEntity.setIsAgencyUser(NumConstant.ONE_STR); | 
			
		
	
	
		
			
				
					|  |  | @ -262,9 +261,35 @@ public class IcNatCompareRecordServiceImpl extends BaseServiceImpl<IcNatCompareR | 
			
		
	
		
			
				
					|  |  |  |             baseDao.updateById(origin); | 
			
		
	
		
			
				
					|  |  |  |             IcNatCompareRecRelationEntity existRelationEntity=icNatCompareRecRelationDao.selectExist(data.getCustomerId(),origin.getId(),staffInfo.getAgencyId(),importDate); | 
			
		
	
		
			
				
					|  |  |  |             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{ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 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); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |