浏览代码

Merge branch 'dev' of http://git.fast-fun.cn:92/lmstack/data_analyze_platform into dev

Eric412V 2 年之前
父节点
当前提交
9ca15f4bcc

+ 2 - 2
LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSBatInterShort.py

@@ -426,7 +426,7 @@ class BatInterShort():
             dict_bal2={}
         else:
             deltvolt_last2=[np.array(x) for x in df_ram_chrgvolt.loc[0,'deltvolt']]
-            time_last2=df_ram_chrgvolt.loc[0,'time2']
+            time_last2=df_ram_chrgvolt.loc[0,'time']
             temp_mean_last=df_ram_chrgvolt.loc[0,'temp_avg']
             packcrnt_mean_last=df_ram_chrgvolt.loc[0,'packcrnt_avg']
             firsttime2=0
@@ -721,7 +721,7 @@ class BatInterShort():
             dict_bal2={}
         else:
             deltvolt_last2=[np.array(x) for x in df_ram_chrgvolt.loc[0,'deltvolt']]
-            time_last2=df_ram_chrgvolt.loc[0,'time2']
+            time_last2=df_ram_chrgvolt.loc[0,'time']
             temp_mean_last=df_ram_chrgvolt.loc[0,'temp_avg']
             packcrnt_mean_last=df_ram_chrgvolt.loc[0,'packcrnt_avg']
             firsttime2=0

+ 0 - 7
LIB/MIDDLE/SaftyCenter/Common/DBDownload.py

@@ -46,25 +46,18 @@ class DBDownload:
         if self.mode==1:
             self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(str,tablename,sn))
         elif self.mode==0:
-<<<<<<< HEAD
             if len(sn)>1:
                 self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
             else:
                 self.cursor.execute("select %s from %s where %s between '%s' and '%s'" %(str,tablename,timename,st,sp))
-=======
-            self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
->>>>>>> master
         elif self.mode==2:
             self.cursor.execute("select %s from %s where factory='%s'" %(str,tablename,factory))
         elif self.mode==3:
             self.cursor.execute("select %s from %s" %(str,tablename))
         elif self.mode==4:
             self.cursor.execute("select %s from %s where qrcode='%s' order by id desc limit 1" %(str,tablename,sn))
-<<<<<<< HEAD
         elif self.mode==5:
             self.cursor.execute("select %s from %s where info='%s'" %(str,tablename,timename))
-=======
->>>>>>> master
         res = self.cursor.fetchall()
         df_res = pd.DataFrame(res, columns=param)
         df_res = df_res.reset_index(drop=True)

+ 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()

+ 2 - 5
LIB/MIDDLE/SaftyCenter/Offline/offline_alarm_sta.py

@@ -33,14 +33,11 @@ def offline_alarm_sta(df_sns, db_iotp_engine, db_qxcas_engine, conn, db_sp_engin
         df = df_offlinealarm_lastday[df_offlinealarm_lastday['sn']==sn]
         sql = "select * from ff_battery_status where devcode = '{}'".format(sn)
         df_on = pd.read_sql(sql, db_iotp_engine)
-<<<<<<< HEAD
-        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':pd.to_datetime(df_on['status_time'].values[0]), 'end_time':'0000-00-00 00:00:00', 'info':'离线报警','code':59, 'level':1}, ignore_index=True)
-=======
+
         if len(df_sns[df_sns['sn']==sn]) > 0:
             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':pd.to_datetime(df_on['status_time'].values[0]), 'end_time':'0000-00-00 00:00:00', 'info':'离线报警','code':59, 'level':1}, ignore_index=True)
->>>>>>> master
+
     if not df_new.empty:
         df_new.to_sql('all_fault_info', db_sp_engine, if_exists='append', index=False)