update ESG

This commit is contained in:
P3ngSaM 2022-02-23 23:21:31 +08:00
parent 26159c34bd
commit 8a5d76257d
3 changed files with 6 additions and 6 deletions

View File

@ -32,11 +32,11 @@ def gen_new_rid():
new_id: 生成的企业ID
"""
# 生成新ID
new_id = make_id()
new_id = make_id(8)
# 检查新ID是否存在如果存在则继续生成新ID
case = find_rating_records({"评价ID": new_id}) is []
while case:
new_id = make_id()
new_id = make_id(8)
# 新ID可使用返回新ID
return new_id
@ -50,9 +50,9 @@ def make_3_report_dates():
report_dates 三年报告期
"""
current_year = int(time.strftime("%Y", time.localtime()))-1
date_01 = str(current_year) + '-12-31'
date_02 = str(current_year-1) + '-12-31'
date_03 = str(current_year-2) + '-12-31'
date_01 = str(current_year) + ''
date_02 = str(current_year-1) + ''
date_03 = str(current_year-2) + ''
report_dates = [date_01, date_02, date_03]
return report_dates
@ -201,7 +201,7 @@ def exec_esg_rating_scripts(cid):
# 打分模型
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"
headers = {'token': token, "Content-Type": "application/json;charset=UTF-8"}
data = json.dumps({"input_data": rating_inputs})