From 2d5c7db7dba53df3f7307d0e75044498817a6275 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Mon, 22 Aug 2022 17:43:28 +0800 Subject: [PATCH] =?UTF-8?q?solar=5FApp:=20=E5=9C=A8"=E5=85=A8=E9=9B=BB?= =?UTF-8?q?=E7=AB=99"=E5=92=8C"=E6=99=82=E9=96=93=E5=8D=80=E9=96=93/?= =?UTF-8?q?=E5=96=AE=E9=9B=BB=E7=AB=99"=E8=A3=A1=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0irrDayHour=E7=9A=84=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solarApp/fmArchive.cs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index cf78d38..e7db969 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -46,7 +46,7 @@ namespace solarApp { //string d1 = day.ToString("yyyy-MM-dd"); sensorSvc.archiveData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); - sensorSvc.archiveSensorHistoryHourData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd"));/////要改 + sensorSvc.archiveSensorHistoryHourData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); sensorSvc.isFirst = false; } //sensorSvc._siteDB = lbSiteDB_sensor.Text; @@ -315,7 +315,7 @@ namespace solarApp //for sensor_history_hour foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) { - 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; } } @@ -484,7 +484,7 @@ namespace solarApp //} var site_list = stationSvc.get_station_list(); - + string date1 = dtSelect1.Value.ToString("yyyy-MM-dd"); string date2 = dtSelect2.Value.ToString("yyyy-MM-dd"); procSensorSvc sensorSvc = new procSensorSvc(); @@ -493,7 +493,7 @@ namespace solarApp int i = 0; foreach (var item in site_list) { - + foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) { sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); @@ -502,8 +502,20 @@ namespace solarApp invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); } i++; - } - // MessageBox.Show("OK"); + } + + sensorSvc.isFirst = true; + foreach (var item in site_list) + { + //for sensor_history_hour + foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) + { + sensorSvc.archiveSensorHistoryHourData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); + sensorSvc.isFirst = false; + } + } + + // MessageBox.Show("OK"); lbMsgTitle.Text = DateTime.Now.ToString() + " sensor_lackData OK"; } @@ -539,9 +551,12 @@ namespace solarApp //foreach (var item in site_list) //{ + sensorSvc.isFirst = true; foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) { sensorSvc.archiveData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); + sensorSvc.archiveSensorHistoryHourData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); + sensorSvc.isFirst = false; invSvc.archiveData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); siteSvc.archiveData(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); invSvc.report_invDay(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd"));