Search in sources :

Example 1 with DashboardDto

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

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

the class DashboardServiceFacadeWebTier method getDashboardDto.

@Override
public DashboardDto getDashboardDto() {
    DashboardDto dashboardDto = new DashboardDto();
    Short loanOfficerID = getLoanOfficerId();
    if (loanOfficerID == null) {
        dashboardDto.setBorrowersCount(customerDao.countAllBorrowers());
        dashboardDto.setBorrowersGroupCount(customerDao.countAllBorrowersGroup());
        dashboardDto.setActiveClientsCount(customerDao.countOfActiveClients());
        dashboardDto.setActiveGroupsCount(customerDao.countOfActiveGroups());
        dashboardDto.setActiveCentersCount(customerDao.countOfActiveCenters());
        dashboardDto.setWaitingForApprovalLoansCount(loanDao.countAllLoansWaitingForApproval());
        dashboardDto.setLoansInArrearsCount(loanDao.countAllBadStandingLoans());
        dashboardDto.setLoansToBePaidCurrentWeek(loanDao.countLoansToBePaidCurrentWeek());
    } else {
        dashboardDto.setBorrowersCount(customerDao.countBorrowersUnderLoanOfficer(loanOfficerID));
        dashboardDto.setBorrowersGroupCount(customerDao.countBorrowersGroupUnderLoanOfficer(loanOfficerID));
        dashboardDto.setActiveClientsCount(customerDao.countOfActiveClientsUnderLoanOfficer(loanOfficerID));
        dashboardDto.setActiveGroupsCount(customerDao.countOfActiveGroupsUnderLoanOfficer(loanOfficerID));
        dashboardDto.setActiveCentersCount(customerDao.countOfActiveCentersUnderLoanOfficer(loanOfficerID));
        dashboardDto.setWaitingForApprovalLoansCount(loanDao.countLoansWaitingForApprovalUnderLoanOfficer(loanOfficerID));
        dashboardDto.setLoansInArrearsCount(loanDao.countBadStandingLoansUnderLoanOfficer(loanOfficerID));
        dashboardDto.setLoansToBePaidCurrentWeek(loanDao.countLoansToBePaidCurrentWeekUnderLoanOfficer(loanOfficerID));
    }
    return dashboardDto;
}
Also used : DashboardDto(org.mifos.dto.domain.DashboardDto)

Aggregations

DashboardDto (org.mifos.dto.domain.DashboardDto)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CustSearchActionForm (org.mifos.customers.struts.actionforms.CustSearchActionForm)1 UserDetailDto (org.mifos.dto.domain.UserDetailDto)1 ValueListElement (org.mifos.dto.domain.ValueListElement)1 CustomerStatusDetailDto (org.mifos.dto.screen.CustomerStatusDetailDto)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 UserContext (org.mifos.security.util.UserContext)1