| Line 11... |
Line 11... |
| 11 |
from shop2020.model.v1.catalog.impl import DataService
|
11 |
from shop2020.model.v1.catalog.impl import DataService
|
| 12 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
12 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
| 13 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, \
|
13 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, \
|
| 14 |
to_t_vendor_item_pricing, to_t_source
|
14 |
to_t_vendor_item_pricing, to_t_source
|
| 15 |
from shop2020.model.v1.catalog.impl.DataService import Item, Warehouse, \
|
15 |
from shop2020.model.v1.catalog.impl.DataService import Item, Warehouse, \
|
| 16 |
ItemInventoryHistory, CurrentInventorySnapshot, ItemInfo, ItemChangeLog, \
|
16 |
ItemInventoryHistory, CurrentInventorySnapshot, ItemChangeLog, \
|
| 17 |
Category, EntityIDGenerator, VendorItemPricing, VendorItemMapping, Vendor, \
|
17 |
Category, EntityIDGenerator, VendorItemPricing, VendorItemMapping, Vendor, \
|
| 18 |
SimilarItems, ProductNotification, Source, SourceItemPricing, AuthorizationLog, \
|
18 |
SimilarItems, ProductNotification, Source, SourceItemPricing, AuthorizationLog, \
|
| 19 |
MissedInventoryUpdate, BadInventorySnapshot, VendorItemProcurementDelay, \
|
19 |
MissedInventoryUpdate, BadInventorySnapshot, VendorItemProcurementDelay, \
|
| 20 |
VendorHolidays
|
20 |
VendorHolidays
|
| 21 |
from shop2020.thriftpy.model.v1.catalog.ttypes import InventoryServiceException, \
|
21 |
from shop2020.thriftpy.model.v1.catalog.ttypes import InventoryServiceException, \
|
| Line 1834... |
Line 1834... |
| 1834 |
|
1834 |
|
| 1835 |
shippingLocations = []
|
1835 |
shippingLocations = []
|
| 1836 |
for shippingLocationId in shippingLocationIds:
|
1836 |
for shippingLocationId in shippingLocationIds:
|
| 1837 |
shippingLocations.append(get_Warehouse(shippingLocationId))
|
1837 |
shippingLocations.append(get_Warehouse(shippingLocationId))
|
| 1838 |
|
1838 |
|
| 1839 |
return shippingLocations
|
- |
|
| 1840 |
|
1839 |
return shippingLocations
|
| - |
|
1840 |
|
| - |
|
1841 |
def get_inventory_snapshot(warehouseId):
|
| - |
|
1842 |
query = CurrentInventorySnapshot.query
|
| - |
|
1843 |
|
| - |
|
1844 |
if warehouseId:
|
| - |
|
1845 |
query = query.filter_by(warehouse_id = warehouseId)
|
| - |
|
1846 |
|
| - |
|
1847 |
itemInventoryMap = {}
|
| - |
|
1848 |
for row in query.all():
|
| - |
|
1849 |
if not itemInventoryMap.has_key(row.item_id):
|
| - |
|
1850 |
itemInventoryMap[row.item_id] = []
|
| - |
|
1851 |
|
| - |
|
1852 |
itemInventoryMap[row.item_id].append(row)
|
| - |
|
1853 |
|
| - |
|
1854 |
return itemInventoryMap
|
| - |
|
1855 |
|