|  |  | @ -488,6 +488,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp | 
			
		
	
		
			
				
					|  |  |  |         String natResult = e.getNatResult(); | 
			
		
	
		
			
				
					|  |  |  |         String natAddress = e.getNatAddress(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 居民信息
 | 
			
		
	
		
			
				
					|  |  |  |         IcResiUserEntity resi = getResi(customerId, idCard, null); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //1.先看客户下有没有这个人
 | 
			
		
	
		
			
				
					|  |  |  |         IcNatEntity resiNat = getResiNat(customerId, idCard, natTime); | 
			
		
	
		
			
				
					|  |  |  |         if (resiNat != null && !"import".equals(resiNat.getUserType())) { | 
			
		
	
	
		
			
				
					|  |  | @ -547,7 +550,6 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp | 
			
		
	
		
			
				
					|  |  |  |                 resiNat.setUpdatedBy(currentUserId); | 
			
		
	
		
			
				
					|  |  |  |                 resiNat.setUpdatedTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 IcResiUserEntity resi = getResi(customerId, idCard, null); | 
			
		
	
		
			
				
					|  |  |  |                 resiNat.setIsResiUser(resi != null ? "1" : "0"); | 
			
		
	
		
			
				
					|  |  |  |                 resiNat.setUserId(resi != null ? resi.getId() : ""); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -555,15 +557,14 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             // 还要创建关系。只有本辖区及下级居民,才建立关系
 | 
			
		
	
		
			
				
					|  |  |  |             if (getResi(customerId, idCard, String.join(":", Arrays.asList(agencyPids, agencyId))) != null) { | 
			
		
	
		
			
				
					|  |  |  |                 createNatRelation(resiNat.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids()); | 
			
		
	
		
			
				
					|  |  |  |             if (resi != null) { | 
			
		
	
		
			
				
					|  |  |  |                 createNatRelation(resiNat.getId(), resi.getAgencyId(), resi.getPids()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 执行新增操作
 | 
			
		
	
		
			
				
					|  |  |  |         IcResiUserEntity resi = getResi(customerId, idCard, null); | 
			
		
	
		
			
				
					|  |  |  |         e.setIsResiUser(resi != null ? "1" : "0"); | 
			
		
	
		
			
				
					|  |  |  |         e.setUserId(resi != null ? resi.getId() : ""); | 
			
		
	
		
			
				
					|  |  |  |         e.setUserType("import"); | 
			
		
	
	
		
			
				
					|  |  | @ -571,8 +572,8 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp | 
			
		
	
		
			
				
					|  |  |  |         baseDao.insert(e); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 还要创建关系。只有本辖区及下级居民,才建立关系
 | 
			
		
	
		
			
				
					|  |  |  |         if (getResi(customerId, idCard, String.join(":", Arrays.asList(agencyPids, agencyId))) != null) { | 
			
		
	
		
			
				
					|  |  |  |             createNatRelation(e.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids()); | 
			
		
	
		
			
				
					|  |  |  |         if (resi != null) { | 
			
		
	
		
			
				
					|  |  |  |             createNatRelation(e.getId(), resi.getAgencyId(), resi.getPids()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |