update ESG
This commit is contained in:
parent
26159c34bd
commit
8a5d76257d
|
@ -32,11 +32,11 @@ def gen_new_rid():
|
||||||
new_id: 生成的企业ID
|
new_id: 生成的企业ID
|
||||||
"""
|
"""
|
||||||
# 生成新ID
|
# 生成新ID
|
||||||
new_id = make_id()
|
new_id = make_id(8)
|
||||||
# 检查新ID是否存在,如果存在则继续生成新ID
|
# 检查新ID是否存在,如果存在则继续生成新ID
|
||||||
case = find_rating_records({"评价ID": new_id}) is []
|
case = find_rating_records({"评价ID": new_id}) is []
|
||||||
while case:
|
while case:
|
||||||
new_id = make_id()
|
new_id = make_id(8)
|
||||||
# 新ID可使用,返回新ID
|
# 新ID可使用,返回新ID
|
||||||
return new_id
|
return new_id
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ def make_3_report_dates():
|
||||||
report_dates 三年报告期
|
report_dates 三年报告期
|
||||||
"""
|
"""
|
||||||
current_year = int(time.strftime("%Y", time.localtime()))-1
|
current_year = int(time.strftime("%Y", time.localtime()))-1
|
||||||
date_01 = str(current_year) + '-12-31'
|
date_01 = str(current_year) + '年'
|
||||||
date_02 = str(current_year-1) + '-12-31'
|
date_02 = str(current_year-1) + '年'
|
||||||
date_03 = str(current_year-2) + '-12-31'
|
date_03 = str(current_year-2) + '年'
|
||||||
report_dates = [date_01, date_02, date_03]
|
report_dates = [date_01, date_02, date_03]
|
||||||
return report_dates
|
return report_dates
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ def exec_esg_rating_scripts(cid):
|
||||||
|
|
||||||
# 打分模型
|
# 打分模型
|
||||||
def esg_model():
|
def esg_model():
|
||||||
url = "http://139.9.249.34:51012/tfse_rating/rating/esg_model"
|
url = "http://139.9.249.34:51012/esg_rating/rating/esg_model"
|
||||||
token = "X0gSlC!YE8jmr2jJr&ilcjS83j!tsoh5"
|
token = "X0gSlC!YE8jmr2jJr&ilcjS83j!tsoh5"
|
||||||
headers = {'token': token, "Content-Type": "application/json;charset=UTF-8"}
|
headers = {'token': token, "Content-Type": "application/json;charset=UTF-8"}
|
||||||
data = json.dumps({"input_data": rating_inputs})
|
data = json.dumps({"input_data": rating_inputs})
|
||||||
|
|
Loading…
Reference in New Issue