| Line 9... |
Line 9... |
| 9 |
from shop2020.clients.HelperClient import HelperClient
|
9 |
from shop2020.clients.HelperClient import HelperClient
|
| 10 |
from shop2020.clients.InventoryClient import InventoryClient
|
10 |
from shop2020.clients.InventoryClient import InventoryClient
|
| 11 |
from shop2020.config.client.ConfigClient import ConfigClient
|
11 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| 12 |
from shop2020.model.v1.catalog.impl import DataService
|
12 |
from shop2020.model.v1.catalog.impl import DataService
|
| 13 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
13 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
| 14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source
|
14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source, \
|
| - |
|
15 |
to_t_brand_info
|
| 15 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
16 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
| 16 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
17 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
| 17 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster, \
|
18 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster, \
|
| - |
|
19 |
OOSTracker, EntityTag, ItemInsurerMapping, Insurer, Banner, BannerMap, \
|
| - |
|
20 |
FreebieItem, BrandInfo, \
|
| 18 |
OOSTracker,EntityTag,ItemInsurerMapping, Insurer, Banner, BannerMap, FreebieItem,\
|
21 |
OOSTracker,EntityTag,ItemInsurerMapping, Insurer, Banner, BannerMap, FreebieItem,\
|
| 19 |
StorePricing
|
22 |
StorePricing
|
| 20 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
23 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
| 21 |
ItemType, PremiumType, FreebieItem as t_FreebieItem, StorePricing as tStorePricing
|
24 |
ItemType, PremiumType, FreebieItem as t_FreebieItem, StorePricing as tStorePricing
|
| 22 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
25 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
| Line 1460... |
Line 1463... |
| 1460 |
freebie = FreebieItem()
|
1463 |
freebie = FreebieItem()
|
| 1461 |
freebie.itemId = freebieItem.itemId
|
1464 |
freebie.itemId = freebieItem.itemId
|
| 1462 |
freebie.freebieItemId = freebieItem.freebieItemId
|
1465 |
freebie.freebieItemId = freebieItem.freebieItemId
|
| 1463 |
session.commit()
|
1466 |
session.commit()
|
| 1464 |
|
1467 |
|
| - |
|
1468 |
|
| - |
|
1469 |
def add_or_update_brand_info(brandInfo):
|
| - |
|
1470 |
brandinfo = BrandInfo.get_by(name = brandInfo.name)
|
| - |
|
1471 |
if brandinfo is None:
|
| - |
|
1472 |
brandinfo = BrandInfo()
|
| - |
|
1473 |
brandinfo.itemId = brandInfo.itemId
|
| - |
|
1474 |
brandinfo.freebieItemId = brandInfo.freebieItemId
|
| - |
|
1475 |
session.commit()
|
| - |
|
1476 |
|
| - |
|
1477 |
def get_brand_info():
|
| - |
|
1478 |
brandInfoMap = dict()
|
| - |
|
1479 |
brandInfoList = FreebieItem.query.all()
|
| - |
|
1480 |
for brandInfo in brandInfoList:
|
| - |
|
1481 |
brandInfoMap[brandInfo.name] = to_t_brand_info(brandInfo)
|
| - |
|
1482 |
return brandInfoMap
|
| - |
|
1483 |
|
| 1465 |
def update_store_pricing(tsp):
|
1484 |
def update_store_pricing(tsp):
|
| 1466 |
sp = StorePricing.get_by(item_id = tsp.itemId)
|
1485 |
sp = StorePricing.get_by(item_id = tsp.itemId)
|
| 1467 |
if not sp:
|
1486 |
if not sp:
|
| 1468 |
sp = StorePricing()
|
1487 |
sp = StorePricing()
|
| 1469 |
sp.recommendedPrice = tsp.recommendedPrice
|
1488 |
sp.recommendedPrice = tsp.recommendedPrice
|