Subversion Repositories SmartDukaan

Rev

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

Rev 4779 Rev 5110
Line 1... Line 1...
1
package in.shop2020.hotspot.dashbaord.server;
1
package in.shop2020.hotspot.dashbaord.server;
2
 
2
 
3
import in.shop2020.hotspot.dashbaord.shared.actions.Item;
3
import in.shop2020.hotspot.dashbaord.shared.actions.Item;
4
import in.shop2020.model.v1.catalog.InventoryService;
4
import in.shop2020.model.v1.catalog.InventoryService;
-
 
5
import in.shop2020.model.v1.catalog.InventoryType;
5
import in.shop2020.model.v1.catalog.Vendor;
6
import in.shop2020.model.v1.catalog.Warehouse;
6
import in.shop2020.thrift.clients.CatalogClient;
7
import in.shop2020.thrift.clients.CatalogClient;
7
 
8
 
8
import java.util.ArrayList;
9
import java.util.ArrayList;
9
import java.util.HashMap;
10
import java.util.HashMap;
10
import java.util.List;
11
import java.util.List;
Line 110... Line 111...
110
			e.printStackTrace();
111
			e.printStackTrace();
111
		}
112
		}
112
	}
113
	}
113
	
114
	
114
	
115
	
115
	public static Map<Long, String> getVendorsForWarehouse(long warehouseId){
116
	public static Map<Long, String> getWarehousesForBillingWarehouse(long warehouseId){
116
		try{
117
		try{
117
			CatalogClient catalogServiceClient = new CatalogClient();
118
			CatalogClient catalogServiceClient = new CatalogClient();
118
			InventoryService.Client catalogClient = catalogServiceClient.getClient();
119
			InventoryService.Client catalogClient = catalogServiceClient.getClient();
119
			List<Vendor> vendors = catalogClient.getVendorsForWarehouse(warehouseId);
120
			List<Warehouse> warehouses = catalogClient.getWarehouses(null, InventoryType.GOOD, 0, warehouseId, 0);
120
			Map<Long, String> vendorMapping = new HashMap<Long, String>();
121
			Map<Long, String> warehouseMap = new HashMap<Long, String>();
121
			for(Vendor vendor: vendors){
122
			for(Warehouse warehouse: warehouses){
122
				vendorMapping.put(vendor.getId(), vendor.getName());
123
				warehouseMap.put(warehouse.getId(), warehouse.getDisplayName());
123
			}
124
			}
124
			return vendorMapping;
125
			return warehouseMap;
125
		}catch(Exception e){
126
		}catch(Exception e){
126
			// TODO: Oops! We couldn't reduce the item reservation count. This will
127
			// TODO: Oops! We couldn't reduce the item reservation count. This will
127
			// result in underestimation of inventory stock. Should be corrected
128
			// result in underestimation of inventory stock. Should be corrected
128
			// periodically.
129
			// periodically.
129
			e.printStackTrace();
130
			e.printStackTrace();