Jelajahi Sumber

修复统计方式中的bug,只统计当日故障

Eric412V 3 tahun lalu
induk
melakukan
2c885f03a3
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/DataStatistics.py

+ 3 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/DataStatistics.py

@@ -11,6 +11,9 @@ class DataSta():
     def __init__(self) -> None:
         pass
     def SaftyWarningSta(df_fltinfo,start_time,end_time):
+        start_time=datetime.datetime.strptime(start_time, '%Y-%m-%d')
+        start_time=start_time+datetime.timedelta(days=1)
+        start_time=start_time.strftime('%Y-%m-%d')
         SftyPlt_Data_Total=len(df_fltinfo)#总报警数
         CS_Warning_Total_Finish=df_fltinfo[df_fltinfo['batpos']==1]
         CS_Warning_Total_Finish_Count=len(CS_Warning_Total_Finish) #平台报警总运维数