Search in sources :

Example 6 with CustomerRecentActivityDto

use of org.mifos.dto.screen.CustomerRecentActivityDto in project head by mifos.

the class CustomerAccountAction method load.

@TransactionDemarcate(saveToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    String globalCustNum = ((CustomerAccountActionForm) form).getGlobalCustNum();
    if (StringUtils.isBlank(globalCustNum)) {
        // NOTE: see CustomerAction.getAllActivity for explanation of this craziness
        globalCustNum = (String) SessionUtils.getAttribute("customerGlobalNum", request.getSession());
    }
    CustomerBO customerBO = this.customerDao.findCustomerBySystemId(globalCustNum);
    CustomerAccountBO customerAccount = customerBO.getCustomerAccount();
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, customerAccount, request);
    List<CustomerRecentActivityDto> recentActivities = this.centerServiceFacade.retrieveRecentActivities(customerBO.getCustomerId(), 3);
    SessionUtils.setCollectionAttribute(CustomerConstants.RECENT_ACTIVITIES, recentActivities, request);
    ActionForwards forward = getForward(customerBO);
    return mapping.findForward(forward.toString());
}
Also used : CustomerAccountActionForm(org.mifos.customers.struts.actionforms.CustomerAccountActionForm) CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) ActionForwards(org.mifos.application.util.helpers.ActionForwards) CustomerBO(org.mifos.customers.business.CustomerBO) CustomerRecentActivityDto(org.mifos.dto.screen.CustomerRecentActivityDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

CustomerRecentActivityDto (org.mifos.dto.screen.CustomerRecentActivityDto)6 CustomerBO (org.mifos.customers.business.CustomerBO)3 ArrayList (java.util.ArrayList)2 CustomerActivityEntity (org.mifos.customers.business.CustomerActivityEntity)2 Money (org.mifos.framework.util.helpers.Money)2 Locale (java.util.Locale)1 Test (org.junit.Test)1 ActionForwards (org.mifos.application.util.helpers.ActionForwards)1 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)1 CustomerAccountActionForm (org.mifos.customers.struts.actionforms.CustomerAccountActionForm)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1