| Line 41... |
Line 41... |
| 41 |
from elasticsearch import Elasticsearch
|
41 |
from elasticsearch import Elasticsearch
|
| 42 |
except:
|
42 |
except:
|
| 43 |
pass
|
43 |
pass
|
| 44 |
from shop2020.config.client.ConfigClient import ConfigClient
|
44 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| 45 |
|
45 |
|
| 46 |
DataService.initialize(db_hostname="localhost")
|
46 |
DataService.initialize()
|
| 47 |
mc = MemCache("127.0.0.1")
|
47 |
mc = MemCache("127.0.0.1")
|
| 48 |
config_client = ConfigClient()
|
48 |
config_client = ConfigClient()
|
| 49 |
elastic_search_host = config_client.get_property('elastic_search_host')
|
49 |
elastic_search_host = config_client.get_property('elastic_search_host')
|
| 50 |
elastic_search_port = config_client.get_property('elastic_search_port')
|
50 |
elastic_search_port = config_client.get_property('elastic_search_port')
|
| 51 |
|
51 |
|
| Line 1351... |
Line 1351... |
| 1351 |
for av_info in item[0]['availabilityInfo']:
|
1351 |
for av_info in item[0]['availabilityInfo']:
|
| 1352 |
if not av_info:
|
1352 |
if not av_info:
|
| 1353 |
continue
|
1353 |
continue
|
| 1354 |
av_info['cash_back'] = item[0]['cash_back']
|
1354 |
av_info['cash_back'] = item[0]['cash_back']
|
| 1355 |
av_info['cash_back_type'] = item[0]['cash_back_type']
|
1355 |
av_info['cash_back_type'] = item[0]['cash_back_type']
|
| 1356 |
netPriceAfterCashBack = av_info['sellingPrice']
|
1356 |
netPriceAfterCashBack = av_info['sellingPrice']
|
| 1357 |
if av_info['cash_back_type'] ==1:
|
1357 |
if av_info['cash_back_type'] ==1:
|
| 1358 |
netPriceAfterCashBack = av_info['sellingPrice'] - math.floor(float(av_info['sellingPrice'])*av_info['cash_back']/100)
|
1358 |
netPriceAfterCashBack = av_info['sellingPrice'] - math.floor(float(av_info['sellingPrice'])*av_info['cash_back']/100)
|
| 1359 |
elif av_info['cash_back_type'] ==2:
|
1359 |
elif av_info['cash_back_type'] ==2:
|
| 1360 |
netPriceAfterCashBack = av_info['sellingPrice'] - math.floor(av_info['cash_back'])
|
1360 |
netPriceAfterCashBack = av_info['sellingPrice'] - math.floor(av_info['cash_back'])
|
| 1361 |
else:
|
1361 |
else:
|