Subversion Repositories SmartDukaan

Rev

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

Rev 21863 Rev 22566
Line 26... Line 26...
26
    MarketPlaceUpdateHistory, SourceCategoryPercentage, MarketPlaceHistory, \
26
    MarketPlaceUpdateHistory, SourceCategoryPercentage, MarketPlaceHistory, \
27
    PrivateDeals, AmazonOutOfSync, PrivateDealsPriceComparison, \
27
    PrivateDeals, AmazonOutOfSync, PrivateDealsPriceComparison, \
28
    SourceReturnPercentage, CompetitorPricing, CompetitorPricingRequest, \
28
    SourceReturnPercentage, CompetitorPricing, CompetitorPricingRequest, \
29
    AmazonPromotion, ExclusiveAffiliateItemInfo, OutboundAffiliateMaster, HsItem, \
29
    AmazonPromotion, ExclusiveAffiliateItemInfo, OutboundAffiliateMaster, HsItem, \
30
    BulkItemPricing, ItemWarrantyInfo, CategoryWarrantyInfo, StateGstMaster, \
30
    BulkItemPricing, ItemWarrantyInfo, CategoryWarrantyInfo, StateGstMaster, \
31
    CentralGstMaster, CategoryHsnCodes
31
    CentralGstMaster, CategoryHsnCodes, Tag_Listing
32
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
32
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
33
    ItemType, PremiumType, FreebieItem as t_FreebieItem, \
33
    ItemType, PremiumType, FreebieItem as t_FreebieItem, \
34
    StorePricing as tStorePricing, CatalogServiceException, BannerType, InsurerType, \
34
    StorePricing as tStorePricing, CatalogServiceException, BannerType, InsurerType, \
35
    Banner as t_banner, CompetitorPricing as TCompetitorPricing, AmazonPromotionType, \
35
    Banner as t_banner, CompetitorPricing as TCompetitorPricing, AmazonPromotionType, \
36
    ItemCondition, StateGstRates, GstRate
36
    ItemCondition, StateGstRates, GstRate
Line 3489... Line 3489...
3489
    for itemId in itemIds:
3489
    for itemId in itemIds:
3490
        itemWarrantyMap[itemId] = get_warranty_info_for_item(itemId, itemCondition)
3490
        itemWarrantyMap[itemId] = get_warranty_info_for_item(itemId, itemCondition)
3491
        
3491
        
3492
    return itemWarrantyMap
3492
    return itemWarrantyMap
3493
 
3493
 
-
 
3494
def get_all_fofo_deals(itemIds, tagIds):
-
 
3495
    returnMap = {}
-
 
3496
    tagListings = session.query(Tag_Listing).join((Item, Item.id==Tag_Listing.item_id)).filter(or_(Item.status==status.ACTIVE).filter(Tag_Listing.active==True).filter(Item.id.in_(itemIds))).filter(Tag_Listing.tag_id.in_(tagIds)).all()
-
 
3497
    for tagListing in tagListings:
-
 
3498
        if returnMap.has_key(tagListing.item_id):
-
 
3499
            if tagListing.selling_price > returnMap.get(tagListing.item_id):
-
 
3500
                returnMap[tagListing.item_id] = tagListing.selling_price
-
 
3501
        else:
-
 
3502
            returnMap[tagListing.item_id] = tagListing.selling_price
-
 
3503
    return returnMap
-
 
3504
             
-
 
3505
 
3494
if __name__=='__main__':
3506
if __name__=='__main__':
3495
    DataService.initialize()
3507
    DataService.initialize()
3496
    #update_bulk_prices_on_production(21053,[])
3508
    #update_bulk_prices_on_production(21053,[])
3497
    search_terms = ["12206"]
3509
    search_terms = ["12206"]
3498
    print search_items(search_terms, 0, 20)
3510
    print search_items(search_terms, 0, 20)