Search in sources :

Example 1 with ProductCategoryTypeDto

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

the class DefineProductCategoryPreviewController method getProductCategoryTypes.

private Map<String, String> getProductCategoryTypes() {
    String pType = "";
    Map<String, String> categoryTypes = new LinkedHashMap<String, String>();
    for (ProductCategoryTypeDto productCategoryTypeDto : this.adminServiceFacade.retrieveProductCategoryTypes()) {
        if (!pType.equals(productCategoryTypeDto.getProductName())) {
            categoryTypes.put(productCategoryTypeDto.getProductTypeID().toString(), productCategoryTypeDto.getProductName());
        }
        pType = productCategoryTypeDto.getProductName();
    }
    return categoryTypes;
}
Also used : ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) LinkedHashMap(java.util.LinkedHashMap)

Example 2 with ProductCategoryTypeDto

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

the class DefineProductCategoryController method getProductCategoryTypes.

public Map<String, String> getProductCategoryTypes() {
    String pType = "";
    Map<String, String> categoryTypes = new LinkedHashMap<String, String>();
    for (ProductCategoryTypeDto productCategoryTypeDto : this.adminServiceFacade.retrieveProductCategoryTypes()) {
        if (!pType.equals(productCategoryTypeDto.getProductName())) {
            categoryTypes.put(productCategoryTypeDto.getProductTypeID().toString(), productCategoryTypeDto.getProductName());
        }
        pType = productCategoryTypeDto.getProductName();
    }
    return categoryTypes;
}
Also used : ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) LinkedHashMap(java.util.LinkedHashMap)

Example 3 with ProductCategoryTypeDto

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

the class AdminServiceFacadeWebTier method retrieveAllProductMix.

@Override
public ProductDto retrieveAllProductMix() {
    try {
        List<ProductCategoryBO> productCategoryList = new ProductCategoryBusinessService().getAllCategories();
        List<PrdOfferingBO> prdOfferingList = new ProductMixBusinessService().getPrdOfferingMix();
        List<ProductCategoryTypeDto> pcList = new ArrayList<ProductCategoryTypeDto>();
        for (ProductCategoryBO pcBO : productCategoryList) {
            ProductCategoryTypeDto pcDto = new ProductCategoryTypeDto(pcBO.getProductType().getProductTypeID(), pcBO.getProductType().getLookUpValue().getLookUpName());
            pcList.add(pcDto);
        }
        List<ProductMixDto> pmList = new ArrayList<ProductMixDto>();
        for (PrdOfferingBO poBO : prdOfferingList) {
            ProductMixDto pmDto = new ProductMixDto(poBO.getPrdCategory().getProductType().getProductTypeID(), poBO.getPrdOfferingId(), poBO.getPrdType().getProductTypeID(), poBO.getPrdOfferingName());
            pmList.add(pmDto);
        }
        ProductDto productDto = new ProductDto(pcList, pmList);
        return productDto;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : ProductCategoryBO(org.mifos.accounts.productdefinition.business.ProductCategoryBO) ProductMixBusinessService(org.mifos.accounts.productsmix.business.service.ProductMixBusinessService) ArrayList(java.util.ArrayList) ProductMixDto(org.mifos.dto.screen.ProductMixDto) ProductCategoryBusinessService(org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) PrdOfferingBO(org.mifos.accounts.productdefinition.business.PrdOfferingBO) ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) ProductDto(org.mifos.dto.screen.ProductDto) SavingsProductDto(org.mifos.dto.domain.SavingsProductDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 4 with ProductCategoryTypeDto

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

the class AdminServiceFacadeWebTier method retrieveAllProductCategories.

@Override
public ProductCategoryDisplayDto retrieveAllProductCategories() {
    try {
        List<ProductCategoryBO> productCategoryList = new ProductCategoryBusinessService().getAllCategories();
        List<ProductCategoryTypeDto> pcTypeList = new ArrayList<ProductCategoryTypeDto>();
        List<ProductCategoryDto> pcList = new ArrayList<ProductCategoryDto>();
        for (ProductCategoryBO pcBO : productCategoryList) {
            ProductCategoryTypeDto pcTypeDto = new ProductCategoryTypeDto(pcBO.getProductType().getProductTypeID(), pcBO.getProductType().getLookUpValue().getLookUpName());
            pcTypeList.add(pcTypeDto);
            ProductCategoryDto pcDto = new ProductCategoryDto(pcBO.getProductCategoryName(), pcBO.getPrdCategoryStatus().getId(), pcBO.getGlobalPrdCategoryNum());
            pcList.add(pcDto);
        }
        ProductCategoryDisplayDto productCategoryDisplayDto = new ProductCategoryDisplayDto(pcTypeList, pcList);
        return productCategoryDisplayDto;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : ProductCategoryDisplayDto(org.mifos.dto.screen.ProductCategoryDisplayDto) ServiceException(org.mifos.framework.exceptions.ServiceException) ProductCategoryBO(org.mifos.accounts.productdefinition.business.ProductCategoryBO) ArrayList(java.util.ArrayList) ProductCategoryDto(org.mifos.dto.screen.ProductCategoryDto) ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) ProductCategoryBusinessService(org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 5 with ProductCategoryTypeDto

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

the class AdminServiceFacadeWebTier method retrieveProductCategoryTypes.

@Override
public List<ProductCategoryTypeDto> retrieveProductCategoryTypes() {
    try {
        List<ProductTypeEntity> productCategoryList = new ProductCategoryBusinessService().getProductTypes();
        List<ProductCategoryTypeDto> productCategoryTypeDtoList = new ArrayList<ProductCategoryTypeDto>();
        for (ProductTypeEntity productType : productCategoryList) {
            ProductCategoryTypeDto productCategoryTypeDto = new ProductCategoryTypeDto(productType.getProductTypeID(), productType.getLookUpValue().getLookUpName());
            productCategoryTypeDtoList.add(productCategoryTypeDto);
        }
        return productCategoryTypeDtoList;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) ProductCategoryBusinessService(org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService) ProductTypeEntity(org.mifos.accounts.productdefinition.business.ProductTypeEntity) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Aggregations

ProductCategoryTypeDto (org.mifos.dto.screen.ProductCategoryTypeDto)6 ArrayList (java.util.ArrayList)3 ProductCategoryBusinessService (org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService)3 MifosRuntimeException (org.mifos.core.MifosRuntimeException)3 ServiceException (org.mifos.framework.exceptions.ServiceException)3 LinkedHashMap (java.util.LinkedHashMap)2 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)2 PrdOfferingBO (org.mifos.accounts.productdefinition.business.PrdOfferingBO)1 ProductTypeEntity (org.mifos.accounts.productdefinition.business.ProductTypeEntity)1 ProductMixBusinessService (org.mifos.accounts.productsmix.business.service.ProductMixBusinessService)1 SavingsProductDto (org.mifos.dto.domain.SavingsProductDto)1 ProductCategoryDetailsDto (org.mifos.dto.screen.ProductCategoryDetailsDto)1 ProductCategoryDisplayDto (org.mifos.dto.screen.ProductCategoryDisplayDto)1 ProductCategoryDto (org.mifos.dto.screen.ProductCategoryDto)1 ProductDto (org.mifos.dto.screen.ProductDto)1 ProductMixDto (org.mifos.dto.screen.ProductMixDto)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1