| Line 19... |
Line 19... |
| 19 |
logging.basicConfig(level=logging.DEBUG)
|
19 |
logging.basicConfig(level=logging.DEBUG)
|
| 20 |
|
20 |
|
| 21 |
warehouse_allocation_cache = {}
|
21 |
warehouse_allocation_cache = {}
|
| 22 |
serviceable_location_cache = {}
|
22 |
serviceable_location_cache = {}
|
| 23 |
delivery_estimate_cache = {}
|
23 |
delivery_estimate_cache = {}
|
| 24 |
'''
|
24 |
|
| 25 |
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
|
25 |
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
|
| 26 |
'110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
|
26 |
'110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
|
| 27 |
'110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
|
27 |
'110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
|
| 28 |
'110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
|
28 |
'110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
|
| 29 |
'110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
|
29 |
'110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
|
| 30 |
'110087','110088','110089','110091','110092','110093','110094','110095','110096','110101','110103','110104','110105','110106','110107',\
|
30 |
'110087','110088','110089','110091','110092','110093','110094','110095','110096','110101','110103','110104','110105','110106','110107',\
|
| 31 |
'110108','110109','110110','110112','110113','110114','110115','110116','110117','110118','110119','110120','110122','110124','110125',\
|
31 |
'110108','110109','110110','110112','110113','110114','110115','110116','110117','110118','110119','110120','110122','110124','110125',\
|
| 32 |
'110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
|
32 |
'110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
|
| 33 |
'110606','110607','110608','110609','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002',\
|
33 |
'110606','110607','110608','110609','121001','121002','121003','121004','121005','121006','121007','121008','121009','122001','122002',\
|
| 34 |
'122003','122005','122006','122008','122009','122010','122015','122017','201010','201011','201012','201014','201301','201302','201303',\
|
34 |
'122003','122005','122006','122008','122009','122010','122015','122017','201001','201002','201003','201004','201005','201006','201007',\
|
| 35 |
'201304','201305','201306','201307','201309','201310','201311']
|
35 |
'201008','201009','201010','201011','201012','201014','201301','201302','201303','201304','201305','201306','201307','201309','201310',\
|
| 36 |
'''
|
- |
|
| 37 |
'''
|
- |
|
| 38 |
Only delhi pincodes for time being
|
36 |
'201311']
|
| 39 |
'''
|
37 |
|
| 40 |
ncr_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015','110016',\
|
- |
|
| 41 |
'110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030','110031','110032',\
|
- |
|
| 42 |
'110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049','110051','110052','110053',\
|
- |
|
| 43 |
'110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065','110066','110067','110068','110070',\
|
- |
|
| 44 |
'110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086','110087','110088','110089','110091','110092',\
|
- |
|
| 45 |
'110093','110094','110095','110096','110101','110103','110104','110105','110106','110107','110108','110109','110110','110112','110113','110114',\
|
- |
|
| 46 |
'110115','110116','110117','110118','110119','110120','110122','110124','110125','110301','110302','110501','110502','110503','110504','110505',\
|
- |
|
| 47 |
'110510','110511','110512','110601','110602','110603','110604','110605','110606','110607','110608','110609']
|
- |
|
| 48 |
'''
|
38 |
'''
|
| 49 |
This class is for only data transfer. Never used outside this module.
|
39 |
This class is for only data transfer. Never used outside this module.
|
| 50 |
'''
|
40 |
'''
|
| 51 |
class _DeliveryEstimateObject:
|
41 |
class _DeliveryEstimateObject:
|
| 52 |
def __init__(self, delivery_time, reliability, provider_id, codAllowed):
|
42 |
def __init__(self, delivery_time, reliability, provider_id, codAllowed):
|
| Line 112... |
Line 102... |
| 112 |
|
102 |
|
| 113 |
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
|
103 |
def __get_logistics_provider_for_destination_pincode(type, destination_pin, item_selling_price):
|
| 114 |
if ncr_pincodes.__contains__(destination_pin) and item_selling_price <= 20000:
|
104 |
if ncr_pincodes.__contains__(destination_pin) and item_selling_price <= 20000:
|
| 115 |
return 3, True
|
105 |
return 3, True
|
| 116 |
|
106 |
|
| 117 |
|
- |
|
| 118 |
'''
|
- |
|
| 119 |
Removed this code for time being
|
- |
|
| 120 |
if serviceable_location_cache.get(3).has_key(destination_pin):
|
107 |
if serviceable_location_cache.get(3).has_key(destination_pin):
|
| 121 |
dest_code, exp, iscod, station_type = serviceable_location_cache.get(3).get(destination_pin)
|
108 |
dest_code, exp, iscod, station_type = serviceable_location_cache.get(3).get(destination_pin)
|
| 122 |
iscod = iscod and item_selling_price <= 9600
|
109 |
iscod = iscod and item_selling_price <= 9600
|
| 123 |
return 3, iscod
|
110 |
return 3, iscod
|
| 124 |
'''
|
111 |
|
| 125 |
if serviceable_location_cache.get(1).has_key(destination_pin):
|
112 |
if serviceable_location_cache.get(1).has_key(destination_pin):
|
| 126 |
dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
|
113 |
dest_code, exp, iscod, station_type = serviceable_location_cache.get(1).get(destination_pin)
|
| 127 |
iscod = iscod and item_selling_price <= 9600
|
114 |
iscod = iscod and item_selling_price <= 9600
|
| 128 |
return 1, iscod
|
115 |
return 1, iscod
|
| 129 |
else:
|
116 |
else:
|