|
|
@@ -84,8 +84,8 @@ def generate_report(city_uuid, product_id, recall_count, delivery_count):
|
|
|
"""生成报告"""
|
|
|
report_util = ReportUtils(city_uuid, product_id)
|
|
|
report_util.generate_all_data(recall_count, delivery_count)
|
|
|
- # repots_dir = os.path.join('./data/reports', city_uuid, product_id)
|
|
|
- # upload_file(repots_dir)
|
|
|
+ repots_dir = os.path.join('./data/reports', city_uuid, product_id)
|
|
|
+ upload_file(repots_dir)
|
|
|
|
|
|
def upload_file(reports_dir):
|
|
|
"""上传报告文件"""
|
|
|
@@ -118,7 +118,6 @@ def upload_file(reports_dir):
|
|
|
response = requests.post(
|
|
|
base_url,
|
|
|
headers=headers,
|
|
|
- cookies=cookies,
|
|
|
files=files,
|
|
|
verify=True
|
|
|
)
|
|
|
@@ -149,7 +148,7 @@ async def get_file_id(request: ReportRequest):
|
|
|
detail="Reports not found"
|
|
|
)
|
|
|
|
|
|
- with open(files_id_path) as file:
|
|
|
+ with open(files_id_path, 'r', encoding="utf-8") as file:
|
|
|
lines = file.readlines()
|
|
|
|
|
|
if lines[0].strip() == "failed":
|