diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java index 126a404256d..71b83328409 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java @@ -130,9 +130,9 @@ public EmailData retrieveOne(final Long resourceId) { @Override public Collection retrieveAllPending(final SearchParameters searchParameters) { final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : ""; - final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = " + sqlPlusLimit; + final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum =? " + sqlPlusLimit; - return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.PENDING.getValue() }); + return this.jdbcTemplate.query(sql, this.emailRowMapper, EmailMessageStatusType.PENDING.getValue()); } @Override @@ -140,15 +140,15 @@ public Collection retrieveAllSent(final SearchParameters searchParame final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : ""; final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit; - return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.SENT.getValue() }); + return this.jdbcTemplate.query(sql, this.emailRowMapper, EmailMessageStatusType.SENT.getValue()); } @Override public List retrieveExternalIdsOfAllSent(final Integer limit) { final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : ""; - final String sql = "select external_id from " + this.emailRowMapper.tableName() + " where status_enum = " + sqlPlusLimit; + final String sql = "select external_id from " + this.emailRowMapper.tableName() + " where status_enum =? " + sqlPlusLimit; - return this.jdbcTemplate.queryForList(sql, Long.class, new Object[] { EmailMessageStatusType.SENT.getValue() }); + return this.jdbcTemplate.queryForList(sql, Long.class, EmailMessageStatusType.SENT.getValue()); } @Override @@ -156,7 +156,7 @@ public Collection retrieveAllDelivered(final Integer limit) { final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : ""; final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit; - return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.DELIVERED.getValue() }); + return this.jdbcTemplate.query(sql, this.emailRowMapper, EmailMessageStatusType.DELIVERED.getValue()); } @Override @@ -164,7 +164,7 @@ public Collection retrieveAllFailed(final SearchParameters searchPara final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : ""; final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = ?" + sqlPlusLimit; - return this.jdbcTemplate.query(sql, this.emailRowMapper, new Object[] { EmailMessageStatusType.FAILED.getValue() }); + return this.jdbcTemplate.query(sql, this.emailRowMapper, EmailMessageStatusType.FAILED.getValue()); } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java index aa9bbb80f11..0f0c4c5b7c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java @@ -39,7 +39,6 @@ import javax.ws.rs.core.UriInfo; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.exception.PlatformServiceUnavailableException; -import org.apache.fineract.infrastructure.dataqueries.service.DatatableReportingProcessService; import org.apache.fineract.infrastructure.dataqueries.service.ReadReportingService; import org.apache.fineract.infrastructure.report.provider.ReportingProcessServiceProvider; import org.apache.fineract.infrastructure.report.service.ReportingProcessService; @@ -61,16 +60,13 @@ public class RunreportsApiResource { private final PlatformSecurityContext context; private final ReadReportingService readExtraDataAndReportingService; private final ReportingProcessServiceProvider reportingProcessServiceProvider; - private final DatatableReportingProcessService datatableReportingProcessService; @Autowired public RunreportsApiResource(final PlatformSecurityContext context, final ReadReportingService readExtraDataAndReportingService, - final ReportingProcessServiceProvider reportingProcessServiceProvider, - DatatableReportingProcessService aDatatableReportingProcessService) { + final ReportingProcessServiceProvider reportingProcessServiceProvider) { this.context = context; this.readExtraDataAndReportingService = readExtraDataAndReportingService; this.reportingProcessServiceProvider = reportingProcessServiceProvider; - datatableReportingProcessService = aDatatableReportingProcessService; } @GET @@ -109,10 +105,6 @@ public Response runReport(@PathParam("reportName") @Parameter(description = "rep // Pass through isSelfServiceUserReport so that ReportingProcessService implementations can use it queryParams.putSingle(IS_SELF_SERVICE_USER_REPORT_PARAMETER, Boolean.toString(isSelfServiceUserReport)); - if (parameterType) { - return datatableReportingProcessService.processRequest(reportName, queryParams); - } - String reportType = this.readExtraDataAndReportingService.getReportType(reportName, isSelfServiceUserReport); ReportingProcessService reportingProcessService = this.reportingProcessServiceProvider.findReportingProcessService(reportType); if (reportingProcessService == null) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java index a5c1596cd75..bbbff0af544 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java @@ -49,7 +49,7 @@ public BasicAuthTenantDetailsServiceJdbc(@Qualifier("hikariTenantDataSource") fi private static final class TenantMapper implements RowMapper { private final boolean isReport; - private final StringBuilder sqlBuilder = new StringBuilder("SELECT t.id, ts.id as connectionId, ")// + private final StringBuilder sqlBuilder = new StringBuilder(" t.id, ts.id as connectionId , ")// .append(" t.timezone_id as timezoneId , t.name,t.identifier, ts.schema_name as schemaName, ts.schema_server as schemaServer,")// .append(" ts.schema_server_port as schemaServerPort, ts.schema_connection_parameters as schemaConnectionParameters, ts.auto_update as autoUpdate,")// .append(" ts.schema_username as schemaUsername, ts.schema_password as schemaPassword , ts.pool_initial_size as initialSize,")// @@ -60,7 +60,7 @@ private static final class TenantMapper implements RowMapper { - private final String tenantIdentifier; - - private final StringBuilder sqlBuilder = new StringBuilder("SELECT t.id, ts.id as connectionId, ")// + private final StringBuilder sqlBuilder = new StringBuilder("t.id, ts.id as connectionId , ")// .append(" t.timezone_id as timezoneId , t.name,t.identifier, ts.schema_name as schemaName, ts.schema_server as schemaServer,")// .append(" ts.schema_server_port as schemaServerPort, ts.schema_connection_parameters as schemaConnectionParameters, ts.auto_update as autoUpdate,")// .append(" ts.schema_username as schemaUsername, ts.schema_password as schemaPassword , ts.pool_initial_size as initialSize,")// @@ -62,28 +60,21 @@ private static final class TenantMapper implements RowMapper findAllTenants() { - final TenantMapper rm = new TenantMapper(null); - final String sql = rm.schema(); + final TenantMapper rm = new TenantMapper(); + final String sql = "select " + rm.schema(); final List fineractPlatformTenants = this.jdbcTemplate.query(sql, rm, new Object[] {}); return fineractPlatformTenants; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql index 794ab210e6f..70ffd5df96e 100644 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql @@ -18,10 +18,5 @@ -- -- two tables added: ReportCategoryList and FullReportList (FINERACT-1306) -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) -SELECT 'ReportCategoryList', 'Table', NULL, NULL, NULL, 1, 1 -ON DUPLICATE key UPDATE report_name = 'ReportCategoryList'; - -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) -SELECT 'FullReportList', 'Table', NULL, NULL, NULL, 1, 1 -ON DUPLICATE key UPDATE report_name = 'FullReportList'; +INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("ReportCategoryList", 'Table', '(NULL)', '(NULL)', '(NULL)', 1, 1); +INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("FullReportList", 'Table', '(NULL)', '(NULL)', '(NULL)', 1, 1);