Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #901 from egovernments/ISTE_229_DownlaodIssue
Browse files Browse the repository at this point in the history
ISTE-229: Download Issue
  • Loading branch information
pradeepkumarcm-egov authored Aug 12, 2024
2 parents 4373e28 + 452acd7 commit 4731a93
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ public List<Map<String, Object>> getLedgerReport(String consumercode, String ten
newlimit = limit;
if (limit != null && limit >= wsConfiguration.getMaxLimit())
newlimit = wsConfiguration.getMaxLimit();

if (limit != null && limit == -1) // Handling the case when limit is -1
newlimit = -1;
if (offset != null)
newoffset = offset;

Expand All @@ -737,6 +738,9 @@ public List<Map<String, Object>> getLedgerReport(String consumercode, String ten
ledgerReportRowMapper.setEndYear(endYear);
ledgerReportRowMapper.setConsumerCode(consumercode);
List<Map<String, Object>> ledgerReportList= jdbcTemplate.query(query.toString(), preparedStatement.toArray(), ledgerReportRowMapper);
if (newlimit == -1) {
return ledgerReportList;
}
int fromIndex = Math.min(newoffset, ledgerReportList.size());
int toIndex = Math.min(fromIndex + newlimit, ledgerReportList.size());
return ledgerReportList.subList(fromIndex, toIndex);
Expand Down

0 comments on commit 4731a93

Please sign in to comment.