| Line 236... |
Line 236... |
| 236 |
print "continue*****"
|
236 |
print "continue*****"
|
| 237 |
continue
|
237 |
continue
|
| 238 |
cc = computeCourierCost(it.weight)
|
238 |
cc = computeCourierCost(it.weight)
|
| 239 |
if amazonAsinPrice.get(sku) is None:
|
239 |
if amazonAsinPrice.get(sku) is None:
|
| 240 |
asin = None
|
240 |
asin = None
|
| - |
|
241 |
elif amazonAsinPrice.get(sku).asin is None:
|
| 241 |
print "no asin****"
|
242 |
asin = None
|
| - |
|
243 |
else:
|
| - |
|
244 |
asin = amazonAsinPrice.get(sku).asin
|
| - |
|
245 |
|
| 242 |
amazonItemInfo = __AmazonItemInfo(amazonAsinPrice.get(sku).asin, wanlc,cc, sku, it.product_group, it.brand, it.model_name, it.model_number, it.color, it.weight, category.parent_category_id, it.risky, None, runType, parent_category.display_name,sourcePercentage,fbaInventoryItem.availability,state_id)
|
246 |
amazonItemInfo = __AmazonItemInfo(amazonAsinPrice.get(sku).asin, wanlc,cc, sku, it.product_group, it.brand, it.model_name, it.model_number, it.color, it.weight, category.parent_category_id, it.risky, None, runType, parent_category.display_name,sourcePercentage,fbaInventoryItem.availability,state_id)
|
| 243 |
print amazonItemInfo
|
247 |
print amazonItemInfo
|
| 244 |
itemInfo.append(amazonItemInfo)
|
248 |
itemInfo.append(amazonItemInfo)
|
| 245 |
amPromotions = AmazonPromotion.query.filter(AmazonPromotion.startDate<=time).filter(AmazonPromotion.endDate>=time).filter(AmazonPromotion.promotionType==AmazonPromotionType.LONGTERM).filter(AmazonPromotion.promotionActive==True) \
|
249 |
amPromotions = AmazonPromotion.query.filter(AmazonPromotion.startDate<=time).filter(AmazonPromotion.endDate>=time).filter(AmazonPromotion.promotionType==AmazonPromotionType.LONGTERM).filter(AmazonPromotion.promotionActive==True) \
|
| 246 |
.group_by(AmazonPromotion.sku).order_by(desc(AmazonPromotion.addedOn)).all()
|
250 |
.group_by(AmazonPromotion.sku).order_by(desc(AmazonPromotion.addedOn)).all()
|
| Line 252... |
Line 256... |
| 252 |
def decideCategory(itemInfo):
|
256 |
def decideCategory(itemInfo):
|
| 253 |
exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = [],[],[],[],[],[],[]
|
257 |
exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = [],[],[],[],[],[],[]
|
| 254 |
skuUrls = []
|
258 |
skuUrls = []
|
| 255 |
#skuAsinMap = {}
|
259 |
#skuAsinMap = {}
|
| 256 |
for item in itemInfo:
|
260 |
for item in itemInfo:
|
| 257 |
if item.asin is None:
|
261 |
if item.asin is None or len(item.asin)==0:
|
| 258 |
temp = []
|
262 |
temp = []
|
| 259 |
temp.append(item)
|
263 |
temp.append(item)
|
| 260 |
temp.append("Asin not available")
|
264 |
temp.append("Asin not available")
|
| 261 |
exceptionList.append(temp)
|
265 |
exceptionList.append(temp)
|
| 262 |
continue
|
266 |
continue
|
| Line 267... |
Line 271... |
| 267 |
# for sku in skuList:
|
271 |
# for sku in skuList:
|
| 268 |
# amDetails = __AmazonDetails(None, None, None, None, None,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp)
|
272 |
# amDetails = __AmazonDetails(None, None, None, None, None,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp)
|
| 269 |
# for info in scrapInfo:
|
273 |
# for info in scrapInfo:
|
| 270 |
catalog_client = CatalogClient().get_client()
|
274 |
catalog_client = CatalogClient().get_client()
|
| 271 |
for val in itemInfo:
|
275 |
for val in itemInfo:
|
| 272 |
if val.asin is None:
|
276 |
if val.asin is None or len(val.asin)==0:
|
| 273 |
continue
|
277 |
continue
|
| 274 |
scrapInfo = aggResponse.get(val.asin)
|
278 |
scrapInfo = aggResponse.get(val.asin)
|
| 275 |
if val.sku in amazonLongTermActivePromotions:
|
279 |
if val.sku in amazonLongTermActivePromotions:
|
| 276 |
print "Sku in promotion, will handle it later.Moving to other..."
|
280 |
print "Sku in promotion, will handle it later.Moving to other..."
|
| 277 |
continue
|
281 |
continue
|