solar_App: 更改半夜歸檔(日報表)執行順序、異常處理的時間判斷多加秒數

This commit is contained in:
wanling040@gmail.com 2022-08-26 15:31:17 +08:00
parent e5856f3c33
commit 8da421258a

View File

@ -117,7 +117,7 @@ namespace solarApp
} }
//異常處理 每 5分鐘跑一次 //異常處理 每 5分鐘跑一次
if ((DateTime.Now.Minute % 5) == 0 && autoTask == false) if ((DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && autoTask == false)
{ {
autoTask = true; autoTask = true;
lbMsgTitle.Text = "異常處理 " + DateTime.Now.ToString() + " timer start"; lbMsgTitle.Text = "異常處理 " + DateTime.Now.ToString() + " timer start";
@ -306,7 +306,6 @@ namespace solarApp
sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
invSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); invSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
siteSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); siteSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
} }
} }
sensorSvc.isFirst = true; sensorSvc.isFirst = true;
@ -317,6 +316,7 @@ namespace solarApp
{ {
sensorSvc.archiveSensorHistoryHourData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); sensorSvc.archiveSensorHistoryHourData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
sensorSvc.isFirst = false; sensorSvc.isFirst = false;
invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
} }
} }
autoTask = true; autoTask = true;