From db034a8feb2a14b6c5255c58f6fd82d0b84bc361 Mon Sep 17 00:00:00 2001 From: karthik-tarento Date: Fri, 8 Jul 2022 12:05:07 +0530 Subject: [PATCH] Fix for sbRootOrgId value. --- .../org/sunbird/org/service/ExtendedOrgServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/sunbird/org/service/ExtendedOrgServiceImpl.java b/src/main/java/org/sunbird/org/service/ExtendedOrgServiceImpl.java index e2d144f17..cccffb850 100644 --- a/src/main/java/org/sunbird/org/service/ExtendedOrgServiceImpl.java +++ b/src/main/java/org/sunbird/org/service/ExtendedOrgServiceImpl.java @@ -320,7 +320,9 @@ private String findRootOrgId(String orgName, String mapId) { // We are going to search only 3 times for (int i = 0; i < 3; i++) { Map searchRequest = new HashMap(); - searchRequest.put(Constants.ORG_NAME, orgName); + if (StringUtils.isNotEmpty(orgName)) { + searchRequest.put(Constants.ORG_NAME, orgName); + } searchRequest.put(Constants.MAP_ID, mapId); List> existingDataList = cassandraOperation.getRecordsByProperties( @@ -332,8 +334,8 @@ private String findRootOrgId(String orgName, String mapId) { if (Constants.SPV.equalsIgnoreCase(parentMapId)) { return (String) data.get(Constants.SB_ORG_ID); } else { - mapId = (String) data.get(Constants.MAP_ID); - orgName = (String) data.get(Constants.ORG_NAME); + mapId = (String) data.get(Constants.PARENT_MAP_ID); + orgName = StringUtils.EMPTY; continue; } } else {