修复 提交填报 更新 bug
This commit is contained in:
parent
48c508832f
commit
e0afc15164
|
@ -78,13 +78,14 @@ def find_risk_data(rid):
|
|||
return record
|
||||
|
||||
|
||||
def update_rating_records(rid, data):
|
||||
def update_rating_records(find, data):
|
||||
"""
|
||||
更新评价记录
|
||||
Parameters:
|
||||
-
|
||||
find 查询条件
|
||||
data 更新数据
|
||||
Returns:
|
||||
-
|
||||
"""
|
||||
collection = client['评价']['评价记录']
|
||||
collection.update_one({"评价ID": rid}, {"$set": data})
|
||||
collection.update_one(find, {"$set": data})
|
||||
|
|
|
@ -223,7 +223,14 @@ def exec_general_rating_scripts(cid):
|
|||
data = json.dumps({"input_data": rating_inputs})
|
||||
res = requests.post(url, headers=headers, data=data)
|
||||
if res.status_code == 200:
|
||||
update_rating_records({"评价ID": rid}, {"进行状态": "完成"})
|
||||
update_data = {
|
||||
"评价结果": json.loads(res.text)['result'],
|
||||
"评价时间": time.strftime("%Y-%m-%d", time.localtime()),
|
||||
"进行状态": "完成",
|
||||
"报告fid": "xxx",
|
||||
"证书fid": "xxx"
|
||||
}
|
||||
update_rating_records({"评价ID": rid}, update_data)
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue