| Line 89... |
Line 89... |
| 89 |
print in_stock
|
89 |
print in_stock
|
| 90 |
print available_price
|
90 |
print available_price
|
| 91 |
print dealsMap.get(d_item.id)
|
91 |
print dealsMap.get(d_item.id)
|
| 92 |
print "++++++++++++++++++++++++++"
|
92 |
print "++++++++++++++++++++++++++"
|
| 93 |
if available_price > 0 or available_price is not None:
|
93 |
if available_price > 0 or available_price is not None:
|
| 94 |
get_mongo_connection().Catalog.MasterData.update({'_id':saholicCatalogId['_id']}, {'$set' : {'available_price':available_price,'updatedOn':to_java_date(timestamp),'in_stock':in_stock}}, multi=True)
|
94 |
get_mongo_connection().Catalog.MasterData.update({'_id':saholicCatalogId['_id']}, {'$set' : {'available_price':available_price,'updatedOn':to_java_date(timestamp),'priceUpdatedOn':to_java_date(timestamp),'in_stock':in_stock}}, multi=True)
|
| 95 |
get_mongo_connection().Catalog.Deals.update({'_id':saholicCatalogId['_id']}, {'$set' : {'available_price':available_price , 'in_stock':in_stock}}, multi=True)
|
95 |
get_mongo_connection().Catalog.Deals.update({'_id':saholicCatalogId['_id']}, {'$set' : {'available_price':available_price , 'in_stock':in_stock}}, multi=True)
|
| 96 |
else:
|
96 |
else:
|
| 97 |
get_mongo_connection().Catalog.MasterData.update({'_id':saholicCatalogId['_id']}, {'$set' : {'updatedOn':to_java_date(timestamp),'in_stock':in_stock}}, multi=True)
|
97 |
get_mongo_connection().Catalog.MasterData.update({'_id':saholicCatalogId['_id']}, {'$set' : {'updatedOn':to_java_date(timestamp),'in_stock':in_stock}}, multi=True)
|
| 98 |
get_mongo_connection().Catalog.Deals.update({'_id':saholicCatalogId['_id']}, {'$set' : {'in_stock':in_stock}}, multi=True)
|
98 |
get_mongo_connection().Catalog.Deals.update({'_id':saholicCatalogId['_id']}, {'$set' : {'in_stock':in_stock}}, multi=True)
|
| 99 |
|
99 |
|
| Line 110... |
Line 110... |
| 110 |
bestPrice = float("inf")
|
110 |
bestPrice = float("inf")
|
| 111 |
bestOne = None
|
111 |
bestOne = None
|
| 112 |
bestSellerPoints = 0
|
112 |
bestSellerPoints = 0
|
| 113 |
toUpdate = []
|
113 |
toUpdate = []
|
| 114 |
for similarItem in similarItems:
|
114 |
for similarItem in similarItems:
|
| 115 |
if similarItem['in_stock'] == 0:
|
115 |
if similarItem['in_stock'] == 0 or similarItem['maxprice'] is None or similarItem['maxprice'] < similarItem['available_price']:
|
| 116 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0 }})
|
116 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0 }})
|
| 117 |
continue
|
117 |
continue
|
| 118 |
if similarItem['available_price'] < bestPrice:
|
118 |
if similarItem['available_price'] < bestPrice:
|
| 119 |
bestOne = similarItem
|
119 |
bestOne = similarItem
|
| 120 |
bestPrice = similarItem['available_price']
|
120 |
bestPrice = similarItem['available_price']
|