修改文件上传路径
This commit is contained in:
parent
9ce6a041b0
commit
81a69065e5
|
|
@ -86,7 +86,7 @@ def gen_cross_compare_report(params):
|
||||||
# 验证文件是否已经存在
|
# 验证文件是否已经存在
|
||||||
cos_client = get_client()
|
cos_client = get_client()
|
||||||
folder_manager = CosFolderManager(cos_client, g_cos_bucket)
|
folder_manager = CosFolderManager(cos_client, g_cos_bucket)
|
||||||
download_url = g_cos_root + "/user/cross_doctor/export_files/cross_compare_files/" + file_name
|
download_url = g_cos_root + f"/user/cross_doctor/platform_report/{nodeid}/{area_id}/cross_compare_report/" + file_name
|
||||||
if folder_manager.file_exists(download_url):
|
if folder_manager.file_exists(download_url):
|
||||||
res = make_common_res(0, 'ok')
|
res = make_common_res(0, 'ok')
|
||||||
res['data'] = {
|
res['data'] = {
|
||||||
|
|
@ -97,6 +97,7 @@ def gen_cross_compare_report(params):
|
||||||
'file_name': file_name,
|
'file_name': file_name,
|
||||||
'gen_report_date': gen_report_date,
|
'gen_report_date': gen_report_date,
|
||||||
'date_range': data_range,
|
'date_range': data_range,
|
||||||
|
'weekdays': weekdays,
|
||||||
'compare_date_range': compare_date_range,
|
'compare_date_range': compare_date_range,
|
||||||
'weekday_str': gen_weekday_str(weekdays),
|
'weekday_str': gen_weekday_str(weekdays),
|
||||||
'download_url': download_url
|
'download_url': download_url
|
||||||
|
|
@ -246,7 +247,7 @@ def gen_cross_compare_report(params):
|
||||||
doc1.build_template('')
|
doc1.build_template('')
|
||||||
doc1.doc.save(file_stream)
|
doc1.doc.save(file_stream)
|
||||||
file_stream.seek(0)
|
file_stream.seek(0)
|
||||||
cos_path = f'user/cross_doctor/task_file'
|
cos_path = f'user/cross_doctor/platform_report/{nodeid}/{area_id}/cross_compare_report/'
|
||||||
folder_manager.ensure_folder(cos_path)
|
folder_manager.ensure_folder(cos_path)
|
||||||
cos_key = f"{cos_path}/{cross_static_info['name']}路口优化对比报告.docx"
|
cos_key = f"{cos_path}/{cross_static_info['name']}路口优化对比报告.docx"
|
||||||
cos_client.put_object(Bucket=g_cos_bucket, Key=cos_key, Body=file_stream)
|
cos_client.put_object(Bucket=g_cos_bucket, Key=cos_key, Body=file_stream)
|
||||||
|
|
@ -260,6 +261,7 @@ def gen_cross_compare_report(params):
|
||||||
'file_name': file_name,
|
'file_name': file_name,
|
||||||
'gen_report_date': gen_report_date,
|
'gen_report_date': gen_report_date,
|
||||||
'date_range': data_range,
|
'date_range': data_range,
|
||||||
|
'weekdays': weekdays,
|
||||||
'compare_date_range': compare_date_range,
|
'compare_date_range': compare_date_range,
|
||||||
'weekday_str': gen_weekday_str(weekdays),
|
'weekday_str': gen_weekday_str(weekdays),
|
||||||
'download_url': download_url
|
'download_url': download_url
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue