Search in sources :

Example 1 with CheckListBusinessService

use of org.mifos.customers.checklist.business.service.CheckListBusinessService in project head by mifos.

the class CheckListServiceFacadeWebTier method retreiveAllCustomerCheckLists.

@Override
public List<CustomerCheckBoxItemDto> retreiveAllCustomerCheckLists() {
    try {
        List<CustomerCheckListBO> customerCheckLists = new CheckListBusinessService().retreiveAllCustomerCheckLists();
        List<CustomerCheckBoxItemDto> dtoList = new ArrayList<CustomerCheckBoxItemDto>();
        for (CustomerCheckListBO bo : customerCheckLists) {
            String lookUpName = bo.getCustomerStatus().getLookUpValue() != null ? bo.getCustomerStatus().getLookUpValue().getLookUpName() : null;
            CustomerCheckBoxItemDto dto = new CustomerCheckBoxItemDto(bo.getChecklistId(), bo.getChecklistName(), bo.getChecklistStatus(), null, lookUpName, bo.getCustomerStatus().getId(), bo.getCustomerLevel().getId());
            if (dto.getLookUpName() != null) {
                dto.setName(ApplicationContextProvider.getBean(MessageLookup.class).lookup(dto.getLookUpName()));
            }
            dtoList.add(dto);
        }
        return dtoList;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) CheckListBusinessService(org.mifos.customers.checklist.business.service.CheckListBusinessService) CustomerCheckBoxItemDto(org.mifos.dto.screen.CustomerCheckBoxItemDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 2 with CheckListBusinessService

use of org.mifos.customers.checklist.business.service.CheckListBusinessService in project head by mifos.

the class CheckListServiceFacadeWebTier method retreiveAllAccountCheckLists.

@Override
public List<AccountCheckBoxItemDto> retreiveAllAccountCheckLists() {
    try {
        List<AccountCheckListBO> accountCheckLists = new CheckListBusinessService().retreiveAllAccountCheckLists();
        List<AccountCheckBoxItemDto> dtoList = new ArrayList<AccountCheckBoxItemDto>();
        for (AccountCheckListBO bo : accountCheckLists) {
            String lookUpName = bo.getAccountStateEntity().getLookUpValue() != null ? bo.getAccountStateEntity().getLookUpValue().getLookUpName() : null;
            AccountCheckBoxItemDto dto = new AccountCheckBoxItemDto(bo.getChecklistId(), bo.getChecklistName(), bo.getChecklistStatus(), null, lookUpName, bo.getAccountStateEntity().getId(), bo.getProductTypeEntity().getProductTypeID());
            if (dto.getLookUpName() != null) {
                dto.setName(ApplicationContextProvider.getBean(MessageLookup.class).lookup(dto.getLookUpName()));
            }
            dtoList.add(dto);
        }
        return dtoList;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : ServiceException(org.mifos.framework.exceptions.ServiceException) AccountCheckBoxItemDto(org.mifos.dto.screen.AccountCheckBoxItemDto) ArrayList(java.util.ArrayList) CheckListBusinessService(org.mifos.customers.checklist.business.service.CheckListBusinessService) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Aggregations

ArrayList (java.util.ArrayList)2 MifosRuntimeException (org.mifos.core.MifosRuntimeException)2 CheckListBusinessService (org.mifos.customers.checklist.business.service.CheckListBusinessService)2 ServiceException (org.mifos.framework.exceptions.ServiceException)2 AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)1 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)1 AccountCheckBoxItemDto (org.mifos.dto.screen.AccountCheckBoxItemDto)1 CustomerCheckBoxItemDto (org.mifos.dto.screen.CustomerCheckBoxItemDto)1