Search in sources :

Example 1 with SavingsStatusChangeHistoryDto

use of org.mifos.dto.domain.SavingsStatusChangeHistoryDto in project head by mifos.

the class SavingsAction method getStatusHistory.

@TransactionDemarcate(joinToken = true)
public ActionForward getStatusHistory(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In SavingsAction::getRecentActivity()");
    String globalAccountNum = request.getParameter("globalAccountNum");
    List<SavingsStatusChangeHistoryDto> savingsStatusHistoryDtoList = this.savingsServiceFacade.retrieveStatusChangeHistory(globalAccountNum);
    SavingsBO savings = this.savingsDao.findBySystemId(globalAccountNum);
    Hibernate.initialize(savings.getAccountStatusChangeHistory());
    savings.setUserContext((UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession()));
    List<AccountStatusChangeHistoryEntity> savingsStatusHistoryViewList = new ArrayList<AccountStatusChangeHistoryEntity>(savings.getAccountStatusChangeHistory());
    SessionUtils.setCollectionAttribute(SavingsConstants.STATUS_CHANGE_HISTORY_LIST, savingsStatusHistoryViewList, request);
    return mapping.findForward("getStatusHistory_success");
}
Also used : SavingsStatusChangeHistoryDto(org.mifos.dto.domain.SavingsStatusChangeHistoryDto) ArrayList(java.util.ArrayList) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) AccountStatusChangeHistoryEntity(org.mifos.accounts.business.AccountStatusChangeHistoryEntity) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with SavingsStatusChangeHistoryDto

use of org.mifos.dto.domain.SavingsStatusChangeHistoryDto in project head by mifos.

the class SavingsServiceFacadeWebTier method retrieveStatusChangeHistory.

@Override
public List<SavingsStatusChangeHistoryDto> retrieveStatusChangeHistory(String globalAccountNum) {
    MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    UserContext userContext = toUserContext(user);
    SavingsBO savingsAccount = this.savingsDao.findBySystemId(globalAccountNum);
    savingsAccount.updateDetails(userContext);
    List<SavingsStatusChangeHistoryDto> dtoList = new ArrayList<SavingsStatusChangeHistoryDto>();
    List<AccountStatusChangeHistoryEntity> statusChangeHistory = savingsAccount.getAccountStatusChangeHistory();
    for (AccountStatusChangeHistoryEntity accountStatusChangeHistory : statusChangeHistory) {
        dtoList.add(accountStatusChangeHistory.toDto());
    }
    return dtoList;
}
Also used : SavingsStatusChangeHistoryDto(org.mifos.dto.domain.SavingsStatusChangeHistoryDto) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) MifosUser(org.mifos.security.MifosUser) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) AccountStatusChangeHistoryEntity(org.mifos.accounts.business.AccountStatusChangeHistoryEntity)

Aggregations

ArrayList (java.util.ArrayList)2 AccountStatusChangeHistoryEntity (org.mifos.accounts.business.AccountStatusChangeHistoryEntity)2 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)2 SavingsStatusChangeHistoryDto (org.mifos.dto.domain.SavingsStatusChangeHistoryDto)2 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 MifosUser (org.mifos.security.MifosUser)1 UserContext (org.mifos.security.util.UserContext)1