| Line 62... |
Line 62... |
| 62 |
print lowestOfferPrice
|
62 |
print lowestOfferPrice
|
| 63 |
print instock
|
63 |
print instock
|
| 64 |
print stock
|
64 |
print stock
|
| 65 |
print "*************"
|
65 |
print "*************"
|
| 66 |
if instock == 1:
|
66 |
if instock == 1:
|
| 67 |
get_mongo_connection().Catalog.MasterData.update({'_id':data['_id']}, {'$set' : {'available_price':lowestOfferPrice,'updatedOn':to_java_date(now),'in_stock':instock}}, multi=True)
|
67 |
get_mongo_connection().Catalog.MasterData.update({'_id':data['_id']}, {'$set' : {'available_price':lowestOfferPrice,'updatedOn':to_java_date(now),'priceUpdatedOn':to_java_date(now),'in_stock':instock}}, multi=True)
|
| 68 |
get_mongo_connection().Catalog.Deals.update({'_id':data['_id']}, {'$set' : {'available_price':lowestOfferPrice , 'in_stock':instock}}, multi=True)
|
68 |
get_mongo_connection().Catalog.Deals.update({'_id':data['_id']}, {'$set' : {'available_price':lowestOfferPrice , 'in_stock':instock}}, multi=True)
|
| 69 |
else:
|
69 |
else:
|
| 70 |
get_mongo_connection().Catalog.MasterData.update({'_id':data['_id']}, {'$set' : {'updatedOn':to_java_date(now),'in_stock':instock}}, multi=True)
|
70 |
get_mongo_connection().Catalog.MasterData.update({'_id':data['_id']}, {'$set' : {'updatedOn':to_java_date(now),'in_stock':instock}}, multi=True)
|
| 71 |
get_mongo_connection().Catalog.Deals.update({'_id':data['_id']}, {'$set' : {'in_stock':instock}}, multi=True)
|
71 |
get_mongo_connection().Catalog.Deals.update({'_id':data['_id']}, {'$set' : {'in_stock':instock}}, multi=True)
|
| 72 |
|
72 |
|
| Line 84... |
Line 84... |
| 84 |
bestPrice = float("inf")
|
84 |
bestPrice = float("inf")
|
| 85 |
bestOne = None
|
85 |
bestOne = None
|
| 86 |
bestSellerPoints = 0
|
86 |
bestSellerPoints = 0
|
| 87 |
toUpdate = []
|
87 |
toUpdate = []
|
| 88 |
for similarItem in similarItems:
|
88 |
for similarItem in similarItems:
|
| 89 |
if similarItem['in_stock'] == 0:
|
89 |
if similarItem['in_stock'] == 0 or similarItem['maxprice'] is None or similarItem['maxprice'] < similarItem['available_price']:
|
| 90 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0 }})
|
90 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0 }})
|
| 91 |
continue
|
91 |
continue
|
| 92 |
if similarItem['available_price'] < bestPrice:
|
92 |
if similarItem['available_price'] < bestPrice:
|
| 93 |
bestOne = similarItem
|
93 |
bestOne = similarItem
|
| 94 |
bestPrice = similarItem['available_price']
|
94 |
bestPrice = similarItem['available_price']
|