Subversion Repositories SmartDukaan

Rev

Rev 5384 | Rev 5460 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5384 Rev 5427
Line 234... Line 234...
234
    public Item getItem(long itemId){
234
    public Item getItem(long itemId){
235
        try{
235
        try{
236
            CatalogClient catalogServiceClient = new CatalogClient();
236
            CatalogClient catalogServiceClient = new CatalogClient();
237
            InventoryService.Client catalogClient = catalogServiceClient.getClient();
237
            InventoryService.Client catalogClient = catalogServiceClient.getClient();
238
            in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
238
            in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
-
 
239
            Long catalogItemId = thriftItem.getCatalogItemId();
-
 
240
            List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getItemsByCatalogId(catalogItemId);
-
 
241
            List <Long> sameItemsWithDifferentColors = new ArrayList<Long>();
-
 
242
            if(thriftItems.size()>1){
-
 
243
	            for(in.shop2020.model.v1.catalog.Item tItem : thriftItems ){
-
 
244
	            	Long id = tItem.getId();
-
 
245
		        	if(!id.equals(itemId)){
-
 
246
		        		sameItemsWithDifferentColors.add(id); 
239
 
247
		        	}
-
 
248
	            }
-
 
249
            }
240
            List<in.shop2020.model.v1.catalog.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
250
            List<in.shop2020.model.v1.catalog.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
241
            List<in.shop2020.model.v1.catalog.VendorItemMapping> vim = catalogClient.getVendorItemMappings(thriftItem.getId());
251
            List<in.shop2020.model.v1.catalog.VendorItemMapping> vim = catalogClient.getVendorItemMappings(thriftItem.getId());
242
            List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
252
            List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
243
            List<in.shop2020.model.v1.catalog.Item> sit = catalogClient.getAllSimilarItems(thriftItem.getId());
253
            List<in.shop2020.model.v1.catalog.Item> sit = catalogClient.getAllSimilarItems(thriftItem.getId());
244
            in.shop2020.model.v1.catalog.ItemInventory itemInventory = catalogClient.getItemInventoryByItemId(thriftItem.getId());
254
            in.shop2020.model.v1.catalog.ItemInventory itemInventory = catalogClient.getItemInventoryByItemId(thriftItem.getId());
245
            return getItemFromThriftItem(thriftItem, vip, vim, sip, sit, itemInventory);
255
            Item it = getItemFromThriftItem(thriftItem, vip, vim, sip, sit, itemInventory);
-
 
256
            it.setSameItemsWithDifferentColors(sameItemsWithDifferentColors);
-
 
257
            return it;
246
        }catch(Exception e){
258
        }catch(Exception e){
247
            logger.error("Error while getting the item from the catalog service", e);
259
            logger.error("Error while getting the item from the catalog service", e);
248
        }
260
        }
249
        return null;
261
        return null;
250
    }
262
    }
Line 1061... Line 1073...
1061
        } catch (Exception e) {
1073
        } catch (Exception e) {
1062
            logger.error("Error while getting all the categories: ", e);
1074
            logger.error("Error while getting all the categories: ", e);
1063
        }
1075
        }
1064
        return brandsList;
1076
        return brandsList;
1065
	}
1077
	}
-
 
1078
 
1066
}
1079
}
1067
1080