FINERACT-609 TopUp
This commit is contained in:
+2
@@ -37,5 +37,7 @@ public interface AccountDetailsReadPlatformService {
|
||||
|
||||
public List<LoanAccountSummaryData> retrieveLoanAccountDetailsByGroupIdAndGlimAccountNumber(Long groupId,final String glimAccount);
|
||||
|
||||
public Collection<LoanAccountSummaryData> retrieveGroupActiveLoanAccountSummary(final Long groupId);
|
||||
|
||||
AccountSummaryCollectionData retrieveGroupAccountDetails(Long groupId, Long gsimId);
|
||||
}
|
||||
|
||||
+8
-1
@@ -157,7 +157,8 @@ public class AccountDetailsReadPlatformServiceJpaRepositoryImpl implements Accou
|
||||
return retrieveLoanAccountDetails(loanWhereClause, new Object[] { groupId, loanOfficerId });
|
||||
}
|
||||
|
||||
@Override public Collection<LoanAccountSummaryData> retrieveClientActiveLoanAccountSummary(final Long clientId) {
|
||||
@Override
|
||||
public Collection<LoanAccountSummaryData> retrieveClientActiveLoanAccountSummary(final Long clientId) {
|
||||
final String loanWhereClause = " where l.client_id = ? and l.loan_status_id = 300 ";
|
||||
return retrieveLoanAccountDetails(loanWhereClause, new Object[] { clientId });
|
||||
}
|
||||
@@ -171,6 +172,12 @@ public class AccountDetailsReadPlatformServiceJpaRepositoryImpl implements Accou
|
||||
return this.jdbcTemplate.query(sql, rm, new Object[]{groupId , glimAccount});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<LoanAccountSummaryData> retrieveGroupActiveLoanAccountSummary(final Long groupId) {
|
||||
final String loanWhereClause = " where l.group_id = ? and l.loan_status_id = 300 and l.client_id is null";
|
||||
return retrieveLoanAccountDetails(loanWhereClause, new Object[] { groupId });
|
||||
}
|
||||
|
||||
|
||||
private List<LoanAccountSummaryData> retrieveLoanAccountDetails(final String loanwhereClause, final Object[] inputs) {
|
||||
final LoanAccountSummaryDataMapper rm = new LoanAccountSummaryDataMapper();
|
||||
|
||||
+6
-4
@@ -1428,15 +1428,17 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
||||
}
|
||||
}
|
||||
|
||||
Collection<LoanAccountSummaryData> clientActiveLoanOptions = null;
|
||||
if(loanProduct.canUseForTopup() && clientId != null){
|
||||
clientActiveLoanOptions = this.accountDetailsReadPlatformService.retrieveClientActiveLoanAccountSummary(clientId);
|
||||
Collection<LoanAccountSummaryData> activeLoanOptions = null;
|
||||
if(loanProduct.canUseForTopup() && clientId != null) {
|
||||
activeLoanOptions = this.accountDetailsReadPlatformService.retrieveClientActiveLoanAccountSummary(clientId);
|
||||
} else if (loanProduct.canUseForTopup() && groupId != null) {
|
||||
activeLoanOptions = this.accountDetailsReadPlatformService.retrieveGroupActiveLoanAccountSummary(groupId);
|
||||
}
|
||||
|
||||
return LoanAccountData.loanProductWithTemplateDefaults(loanProduct, loanTermFrequencyTypeOptions, repaymentFrequencyTypeOptions,
|
||||
repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDaysOfWeekTypeOptions, repaymentStrategyOptions,
|
||||
interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions,
|
||||
fundOptions, chargeOptions, loanPurposeOptions, loanCollateralOptions, loanCycleCounter, clientActiveLoanOptions);
|
||||
fundOptions, chargeOptions, loanPurposeOptions, loanCollateralOptions, loanCycleCounter, activeLoanOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user