整合接口临时存储

This commit is contained in:
王思川 2021-12-24 16:59:37 +08:00
parent a4affdfd48
commit 9b6a4a0030
1 changed files with 23 additions and 18 deletions

View File

@ -216,21 +216,26 @@ def exec_general_rating_scripts(cid):
risks["风险数据"].pop('评价ID') risks["风险数据"].pop('评价ID')
rating_inputs = {**inputs, **risks} rating_inputs = {**inputs, **risks}
# main # 打分模型
url = "http://139.9.249.34:51012/tfse_rating/rating/general_model" def general_model():
token = "X0gSlC!YE8jmr2jJr&ilcjS83j!tsoh5" url = "http://139.9.249.34:51012/tfse_rating/rating/general_model"
headers = {'token': token, "Content-Type": "application/json;charset=UTF-8"} token = "X0gSlC!YE8jmr2jJr&ilcjS83j!tsoh5"
data = json.dumps({"input_data": rating_inputs}) headers = {'token': token, "Content-Type": "application/json;charset=UTF-8"}
res = requests.post(url, headers=headers, data=data) data = json.dumps({"input_data": rating_inputs})
if res.status_code == 200: res = requests.post(url, headers=headers, data=data)
update_data = { if res.status_code == 200:
"评价结果": json.loads(res.text)['result'], update_data = {
"评价时间": time.strftime("%Y-%m-%d", time.localtime()), "评价结果": json.loads(res.text)['result'],
"进行状态": "完成", "评价时间": time.strftime("%Y-%m-%d", time.localtime()),
"报告fid": "xxx", "进行状态": "完成",
"证书fid": "xxx" "报告fid": None,
} "证书fid": None
update_rating_records({"评价ID": rid}, update_data) }
return True update_rating_records({"评价ID": rid}, update_data)
else: return True
return False else:
return False
# 生成报告
def gen_report():
pass