Search in sources :

Example 1 with CustomerStatusDetailDto

use of org.mifos.dto.screen.CustomerStatusDetailDto 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 2 with CustomerStatusDetailDto

use of org.mifos.dto.screen.CustomerStatusDetailDto 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 3 with CustomerStatusDetailDto

use of org.mifos.dto.screen.CustomerStatusDetailDto 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)

Example 4 with CustomerStatusDetailDto

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

the class CustSearchAction method loadMainSearch.

@TransactionDemarcate(saveToken = true)
public ActionForward loadMainSearch(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    String forward = null;
    CustSearchActionForm actionForm = (CustSearchActionForm) form;
    actionForm.setSearchString(null);
    actionForm.setOfficeId("0");
    cleanUpSearch(request);
    UserContext userContext = getUserContext(request);
    SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
    forward = loadMasterData(userContext.getId(), request, actionForm);
    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(forward);
}
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) ArrayList(java.util.ArrayList) ValueListElement(org.mifos.dto.domain.ValueListElement) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 5 with CustomerStatusDetailDto

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

the class EditCustomerStatusAction method previewStatus.

@TransactionDemarcate(joinToken = true)
public ActionForward previewStatus(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In EditCustomerStatusAction:preview()");
    CustomerBO customerBO = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    EditCustomerStatusActionForm statusActionForm = (EditCustomerStatusActionForm) form;
    statusActionForm.setCommentDate(DateUtils.getCurrentDate(getUserContext(request).getPreferredLocale()));
    if (StringUtils.isNotBlank(statusActionForm.getNewStatusId())) {
        CustomerStatusDetailDto customerStatusDetail = this.centerServiceFacade.retrieveCustomerStatusDetails(statusActionForm.getNewStatusIdValue(), statusActionForm.getFlagIdValue(), customerBO.getLevel().getValue());
        SessionUtils.setAttribute(SavingsConstants.NEW_STATUS_NAME, customerStatusDetail.getStatusName(), request);
        SessionUtils.setAttribute(SavingsConstants.FLAG_NAME, customerStatusDetail.getFlagName(), request);
    } else {
        SessionUtils.setAttribute(SavingsConstants.NEW_STATUS_NAME, null, request);
        SessionUtils.setAttribute(SavingsConstants.FLAG_NAME, null, request);
    }
    Short newStatusId = statusActionForm.getNewStatusIdValue();
    Short customerLevelId = statusActionForm.getLevelIdValue();
    List<CustomerCheckListBO> checklist = new CustomerPersistence().getStatusChecklist(newStatusId, customerLevelId);
    SessionUtils.setCollectionAttribute(SavingsConstants.STATUS_CHECK_LIST, checklist, request);
    if (statusActionForm.getNewStatusIdValue().equals(CustomerStatus.CLIENT_CLOSED.getValue())) {
        return createClientQuestionnaire.fetchAppliedQuestions(mapping, statusActionForm, request, ActionForwards.previewStatus_success);
    }
    return mapping.findForward(ActionForwards.previewStatus_success.toString());
}
Also used : CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) CustomerStatusDetailDto(org.mifos.dto.screen.CustomerStatusDetailDto) EditCustomerStatusActionForm(org.mifos.customers.struts.actionforms.EditCustomerStatusActionForm) CustomerBO(org.mifos.customers.business.CustomerBO) CustomerPersistence(org.mifos.customers.persistence.CustomerPersistence) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

CustomerStatusDetailDto (org.mifos.dto.screen.CustomerStatusDetailDto)11 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)9 ValueListElement (org.mifos.dto.domain.ValueListElement)8 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)5 CustSearchActionForm (org.mifos.customers.struts.actionforms.CustSearchActionForm)4 UserContext (org.mifos.security.util.UserContext)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 ModelAndView (org.springframework.web.servlet.ModelAndView)4 CustomerHierarchyDto (org.mifos.dto.screen.CustomerHierarchyDto)3 MifosUser (org.mifos.security.MifosUser)3 CustomerLevel (org.mifos.customers.api.CustomerLevel)2 CustomerPersistence (org.mifos.customers.persistence.CustomerPersistence)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 OfficeDto (org.mifos.dto.domain.OfficeDto)2 UserDetailDto (org.mifos.dto.domain.UserDetailDto)2 SearchFiltersDto (org.mifos.dto.screen.SearchFiltersDto)2 IncludePage (freemarker.ext.servlet.IncludePage)1 CustomerBO (org.mifos.customers.business.CustomerBO)1 CustomerStatusEntity (org.mifos.customers.business.CustomerStatusEntity)1