diff --git a/src/main/java/org/sunbird/common/util/Constants.java b/src/main/java/org/sunbird/common/util/Constants.java index 8cbe4ff11..b2d8c8da9 100644 --- a/src/main/java/org/sunbird/common/util/Constants.java +++ b/src/main/java/org/sunbird/common/util/Constants.java @@ -1053,6 +1053,8 @@ public class Constants { public static final String DOMICILE_MEDIUM = "domicileMedium"; public static final String PINCODE = "pinCode"; public static final String EMPLOYEE_CODE = "employeeCode"; + public static final String PROFILE_STATUS = "profileStatus"; + public static final String NOT_VERIFIED = "NOT-VERIFIED"; private Constants() { throw new IllegalStateException("Utility class"); diff --git a/src/main/java/org/sunbird/profile/service/ProfileServiceImpl.java b/src/main/java/org/sunbird/profile/service/ProfileServiceImpl.java index 469e350d3..b9fcd2514 100644 --- a/src/main/java/org/sunbird/profile/service/ProfileServiceImpl.java +++ b/src/main/java/org/sunbird/profile/service/ProfileServiceImpl.java @@ -1776,8 +1776,42 @@ public SBApiResponse profileMDOAdminUpdate(Map request, String u listOfChangedDetails.add(keys); } for (String changedObj : listOfChangedDetails) { - if (profileDetailsMap.get(changedObj) instanceof ArrayList) { + if (profileDetailsMap.get(changedObj) instanceof String) { existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj)); + } else if (profileDetailsMap.get(changedObj) instanceof ArrayList) { + // KB-3718 + if (Constants.PROFESSIONAL_DETAILS.equalsIgnoreCase(changedObj)) { + List> professionalList = (List>) existingProfileDetails + .get(Constants.PROFESSIONAL_DETAILS); + ; + Map existingProfessionalDetailsMap = null; + // professional detail is empty... just replace... + if (CollectionUtils.isEmpty(professionalList)) { + existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj)); + professionalList = (List>) existingProfileDetails + .get(Constants.PROFESSIONAL_DETAILS); + existingProfessionalDetailsMap = professionalList.get(0); + } else { + existingProfessionalDetailsMap = professionalList.get(0); + Map updatedProfessionalDetailsMap = ((List>) profileDetailsMap + .get(changedObj)).get(0); + for (String childKey : updatedProfessionalDetailsMap.keySet()) { + existingProfessionalDetailsMap.put(childKey, + updatedProfessionalDetailsMap.get(childKey)); + } + } + if (StringUtils + .isNotBlank((String) existingProfessionalDetailsMap.get(Constants.GROUP)) && + StringUtils + .isNotBlank((String) existingProfessionalDetailsMap + .get(Constants.DESIGNATION))) { + existingProfileDetails.put(Constants.PROFILE_STATUS, Constants.VERIFIED); + } else { + existingProfileDetails.put(Constants.PROFILE_STATUS, Constants.NOT_VERIFIED); + } + } else { + existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj)); + } } else if (profileDetailsMap.get(changedObj) instanceof Boolean) { existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj)); } else { diff --git a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java index c5ed9c9c3..6c921dec9 100644 --- a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java +++ b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java @@ -675,6 +675,7 @@ public String updateBulkUploadUser(UserRegistration userRegistration) { profileDetails.put(Constants.ADDITIONAL_PROPERTIES, additionalProperties); profileDetails.put(Constants.VERIFIED_KARMAYOGI, false); profileDetails.put(Constants.MANDATORY_FIELDS_EXISTS, false); + profileDetails.put(Constants.PROFILE_STATUS, Constants.NOT_VERIFIED); requestBody.put(Constants.PROFILE_DETAILS, profileDetails); request.put(Constants.REQUEST, requestBody); Map readData = (Map) outboundRequestHandlerService.fetchResultUsingPatch( diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a140bef84..0f3bcbff7 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -6,7 +6,7 @@ server.tomcat.accept-count=500 server.port=7001 #spring data jpa for postgres -spring.datasource.jdbc-url=jdbc:postgresql://localhost:5432/sunbird +spring.datasource.jdbc-url=jdbc:postgresql://postgresIP:5432/sunbird spring.datasource.username=sunbird spring.datasource.password=sunbird spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect @@ -23,7 +23,7 @@ wf.service.update.pendingRequestsToNewMDO = v1/workflow/update/pendingRequestsTo user.enable.multidept.mapping=false #learner.service.url=learner-service:9000 -sb.service.url=http://localhost:9000 +sb.service.url=http://learnerServiceIP:9010 sb.org.search.path=/v1/org/search sb.org.create.path=/private/v1/org/create sb.service.user.create.path=/v3/user/create @@ -38,7 +38,7 @@ sb.otp.generate.path=/v1/otp/generate sb.role.read=/v1/user/role/read/ spring.data.cassandra.sb.startupTimeoutInSeconds=100000 -spring.data.cassandra.sb.contact-points=localhost +spring.data.cassandra.sb.contact-points=cassandraIP sb.data.sync.path=/v1/data/sync spring.data.cassandra.sb.port=9042 spring.data.cassandra.sb.keyspace-name=sunbird @@ -207,7 +207,7 @@ sender.mail=igot-support@tarento.com notification.event.endpoint=/v1/notification/send/sync notification.service.host=http://notification-service:9000 last.access.time.gap.millis=259200000 -cassandra.config.host=localhost +cassandra.config.host=cassandraIP sso.url=https://karmayogi.nic.in/auth/ sso.realm=sunbird