Browse Source

update 续驶里程

lmstack 3 years ago
parent
commit
7f1182c6ea
1 changed files with 3 additions and 3 deletions
  1. 3 3
      LIB/MIDDLE/DrivingRange/UpdtFct.py

+ 3 - 3
LIB/MIDDLE/DrivingRange/UpdtFct.py

@@ -321,13 +321,13 @@ def updtOneSnTodayFct(sn,start_date,end_date,db_engine, db_local, db_qx, sn_tabl
 
 
 #更新最新的factor,一天调用一次。
-def updtNewestFctTb(db_local, db_engine, sn_table_name='tb_sn_factor', sn_newest_table_name='tb_sn_factor_newest'):
+def updtNewestFctTb(current_time, db_local, sn_table_name='tb_sn_factor'):
 
     '''更新tb_sn_factor_newest,只保留最新日期的factor。
     从tb_sn_factor中,筛选最新的日期。
     函数每天运行一次,从tb_sn_factor中筛选最新日期的factor。'''
 
-    current_time=datetime.datetime.now()#当前时间
+    current_time=current_time#当前时间
     current_time_str=current_time.strftime('%Y-%m-%d %H:%M:%S')#时间格式化为字符串,年-月-日 时-分-秒
     current_time_str="'"+current_time_str+"'"
 
@@ -376,7 +376,7 @@ def calDistFromFct(input_df):
     row_df['vehelecrng']=range#给VehElecRng列赋值
     return row_df
 #更新当前时间对应的里程,每5min调用一次
-def updtVehElecRng(db_qx, db_local, db_engine, range_table_name='tb_sn_factor_soc_range', sn_newest_table_name='tb_sn_factor_newest', input_time='2021-07-29 12:01:00'):
+def updtVehElecRng(db_qx, db_local, sn_newest_table_name='tb_sn_factor_newest', input_time='2021-07-29 12:01:00'):
     '''更新续驶里程,到tb_sn_factor_soc_range。
     部署时设置每5min更新一次。
     '''