|
@@ -31,11 +31,11 @@ def low_soc_alarm_sta(db_qxcas_engine, conn, db_sp_engine):
|
|
sn_close = list(set(sn_allalarm)-set(sn_lowsoc)-set(sn_offline))
|
|
sn_close = list(set(sn_allalarm)-set(sn_lowsoc)-set(sn_offline))
|
|
# sn_cross = list(set(sn_lowsoc) & set(sn_allalarm))
|
|
# sn_cross = list(set(sn_lowsoc) & set(sn_allalarm))
|
|
# 新增
|
|
# 新增
|
|
- df_new = pd.DataFrame(columns=['add_time', 'product_id', 'start_time', 'end_time', 'code', 'level'])
|
|
|
|
|
|
+ df_new = pd.DataFrame(columns=['add_time', 'product_id', 'start_time', 'end_time', 'code', 'level', 'info'])
|
|
now = datetime.datetime.now()
|
|
now = datetime.datetime.now()
|
|
for sn in sn_new:
|
|
for sn in sn_new:
|
|
df = df_lowsocalarm_lastday[df_lowsocalarm_lastday['sn']==sn]
|
|
df = df_lowsocalarm_lastday[df_lowsocalarm_lastday['sn']==sn]
|
|
- df_new = df_new.append({'add_time':now, 'product_id':sn, 'start_time':df['time'].values[0], 'end_time':'0000-00-00 00:00:00', 'code':58, 'level':1}, ignore_index=True)
|
|
|
|
|
|
+ df_new = df_new.append({'add_time':now, 'product_id':sn, 'start_time':df['time'].values[0], 'end_time':'0000-00-00 00:00:00', 'info':"低电量报警", 'code':58, 'level':1}, ignore_index=True)
|
|
if not df_new.empty:
|
|
if not df_new.empty:
|
|
df_new.to_sql('all_fault_info', db_sp_engine, if_exists='append', index=False)
|
|
df_new.to_sql('all_fault_info', db_sp_engine, if_exists='append', index=False)
|
|
|
|
|