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);
}
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());
}
use of org.mifos.dto.screen.CustomerStatusDetailDto in project head by mifos.
the class HomePageController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("customerSearch")
public ModelAndView showPopulatedForm(HttpServletRequest request, HttpServletResponse response, @ModelAttribute("customerSearch") CustomerSearchFormBean customerSearchFormBean) throws MifosException, PersistenceException {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "home", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
Short userId = (short) user.getUserId();
UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userId);
modelAndView.addObject("customerSearch", customerSearchFormBean);
boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
if (sitePreferenceHelper.isMobile(request)) {
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
modelAndView.addObject("availibleClientGenders", availibleClientGenders);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
modelAndView.addObject("availibleCustomerStates", customerStates);
}
if (userDetails.isLoanOfficer()) {
loadLoanOfficerCustomersHierarchyForSelectedDay(userId, modelAndView, customerSearchFormBean);
modelAndView.addObject("isLoanOfficer", true);
} else {
modelAndView.addObject("isLoanOfficer", false);
}
return modelAndView;
}
use of org.mifos.dto.screen.CustomerStatusDetailDto in project head by mifos.
the class SearchResultController method getSearchResultAjaxData.
@RequestMapping(value = "/searchResultAjaxData", method = RequestMethod.GET)
public ModelAndView getSearchResultAjaxData(HttpServletResponse response, @ModelAttribute("customerSearch") CustomerSearchFormBean customerSearchFormBean, @RequestParam(required = false) String sEcho, @RequestParam Integer iDisplayStart, @RequestParam Integer iDisplayLength) throws PersistenceException {
ModelAndView modelAndView = new ModelAndView("searchResultAjaxData");
CustomerHierarchyDto customerHierarchyDto = new CustomerHierarchyDto();
boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
modelAndView.addObject("availibleCustomerStates", customerStates);
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
modelAndView.addObject("availibleClientGenders", availibleClientGenders);
if (customerSearchFormBean.getSearchString() != null && !customerSearchFormBean.getSearchString().isEmpty()) {
customerHierarchyDto = customerSearchServiceFacade.search(customerSearchFormBean.getSearchString(), customerSearchFormBean.getOfficeId(), iDisplayStart, iDisplayLength, customerSearchFormBean.getFilters());
}
if (sEcho != null) {
modelAndView.addObject("sEcho", sEcho);
}
modelAndView.addObject("customerHierarchy", customerHierarchyDto);
modelAndView.addObject("iDisplayStart", iDisplayStart);
modelAndView.addObject("iDisplayLength", iDisplayLength);
return modelAndView;
}
use of org.mifos.dto.screen.CustomerStatusDetailDto in project head by mifos.
the class SearchResultController method legacyShowSearchResults.
@RequestMapping(value = "/legacySearchResult", method = { RequestMethod.POST, RequestMethod.GET })
public ModelAndView legacyShowSearchResults(HttpServletRequest request, @ModelAttribute("customerSearch") @Valid CustomerSearchFormBean customerSearchFormBean, BindingResult result) throws PersistenceException {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "legacySearchResult", request);
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
CustomerHierarchyDto customerHierarchyDto = null;
List<OfficeDto> officeDtoList = officeServiceFacade.retrieveActiveBranchesUnderUser((short) user.getUserId());
Map<String, String> officesMap = new HashMap<String, String>();
for (OfficeDto officeDto : officeDtoList) {
officesMap.put(officeDto.getId().toString(), officeDto.getName());
}
customerSearchFormBean.setOffices(officesMap);
boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
modelAndView.addObject("availibleCustomerStates", customerStates);
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
modelAndView.addObject("availibleClientGenders", availibleClientGenders);
if (result.hasErrors()) {
return modelAndView;
}
int currentPage = 0;
if (request.getParameter("currentPage") != null) {
currentPage = new Integer(request.getParameter("currentPage")).intValue();
}
modelAndView.addObject("customerSearch", customerSearchFormBean);
if (customerSearchFormBean.getFilters() == null) {
customerSearchFormBean.setFilters(new SearchFiltersDto());
}
customerHierarchyDto = customerSearchServiceFacade.search(customerSearchFormBean.getSearchString(), customerSearchFormBean.getOfficeId(), currentPage * PAGE_SIZE, PAGE_SIZE, customerSearchFormBean.getFilters());
boolean prevPageAvailable = false;
if (currentPage > 0) {
prevPageAvailable = true;
}
boolean nextPageAvailable = false;
if (customerHierarchyDto.getSize() / PAGE_SIZE > 0 && customerHierarchyDto.getSize() / PAGE_SIZE >= currentPage + 1) {
nextPageAvailable = true;
}
modelAndView.addObject("isPrevPageAvailable", prevPageAvailable);
modelAndView.addObject("isNextPageAvailable", nextPageAvailable);
modelAndView.addObject("currentPage", currentPage);
modelAndView.addObject("pageSize", PAGE_SIZE);
modelAndView.addObject("customerHierarchy", customerHierarchyDto);
return modelAndView;
}
Aggregations