|
@ -121,7 +121,15 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl<IcOrganiz |
|
|
//查询该社区下是否存在数据
|
|
|
//查询该社区下是否存在数据
|
|
|
IcOrganizationCodeInfoEntity communEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); |
|
|
IcOrganizationCodeInfoEntity communEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); |
|
|
if (null == communEntity) { |
|
|
if (null == communEntity) { |
|
|
String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + "001"; |
|
|
Integer neighborMaxNum = 1; |
|
|
|
|
|
String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum); |
|
|
|
|
|
//开发测试需要检测,因为包含行政编码为空的社区,会出现小区编码重复的情况
|
|
|
|
|
|
IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(neighborCode,null); |
|
|
|
|
|
while (null != isHaveCoding) { |
|
|
|
|
|
neighborMaxNum++; |
|
|
|
|
|
neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum); |
|
|
|
|
|
isHaveCoding = icNeighborHoodDao.selectByCoding(neighborCode,null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
result.setCoding(neighborCode); |
|
|
result.setCoding(neighborCode); |
|
|
result.setSysCoding(neighborCode); |
|
|
result.setSysCoding(neighborCode); |
|
@ -129,7 +137,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl<IcOrganiz |
|
|
IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity(); |
|
|
IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity(); |
|
|
newEntity.setCustomerId(customerId); |
|
|
newEntity.setCustomerId(customerId); |
|
|
newEntity.setCommunityId(communResult.getCommunityId()); |
|
|
newEntity.setCommunityId(communResult.getCommunityId()); |
|
|
newEntity.setNeighborMaxNum("001"); |
|
|
newEntity.setNeighborMaxNum(getNewMaxIndex(3, neighborMaxNum)); |
|
|
baseDao.insert(newEntity); |
|
|
baseDao.insert(newEntity); |
|
|
} else { |
|
|
} else { |
|
|
Integer neighborMaxNum = Integer.valueOf(communEntity.getNeighborMaxNum()) + 1; |
|
|
Integer neighborMaxNum = Integer.valueOf(communEntity.getNeighborMaxNum()) + 1; |
|
|