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"));