qingfeng 2 年之前
父節點
當前提交
ffbea599f4
共有 1 個文件被更改,包括 2 次插入8 次删除
  1. 2 8
      LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm_sta.py

+ 2 - 8
LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm_sta.py

@@ -38,22 +38,16 @@ def low_soc_alarm_sta(df_sns, db_qxcas_engine, conn, db_sp_engine):
         factory = df_sns[df_sns['sn']==sn]['factory'].values[0]
         df_new = df_new.append({'add_time':now, 'product_id':sn, 'factory':factory, 'start_time':df['time'].values[0], 'end_time':'0000-00-00 00:00:00', 'info':"低电量报警", 'code':'C307', 'level':3}, ignore_index=True)
     if not df_new.empty:
-<<<<<<< HEAD
         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)
->>>>>>> master
+
 
     # 修改
     now = datetime.datetime.now()
     for sn in sn_close:
         df = df_lowsocalarm_lastday[df_lowsocalarm_lastday['sn']==sn]
         df1 = df_all_alarm_info[df_all_alarm_info['product_id']==sn]
-<<<<<<< HEAD
+
         sql = ''' update all_fault_info set update_time='{}', end_time='{}' where product_id = '{}' and start_time = '{}' and code = {}'''.format \
-=======
-        sql = ''' update all_fault_info set update_time='{}', end_time='{}' where product_id = '{}' and start_time = '{}' and code = '{}' '''.format \
->>>>>>> master
                     (now, datetime.datetime.strftime(now,"%Y-%m-%d %H:%M:%S"), sn, pd.to_datetime(df1['start_time'].values[0]), df1['code'].values[0])
         cursor.execute(sql)
         conn.commit()