原油报告上传参数更改

This commit is contained in:
jingboyitiji 2025-04-01 12:58:41 +08:00
parent 2997df97e0
commit 2fbd6c04f9
4 changed files with 15 additions and 8 deletions

View File

@ -1155,6 +1155,8 @@ class Config:
# 接口配置
@property
def upload_url(self): return global_config['upload_url']
@property
def upload_data(self): return global_config['upload_data']
@property
def login_pushreport_url(

View File

@ -388,7 +388,7 @@ def predict_main():
if __name__ == '__main__':
# global end_time
# 遍历2024-11-25 到 2024-12-3 之间的工作日日期
for i_time in pd.date_range('2025-2-10', '2025-3-18', freq='B'):
for i_time in pd.date_range('2025-3-19', '2025-3-29', freq='B'):
try:
global_config['end_time'] = i_time.strftime('%Y-%m-%d')
predict_main()

View File

@ -49,6 +49,7 @@ global_config.update({
'login_pushreport_url': login_pushreport_url,
'login_data': login_data,
'upload_url': upload_url,
'upload_data': upload_data,
'upload_warning_url': upload_warning_url,
'warning_data': warning_data,
@ -437,9 +438,13 @@ def predict_main():
if __name__ == '__main__':
# global end_time
# # 遍历2024-11-25 到 2024-12-3 之间的工作日日期
# for i_time in pd.date_range('2024-12-1', '2025-2-26', freq='W'):
# end_time = i_time.strftime('%Y-%m-%d')
# predict_main()
# 遍历2024-11-25 到 2024-12-3 之间的工作日日期
# for i_time in pd.date_range('2025-1-1', '2025-3-29', freq='B'):
# try:
# global_config['end_time'] = i_time.strftime('%Y-%m-%d')
# predict_main()
# except Exception as e:
# logger.info(f'预测失败:{e}')
# continue
predict_main()

View File

@ -2499,10 +2499,10 @@ def brent_export_pdf(num_indicators=475, num_models=21, num_dayindicator=202, in
if config.is_update_report:
with open(os.path.join(config.dataset, reportname), 'rb') as f:
base64_data = base64.b64encode(f.read()).decode('utf-8')
upload_data["data"]["fileBase64"] = base64_data
upload_data["data"]["fileName"] = reportname
config.upload_data["data"]["fileBase64"] = base64_data
config.upload_data["data"]["fileName"] = reportname
token = get_head_auth_report()
upload_report_data(token, upload_data)
upload_report_data(token, config.upload_data)
except TimeoutError as e:
print(f"请求超时: {e}")