diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 67527ef..b413f3e 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -393,7 +393,7 @@ namespace SolarPower.Repository.Implement { try { - var sql = @$"SELECT SerialNumber FROM {tableName} + var sql = @$" SELECT SerialNumber FROM {tableName} WHERE CityId = @CityId && AreaId = @AreaId ORDER BY SerialNumber DESC"; result = await conn.QueryFirstOrDefaultAsync(sql, new { CityId = cityId, AreaId = areaId }); diff --git a/solarApp/Service/archiveLowData.cs b/solarApp/Service/archiveLowData.cs index 85af4be..4e9abbc 100644 --- a/solarApp/Service/archiveLowData.cs +++ b/solarApp/Service/archiveLowData.cs @@ -42,7 +42,7 @@ namespace solarApp.Service // string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM"); _siteID = siteID; //搬移的月份 - move_month = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM"); + move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM"); //_date1 = date1; get_siteInfo(); checkTable(); diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index c8a7217..8cbc936 100644 --- a/solarApp/fmArchive.Designer.cs +++ b/solarApp/fmArchive.Designer.cs @@ -30,8 +30,8 @@ namespace solarApp private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); @@ -394,8 +394,8 @@ namespace solarApp // this.gv_inv_detail.AllowUserToAddRows = false; this.gv_inv_detail.AllowUserToDeleteRows = false; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_inv_detail.Location = new System.Drawing.Point(768, 75); @@ -411,8 +411,8 @@ namespace solarApp // this.gv_rpt_invDay.AllowUserToAddRows = false; this.gv_rpt_invDay.AllowUserToDeleteRows = false; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left; this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75); @@ -760,7 +760,7 @@ namespace solarApp this.ClientSize = new System.Drawing.Size(1782, 953); this.Controls.Add(this.tabControl1); this.Name = "fmArchive"; - this.Text = "fmArchive 03-20 拯救 Kevin"; + this.Text = "fmArchive 05-29 拯救 Kevin"; this.Load += new System.EventHandler(this.fmArchive_Load); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index ccfecf8..a76d5da 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -191,24 +191,29 @@ namespace solarApp //水位管理 - //if (System.DateTime.Now.Hour == 03 && DateTime.Now.Minute == 30 - // && (DateTime.Now.Second >= 0 && DateTime.Now.Second <= 10) - // && autoTask == false) - //{ - // int i = 0; - // var site_list = stationSvc.get_station_list(); + if (System.DateTime.Now.Hour == 20 && DateTime.Now.Minute == 00 + && (DateTime.Now.Second >= 0 && DateTime.Now.Second <= 10) + && autoTask == false) + { + autoTask = true; + bt_MoveRawData.PerformClick(); + autoTask = false; + //int i = 0; + //var site_list = stationSvc.get_station_list(); - // archiveLowData archiveData = new archiveLowData(); - // autoTask = true; - // foreach (var item in site_list) - // { - // archiveData.archiveData(item.SiteID.Substring(0, 9)); + //archiveLowData archiveData = new archiveLowData(); + + //bt_MoveRawData_Click + + //foreach (var item in site_list) + //{ + // archiveData.archiveData(item.SiteID.Substring(0, 9)); - // i++; - // } - // autoTask = false; - // lbMsgTitle.Text = System.DateTime.Now.ToString() + " 水位管理 - 資料搬移完成!"; - //} + // i++; + //} + + lbMsgTitle.Text = System.DateTime.Now.ToString() + " 水位管理 - 資料搬移完成!"; + } } private void rb_site_CheckedChanged(object sender, EventArgs e)