ResultList<Product> result = coreManager.searchProductWithStock(supplierId, null, null, null, false, storeId, stockMode, start, end);
List<DisplayProductWithStock> displayProductList = new ArrayList<DisplayProductWithStock>();
for (Product product : result) {
DisplayProductWithStock disp = mapper.map(product, DisplayProductWithStock.class);
if(product.getStock().size() > 0){
disp.setStock(mapper.map(product.getStock().iterator().next(), DisplayStock.class));
}
displayProductList.add(disp);
}
displayResultList = new ResultList<DisplayProductWithStock>(displayProductList);