Browse Source

修复最大运行时长bug,显示故障分类统计

Eric412V 3 years ago
parent
commit
f397e8fdc5

+ 3 - 3
LIB/MIDDLE/SaftyCenter/DataSta/DataStatistics.py

@@ -1,7 +1,7 @@
 import numpy as np
 import pandas as pd
-from MIDDLE.SaftyCenter.Common import FeiShuData
-from MIDDLE.SaftyCenter.Common import DBDownload
+from USER.eric.Common import FeiShuData
+from USER.eric.Common import DBDownload
 import time, datetime
 from datetime import timedelta
 from pandas.core.frame import DataFrame
@@ -113,7 +113,7 @@ class DataSta():
             df_FirstDataTime.loc[i,'first_data_time']=df_FirstDataTime.loc[i,'first_data_time'].strftime('%Y-%m-%d')
             df_FirstDataTime.loc[i,'first_data_time']=datetime.datetime.strptime(df_FirstDataTime.loc[i,'first_data_time'],'%Y-%m-%d')
             deltatime.loc[i,'runningdate']=(End_time-df_FirstDataTime.loc[i,'first_data_time'])
-            deltatime.loc[i,'runningdate']= deltatime.loc[i,'runningdate'].total_seconds()/60
+            deltatime.loc[i,'runningdate']= deltatime.loc[i,'runningdate'].total_seconds()/3600
         MaxRunningHour=int(deltatime['runningdate'].max())
         TotalRunHour=int(deltatime['runningdate'].sum())
         return MaxAccumAh,TotalAccumAh,MaxCycle,MaxRunningHour,TotalRunHour

+ 5 - 4
LIB/MIDDLE/SaftyCenter/DataSta/main.py

@@ -1,7 +1,7 @@
 import numpy as np
 import pandas as pd
-from MIDDLE.SaftyCenter.Common import FeiShuData
-from MIDDLE.SaftyCenter.Common import DBDownload
+from USER.eric.Common import FeiShuData
+from USER.eric.Common import DBDownload
 import time, datetime
 from pandas.core.frame import DataFrame
 from apscheduler.schedulers.blocking import BlockingScheduler
@@ -116,8 +116,9 @@ def Minutes_Task():
     CellType=Celltype.columns.tolist()
     CellType=','.join(CellType) 
     all_statistic_info.loc[0,'cell_type']=str(CellType)
-    CellTypeCount=str(Celltype.loc[0].values)
-    CellTypeCount=''.join(CellTypeCount) 
+    CellTypeCount=Celltype.loc[0].tolist()
+    CellTypeCount=[str(x) for x in CellTypeCount]
+    CellTypeCount=','.join(CellTypeCount) 
     all_statistic_info.loc[0,'cell_type_count']=str(CellTypeCount)
     all_statistic_info.loc[0,'cell_safety_risk_count']=SatftyCount.loc[0,'CellSaftyCount']
     all_statistic_info.loc[0,'data_safety_risk_count']=SatftyCount.loc[0,'DataSaftyCodeCount']