use of org.mifos.dto.screen.ClosedAccountDto in project head by mifos.
the class CustAction method getClosedAccounts.
@TransactionDemarcate(joinToken = true)
public ActionForward getClosedAccounts(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In CustAction::getClosedAccounts()");
UserContext userContext = getUserContext(request);
Integer customerId = getIntegerValue(((CustActionForm) form).getCustomerId());
List<ClosedAccountDto> allClosedAccounts = this.centerServiceFacade.retrieveAllClosedAccounts(customerId);
List<AccountBO> loanAccountsList = new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.LOAN_ACCOUNT.getValue());
loanAccountsList.addAll(new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.GROUP_LOAN_ACCOUNT.getValue()));
List<AccountBO> savingsAccountList = new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.SAVINGS_ACCOUNT.getValue());
SessionUtils.setCollectionAttribute(AccountConstants.CLOSEDLOANACCOUNTSLIST, loanAccountsList, request);
SessionUtils.setCollectionAttribute(AccountConstants.CLOSEDSAVINGSACCOUNTSLIST, savingsAccountList, request);
return mapping.findForward(ActionForwards.getAllClosedAccounts.toString());
}
use of org.mifos.dto.screen.ClosedAccountDto in project head by mifos.
the class CenterServiceFacadeWebTier method retrieveAllClosedAccounts.
@Override
public List<ClosedAccountDto> retrieveAllClosedAccounts(Integer customerId) {
List<ClosedAccountDto> closedAccounts = new ArrayList<ClosedAccountDto>();
List<AccountBO> allClosedAccounts = this.customerDao.retrieveAllClosedLoanAndSavingsAccounts(customerId);
for (AccountBO account : allClosedAccounts) {
LocalDate closedDate = new LocalDate(account.getClosedDate());
ClosedAccountDto closedAccount = new ClosedAccountDto(account.getAccountId(), account.getGlobalAccountNum(), account.getType().getValue().intValue(), account.getState().getValue().intValue(), closedDate);
closedAccounts.add(closedAccount);
}
return closedAccounts;
}
Aggregations