update ESG查看报告/证书

This commit is contained in:
P3ngSaM 2022-03-02 16:28:31 +08:00
parent ddc74f5367
commit 0d56ab5373
1 changed files with 14 additions and 5 deletions

View File

@ -85,14 +85,23 @@ def rating_records_by_cid(cid):
"""
report_link = '/file/get_company_report?file_id={}'
certification_link = "/file/get_certification?file_id={}"
esg_report_link = '/file/get_company_esg_report?file_id={}'
esg_certification_link = "/file/get_esg_certification?file_id={}"
records = find_rating_records({"企业ID": cid})
for record in records:
if records is not None:
record['报告'] = report_link.format(record['报告fid']) if record['报告fid'] is not None else None
record['证书'] = certification_link.format(record['证书fid']) if record['证书fid'] is not None else None
record.pop('企业ID')
record.pop('报告fid')
record.pop('证书fid')
if record['评价项目'] == '综合信用评价':
record['报告'] = report_link.format(record['报告fid']) if record['报告fid'] is not None else None
record['证书'] = certification_link.format(record['证书fid']) if record['证书fid'] is not None else None
record.pop('企业ID')
record.pop('报告fid')
record.pop('证书fid')
else:
record['报告'] = esg_report_link.format(record['报告fid']) if record['报告fid'] is not None else None
record['证书'] = esg_certification_link.format(record['证书fid']) if record['证书fid'] is not None else None
record.pop('企业ID')
record.pop('报告fid')
record.pop('证书fid')
return records