use of org.mifos.customers.struts.actionforms.CustomerAccountActionForm 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());
}
Aggregations