| Line 104... |
Line 104... |
| 104 |
skuIds = __getBundledSkusfromSku(data['sku'])
|
104 |
skuIds = __getBundledSkusfromSku(data['sku'])
|
| 105 |
for sku in skuIds:
|
105 |
for sku in skuIds:
|
| 106 |
collection = get_mongo_connection().Catalog.SkuSchemeDetails
|
106 |
collection = get_mongo_connection().Catalog.SkuSchemeDetails
|
| 107 |
data['sku'] = sku.get('_id')
|
107 |
data['sku'] = sku.get('_id')
|
| 108 |
data['addedOn'] = to_java_date(datetime.now())
|
108 |
data['addedOn'] = to_java_date(datetime.now())
|
| - |
|
109 |
data.pop('_id',None)
|
| 109 |
collection.insert(data)
|
110 |
collection.insert(data)
|
| 110 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
111 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 111 |
else:
|
112 |
else:
|
| 112 |
collection = get_mongo_connection().Catalog.SkuSchemeDetails
|
113 |
collection = get_mongo_connection().Catalog.SkuSchemeDetails
|
| 113 |
data['addedOn'] = to_java_date(datetime.now())
|
114 |
data['addedOn'] = to_java_date(datetime.now())
|
| Line 149... |
Line 150... |
| 149 |
collection = get_mongo_connection().Catalog.SkuDiscountInfo
|
150 |
collection = get_mongo_connection().Catalog.SkuDiscountInfo
|
| 150 |
cursor = collection.find({"sku":data['sku']})
|
151 |
cursor = collection.find({"sku":data['sku']})
|
| 151 |
if cursor.count() > 0:
|
152 |
if cursor.count() > 0:
|
| 152 |
continue
|
153 |
continue
|
| 153 |
else:
|
154 |
else:
|
| - |
|
155 |
data.pop('_id',None)
|
| 154 |
collection.insert(data)
|
156 |
collection.insert(data)
|
| 155 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
157 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 156 |
return {1:"Data added successfully"}
|
158 |
return {1:"Data added successfully"}
|
| 157 |
|
159 |
|
| 158 |
def getallSkuDiscountInfo(offset, limit):
|
160 |
def getallSkuDiscountInfo(offset, limit):
|
| Line 199... |
Line 201... |
| 199 |
collection = get_mongo_connection().Catalog.ExceptionalNlc
|
201 |
collection = get_mongo_connection().Catalog.ExceptionalNlc
|
| 200 |
cursor = collection.find({"sku":data['sku']})
|
202 |
cursor = collection.find({"sku":data['sku']})
|
| 201 |
if cursor.count() > 0:
|
203 |
if cursor.count() > 0:
|
| 202 |
continue
|
204 |
continue
|
| 203 |
else:
|
205 |
else:
|
| - |
|
206 |
data.pop('_id',None)
|
| 204 |
collection.insert(data)
|
207 |
collection.insert(data)
|
| 205 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
208 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 206 |
return {1:"Data added successfully"}
|
209 |
return {1:"Data added successfully"}
|
| 207 |
|
210 |
|
| 208 |
|
211 |
|
| Line 626... |
Line 629... |
| 626 |
collection = get_mongo_connection().Catalog.SkuDealerPrices
|
629 |
collection = get_mongo_connection().Catalog.SkuDealerPrices
|
| 627 |
cursor = collection.find({"sku":data['sku']})
|
630 |
cursor = collection.find({"sku":data['sku']})
|
| 628 |
if cursor.count() > 0:
|
631 |
if cursor.count() > 0:
|
| 629 |
continue
|
632 |
continue
|
| 630 |
else:
|
633 |
else:
|
| - |
|
634 |
data.pop('_id',None)
|
| 631 |
collection.insert(data)
|
635 |
collection.insert(data)
|
| 632 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
636 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 633 |
return {1:"Data added successfully"}
|
637 |
return {1:"Data added successfully"}
|
| 634 |
|
638 |
|
| 635 |
|
639 |
|
| Line 695... |
Line 699... |
| 695 |
collection = get_mongo_connection().Catalog.NegativeDeals
|
699 |
collection = get_mongo_connection().Catalog.NegativeDeals
|
| 696 |
cursor = collection.find({"sku":data['sku']})
|
700 |
cursor = collection.find({"sku":data['sku']})
|
| 697 |
if cursor.count() > 0:
|
701 |
if cursor.count() > 0:
|
| 698 |
continue
|
702 |
continue
|
| 699 |
else:
|
703 |
else:
|
| - |
|
704 |
data.pop('_id',None)
|
| 700 |
collection.insert(data)
|
705 |
collection.insert(data)
|
| 701 |
return {1:"Data added successfully"}
|
706 |
return {1:"Data added successfully"}
|
| 702 |
|
707 |
|
| 703 |
def getAllNegativeDeals(offset, limit):
|
708 |
def getAllNegativeDeals(offset, limit):
|
| 704 |
data = []
|
709 |
data = []
|
| Line 751... |
Line 756... |
| 751 |
collection = get_mongo_connection().Catalog.ManualDeals
|
756 |
collection = get_mongo_connection().Catalog.ManualDeals
|
| 752 |
cursor = collection.find({'sku':data['sku'],'startDate':{'$lte':data['startDate']},'endDate':{'$gte':data['endDate']}})
|
757 |
cursor = collection.find({'sku':data['sku'],'startDate':{'$lte':data['startDate']},'endDate':{'$gte':data['endDate']}})
|
| 753 |
if cursor.count() > 0:
|
758 |
if cursor.count() > 0:
|
| 754 |
continue
|
759 |
continue
|
| 755 |
else:
|
760 |
else:
|
| - |
|
761 |
data.pop('_id',None)
|
| 756 |
collection.insert(data)
|
762 |
collection.insert(data)
|
| 757 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
763 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 758 |
return {1:"Data added successfully"}
|
764 |
return {1:"Data added successfully"}
|
| 759 |
|
765 |
|
| 760 |
def deleteDocument(data):
|
766 |
def deleteDocument(data):
|
| Line 828... |
Line 834... |
| 828 |
collection = get_mongo_connection().Catalog.FeaturedDeals
|
834 |
collection = get_mongo_connection().Catalog.FeaturedDeals
|
| 829 |
cursor = collection.find({'sku':data['sku'],'startDate':{'$lte':data['startDate']},'endDate':{'$gte':data['endDate']}})
|
835 |
cursor = collection.find({'sku':data['sku'],'startDate':{'$lte':data['startDate']},'endDate':{'$gte':data['endDate']}})
|
| 830 |
if cursor.count() > 0:
|
836 |
if cursor.count() > 0:
|
| 831 |
continue
|
837 |
continue
|
| 832 |
else:
|
838 |
else:
|
| - |
|
839 |
data.pop('_id',None)
|
| 833 |
collection.insert(data)
|
840 |
collection.insert(data)
|
| 834 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
841 |
get_mongo_connection().Catalog.MasterData.update({'skuBundleId':sku.get('skuBundleId')},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
|
| 835 |
return {1:"Data added successfully"}
|
842 |
return {1:"Data added successfully"}
|
| 836 |
|
843 |
|
| 837 |
def searchCollection(class_name, sku, skuBundleId):
|
844 |
def searchCollection(class_name, sku, skuBundleId):
|