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);
}
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;
}
Aggregations