|
|
|
@ -101,6 +101,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { |
|
|
|
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); |
|
|
|
} else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) { |
|
|
|
if ("wxmp".equals(formDTO.getClient())) { |
|
|
|
throw new RenException(EpmetErrorCode.RESI_IC_NAT.getCode(), EpmetErrorCode.RESI_IC_NAT.getMsg()); |
|
|
|
} |
|
|
|
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); |
|
|
|
} |
|
|
|
//1.获取所填居民所属组织缓存信息
|
|
|
|
@ -488,6 +491,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 +553,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 +560,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 +575,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()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|