Search in sources :

Example 1 with CustSearchActionForm

use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.

the class CustSearchAction method loadSearch.

@TransactionDemarcate(saveToken = true)
public ActionForward loadSearch(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    actionForm.setSearchString(null);
    if (request.getParameter("perspective") != null) {
        request.setAttribute("perspective", request.getParameter("perspective"));
    }
    cleanUpSearch(request);
    return mapping.findForward(ActionForwards.loadSearch_success.toString());
}
Also used : CustSearchActionForm(org.mifos.customers.struts.actionforms.CustSearchActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with CustSearchActionForm

use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.

the class CustSearchAction method loadAllBranches.

@TransactionDemarcate(saveToken = true)
public ActionForward loadAllBranches(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    actionForm.setOfficeId("0");
    UserContext userContext = getUserContext(request);
    SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
    loadMasterData(userContext.getId(), request, actionForm);
    return mapping.findForward(CustomerSearchConstants.LOADALLBRANCHES_SUCCESS);
}
Also used : CustSearchActionForm(org.mifos.customers.struts.actionforms.CustSearchActionForm) UserContext(org.mifos.security.util.UserContext) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 3 with CustSearchActionForm

use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.

the class CustSearchAction method preview.

@TransactionDemarcate(conditionToken = true)
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    if (StringUtils.isNotBlank(actionForm.getOfficeId())) {
        List<PersonnelBO> personnelList = legacyPersonnelDao.getActiveLoanOfficersUnderOffice(getShortValue(actionForm.getOfficeId()));
        SessionUtils.setCollectionAttribute(CustomerSearchConstants.LOANOFFICERSLIST, personnelList, request);
    }
    UserContext userContext = getUserContext(request);
    Short userBranchId = userContext.getBranchId();
    String officeName = retrieveOfficeName(actionForm, userBranchId);
    SessionUtils.setAttribute(CustomerSearchConstants.OFFICE, officeName, request);
    SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
    SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDNONLOANOFFICER, request);
    HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
    customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
    SessionUtils.setMapAttribute("availibleCustomerStates", customerStates, request);
    List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
    SessionUtils.setCollectionAttribute("availibleClientGenders", availibleClientGenders, request);
    return mapping.findForward(CustomerSearchConstants.LOADFORWARDNONLOANOFFICER_SUCCESS);
}
Also used : CustomerStatusDetailDto(org.mifos.dto.screen.CustomerStatusDetailDto) CustSearchActionForm(org.mifos.customers.struts.actionforms.CustSearchActionForm) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) HashMap(java.util.HashMap) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) ValueListElement(org.mifos.dto.domain.ValueListElement) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 4 with CustSearchActionForm

use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.

the class CustSearchAction method get.

@TransactionDemarcate(joinToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    boolean isCenterHierarchyExist = ClientRules.getCenterHierarchyExists();
    if (StringUtils.isNotBlank(actionForm.getLoanOfficerId())) {
        Short loanOfficerId = Short.valueOf(actionForm.getLoanOfficerId());
        List<CustomerDetailDto> customerList = this.centerServiceFacade.retrieveCustomersUnderUser(loanOfficerId);
        SessionUtils.setCollectionAttribute(CustomerSearchConstants.CUSTOMERLIST, customerList, request);
        SessionUtils.setAttribute("GrpHierExists", isCenterHierarchyExist, request);
        SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDLOANOFFICER, request);
    }
    if (StringUtils.isNotBlank(actionForm.getOfficeId())) {
        List<PersonnelBO> personnelList = legacyPersonnelDao.getActiveLoanOfficersUnderOffice(getShortValue(actionForm.getOfficeId()));
        SessionUtils.setCollectionAttribute(CustomerSearchConstants.LOANOFFICERSLIST, personnelList, request);
    }
    UserContext userContext = getUserContext(request);
    Short userBranchId = userContext.getBranchId();
    String officeName = retrieveOfficeName(actionForm, userBranchId);
    SessionUtils.setAttribute("isCenterHierarchyExists", isCenterHierarchyExist, request);
    SessionUtils.setAttribute(CustomerSearchConstants.OFFICE, officeName, request);
    SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDNONLOANOFFICER, request);
    HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
    customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
    SessionUtils.setMapAttribute("availibleCustomerStates", customerStates, request);
    List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
    SessionUtils.setCollectionAttribute("availibleClientGenders", availibleClientGenders, request);
    return mapping.findForward(CustomerSearchConstants.LOADFORWARDLOANOFFICER_SUCCESS);
}
Also used : CustomerStatusDetailDto(org.mifos.dto.screen.CustomerStatusDetailDto) HashMap(java.util.HashMap) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) CustSearchActionForm(org.mifos.customers.struts.actionforms.CustSearchActionForm) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) CustomerDetailDto(org.mifos.dto.domain.CustomerDetailDto) ValueListElement(org.mifos.dto.domain.ValueListElement) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 5 with CustSearchActionForm

use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.

the class CustSearchAction method getHomePage.

@TransactionDemarcate(saveToken = true)
public ActionForward getHomePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    actionForm.setSearchString(null);
    cleanUpSearch(request);
    UserContext userContext = getUserContext(request);
    UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userContext.getId());
    SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
    loadMasterData(userContext.getId(), request, actionForm);
    if (userDetails.isLoanOfficer()) {
        loadLoanOfficerCustomersHierarchyForSelectedDay(userContext.getId(), request, actionForm);
    }
    DashboardDto dashboardDto = dashboardServiceFacade.getDashboardDto();
    SessionUtils.setAttribute("dashboard", dashboardDto, request);
    HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
    customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
    SessionUtils.setMapAttribute("availibleCustomerStates", customerStates, request);
    List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
    SessionUtils.setCollectionAttribute("availibleClientGenders", availibleClientGenders, request);
    return mapping.findForward(CustomerConstants.GETHOMEPAGE_SUCCESS);
}
Also used : CustomerStatusDetailDto(org.mifos.dto.screen.CustomerStatusDetailDto) CustSearchActionForm(org.mifos.customers.struts.actionforms.CustSearchActionForm) HashMap(java.util.HashMap) UserContext(org.mifos.security.util.UserContext) UserDetailDto(org.mifos.dto.domain.UserDetailDto) ArrayList(java.util.ArrayList) ValueListElement(org.mifos.dto.domain.ValueListElement) DashboardDto(org.mifos.dto.domain.DashboardDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

CustSearchActionForm (org.mifos.customers.struts.actionforms.CustSearchActionForm)8 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)8 UserContext (org.mifos.security.util.UserContext)7 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 ValueListElement (org.mifos.dto.domain.ValueListElement)4 CustomerStatusDetailDto (org.mifos.dto.screen.CustomerStatusDetailDto)4 CustomerException (org.mifos.customers.exceptions.CustomerException)2 CustomerPersistence (org.mifos.customers.persistence.CustomerPersistence)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 QueryResult (org.mifos.framework.hibernate.helper.QueryResult)2 ActionErrors (org.apache.struts.action.ActionErrors)1 ActionForward (org.apache.struts.action.ActionForward)1 ActionMessage (org.apache.struts.action.ActionMessage)1 OfficePersistence (org.mifos.customers.office.persistence.OfficePersistence)1 CustomerDetailDto (org.mifos.dto.domain.CustomerDetailDto)1 DashboardDto (org.mifos.dto.domain.DashboardDto)1 UserDetailDto (org.mifos.dto.domain.UserDetailDto)1 SearchFiltersDto (org.mifos.dto.screen.SearchFiltersDto)1