+
+ else {
+ if (adminRolesService.isAccountAdmin(user)) {
+ String format = "SELECT app.APP_ID, app.APP_NAME, app.APP_TYPE FROM FN_APP app inner join FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
+ + "where userrole.USER_ID = %d AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
+ + " AND (app.ENABLED = 'Y' OR app.APP_ID=1)";
+ String sql = String.format(format, user.getId());
+ logQuery(sql);
+ try {
+ return dataAccessService.executeSQLQuery(sql, AppIdAndNameTransportModel.class, null);
+ } catch (Exception e) {
+ EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Exception occurred while fetching the adminApps for user " + user.getLoginId(), e);
+ }
+
+ }
+
+ if (adminRolesService.isRoleAdmin(user)) {
+ final Map<String, Long> params = new HashMap<>();
+ params.put("userId", user.getId());
+ List applicationRoles = dataAccessService.executeNamedQuery("getApplicationsofTheUserContainsApprover",
+ params, null);
+
+ try {
+ return applicationRoles;
+ } catch (Exception e) {
+ EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Exception occurred while fetching the list of user who has type approver "
+ + user.getLoginId(),
+ e);
+ }
+
+ }
+ }
+ // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND
+ // app.APP_REST_ENDPOINT <> ''";
+