From d07669e0ee833bc22f24425284469b4f9251ab19 Mon Sep 17 00:00:00 2001 From: workpc Date: Mon, 30 Dec 2024 16:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_jingbo.py | 9 --------- config_yongan.py | 6 ------ lib/dataread.py | 3 +-- main_yuanyou.py | 13 ++++++++----- 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/config_jingbo.py b/config_jingbo.py index 053fdb2..b719e2d 100644 --- a/config_jingbo.py +++ b/config_jingbo.py @@ -290,10 +290,6 @@ upload_warning_url = "http://192.168.100.115:9090/dom-api/api/basicBuiness/crude query_data_list_item_nos_url = "http://192.168.100.115:9090/dom-api/api/warehouse/dwDataItem/queryDataListItemNos" - - - - login_data = { "data": { "account": "api-dev", @@ -462,8 +458,3 @@ logger.addHandler(console_handler) # logger.info('当前配置:'+settings) - -if __name__ == '__main__': - import pandas as pd - df1 = pd.read_excel(os.path.join(dataset,'数据项下载.xls'),header=5, names=['numid','date', 'Brentzdj', 'Brentzgj']) - print(df1) \ No newline at end of file diff --git a/config_yongan.py b/config_yongan.py index 034dfae..7609edc 100644 --- a/config_yongan.py +++ b/config_yongan.py @@ -136,7 +136,6 @@ upload_data = { "smartBusinessClassCode":'1', #分析报告分类编码 "reportEmployeeCode":"U270018", # 报告人 "reportDeptCode" :"D270001" ,# 报告部门 - # "reportDeptCode" :"000001" ,# 报告部门 "productGroupCode":"RAW_MATERIAL" # 商品分类 } } @@ -280,8 +279,3 @@ logger.addHandler(console_handler) # logger.info('当前配置:'+settings) - -if __name__ == '__main__': - import pandas as pd - df1 = pd.read_excel(os.path.join(dataset,'数据项下载.xls'),header=5, names=['numid','date', 'Brentzdj', 'Brentzgj']) - print(df1) \ No newline at end of file diff --git a/lib/dataread.py b/lib/dataread.py index 4b5ffc9..108642b 100644 --- a/lib/dataread.py +++ b/lib/dataread.py @@ -41,8 +41,7 @@ plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 # from config_jingbo_pro import * -# from config_jingbo import * -from config_yongan import * +from config_jingbo import * # from config_juxiting import * diff --git a/main_yuanyou.py b/main_yuanyou.py index cfe3e4e..b0ba92b 100644 --- a/main_yuanyou.py +++ b/main_yuanyou.py @@ -144,11 +144,14 @@ def predict_main(): logger.info(f'要更新y的信息:{update_y}') # try: for row in update_y.itertuples(index=False): - row_dict = row._asdict() - yy = df[df['ds']==row_dict['ds']]['y'].values[0] - LOW = df[df['ds']==row_dict['ds']]['Brentzdj'].values[0] - HIGH = df[df['ds']==row_dict['ds']]['Brentzgj'].values[0] - sqlitedb.update_data('accuracy', f"y = {yy},LOW_PRICE = {LOW},HIGH_PRICE = {HIGH}", where_condition=f"ds = '{row_dict['ds']}'") + try: + row_dict = row._asdict() + yy = df[df['ds']==row_dict['ds']]['y'].values[0] + LOW = df[df['ds']==row_dict['ds']]['Brentzdj'].values[0] + HIGH = df[df['ds']==row_dict['ds']]['Brentzgj'].values[0] + sqlitedb.update_data('accuracy', f"y = {yy},LOW_PRICE = {LOW},HIGH_PRICE = {HIGH}", where_condition=f"ds = '{row_dict['ds']}'") + except: + logger.info(f'更新accuracy表的y值失败:{row_dict}') # except Exception as e: # logger.info(f'更新accuracy表的y值失败:{e}')