Subversion Repositories SmartDukaan

Rev

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

Rev 12363 Rev 12567
Line 9... Line 9...
9
    to_t_banner_map, to_t_product_notification_request_count, \
9
    to_t_banner_map, to_t_product_notification_request_count, \
10
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
10
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
11
    to_t_uri_mapping, to_t_banner_list, to_t_campaign, to_t_snapdeal_item, \
11
    to_t_uri_mapping, to_t_banner_list, to_t_campaign, to_t_snapdeal_item, \
12
    to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, \
12
    to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, \
13
    to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
13
    to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
14
    to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal,to_t_amazonoutofsync, \
14
    to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal, \
-
 
15
    to_t_amazonoutofsync, to_t_private_deals_comparison, \
15
    to_t_private_deals_comparison, to_t_snapdeal_marketplace_item,to_t_flipkart_marketplace_item,to_t_competitor_pricing, \
16
    to_t_snapdeal_marketplace_item, to_t_flipkart_marketplace_item, \
16
    to_t_amazon_promotion, to_t_Amazonlisted_promo
17
    to_t_competitor_pricing, to_t_amazon_promotion, to_t_Amazonlisted_promo
17
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
18
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
18
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
19
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
19
    update_item, start_item_on, close_session, retire_item_on, \
20
    update_item, start_item_on, close_session, retire_item_on, \
20
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
21
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
21
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
22
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
Line 69... Line 70...
69
    get_flipkart_item_by_sku_at_flipkart, get_marketplace_history, \
70
    get_flipkart_item_by_sku_at_flipkart, get_marketplace_history, \
70
    get_all_fbb_listed_items, get_count_for_marketplaceHistory, \
71
    get_all_fbb_listed_items, get_count_for_marketplaceHistory, \
71
    get_marketplace_history_by_date, get_all_fbb_pricing_items, \
72
    get_marketplace_history_by_date, get_all_fbb_pricing_items, \
72
    get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
73
    get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
73
    get_all_active_private_deals, get_private_deals_catalog_ids, \
74
    get_all_active_private_deals, get_private_deals_catalog_ids, \
74
    get_private_deals_count,get_amazon_out_of_sync,get_all_private_deals_comparison, \
75
    get_private_deals_count, get_amazon_out_of_sync, \
-
 
76
    get_all_private_deals_comparison, get_all_snapdeal_marketplaceItem, \
75
    get_all_snapdeal_marketplaceItem,get_all_flipkart_marketplaceItem, add_competitor_scraping, get_previous_competitor_scraping, \
77
    get_all_flipkart_marketplaceItem, add_competitor_scraping, \
-
 
78
    get_previous_competitor_scraping, get_upload_result_by_id, add_amazon_promotion, \
76
    get_upload_result_by_id, add_amazon_promotion, get_amazon_promotion, update_amazon_promotion
79
    get_amazon_promotion, update_amazon_promotion, get_vat_rates, \
-
 
80
    update_item_state_vat, mark_partially_active
77
from shop2020.thriftpy.model.v1.catalog.ttypes import status
81
from shop2020.thriftpy.model.v1.catalog.ttypes import status
78
from shop2020.utils.Utils import log_entry, to_py_date
82
from shop2020.utils.Utils import log_entry, to_py_date
79
import datetime
83
import datetime
80
 
84
 
81
class CatalogServiceHandler:
85
class CatalogServiceHandler:
Line 1645... Line 1649...
1645
    def updateAmazonPromotion(self,amazonPromotions):
1649
    def updateAmazonPromotion(self,amazonPromotions):
1646
        try:
1650
        try:
1647
            update_amazon_promotion(amazonPromotions)
1651
            update_amazon_promotion(amazonPromotions)
1648
        finally:
1652
        finally:
1649
            close_session()
1653
            close_session()
1650
                
1654
            
-
 
1655
    def getVatRates(self,itemId, categoryId):
-
 
1656
        try:
-
 
1657
            return get_vat_rates(itemId, categoryId)
-
 
1658
        finally:
-
 
1659
            close_session()
-
 
1660
            
-
 
1661
    def updateItemStateVat(self, itemId, stateVat):
-
 
1662
        try:
-
 
1663
            return update_item_state_vat(itemId, stateVat)
-
 
1664
        except:
-
 
1665
            return False
-
 
1666
        finally:
-
 
1667
            close_session()
-
 
1668
            
-
 
1669
    def markPartiallyActive(self, itemId, categoryId):
-
 
1670
        try:
-
 
1671
            mark_partially_active(itemId, categoryId)
-
 
1672
        finally:
-
 
1673
            close_session()
-
 
1674
            return False
-
 
1675
            
1651
    
1676
    
1652
if __name__ == '__main__':
1677
if __name__ == '__main__':
1653
    items = get_all_alive_items()
1678
    items = get_all_alive_items()
1654
    ret_items = []
1679
    ret_items = []
1655
    for item in items:
1680
    for item in items: