Rev 585 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package in.shop2020.hotspot.dashbaord.server;import in.shop2020.hotspot.dashbaord.shared.actions.Item;import in.shop2020.model.v1.catalog.InventoryService;import in.shop2020.thrift.clients.CatalogServiceClient;import java.util.ArrayList;import java.util.List;public class CatalogUtils {public static List<Item> getAllItems(){List<Item> itemList = new ArrayList<Item>();try {CatalogServiceClient catalogServiceClient = new CatalogServiceClient();InventoryService.Client catalogClient = catalogServiceClient.getClient();List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllItems(true);for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems){Item item = new Item(thriftItem.getId(), thriftItem.getManufacturerName(), thriftItem.getModelNumber(),thriftItem.getModelName(), thriftItem.getCategory(), thriftItem.getComments(),thriftItem.getCatalogItemId(), thriftItem.getVendorItemId(), thriftItem.getFeatureId(),thriftItem.getFeatureDescription(),//thriftItem.getItemInventory(),thriftItem.getMrp(),thriftItem.getMop(), thriftItem.getSellingPrice(), thriftItem.getWeight(), thriftItem.getAddedOn(),thriftItem.getStartDate(), thriftItem.getRetireDate(),//thriftItem.getItemStatus(),thriftItem.getOtherInfo());itemList.add(item);}} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}return itemList;}}