From 401dd663d8fa76110f7bf2dccbdd5a9b275f3c36 Mon Sep 17 00:00:00 2001 From: cesar liu Date: Mon, 26 Sep 2022 10:44:09 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20winfrom=20=E7=B4=85=E7=B6=A0=E7=87=88?= =?UTF-8?q?=E9=A1=8F=E8=89=B2=E8=AE=8A=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Controllers/UserController.cs | 20 +++++++++---------- SolarPower/appsettings.Development.json | 10 +++++----- solarApp/Service/archiveLowData.cs | 12 ++++++------ solarApp/Service/procSyncError.cs | 4 ++-- solarApp/fmArchive.Designer.cs | 25 ++++++++++++++++++------ 5 files changed, 42 insertions(+), 29 deletions(-) diff --git a/SolarPower/Controllers/UserController.cs b/SolarPower/Controllers/UserController.cs index 2c3d0bf..f6e3def 100644 --- a/SolarPower/Controllers/UserController.cs +++ b/SolarPower/Controllers/UserController.cs @@ -720,20 +720,20 @@ namespace SolarPower.Controllers }; await userRepository.UpdatePassword(update, properties); - var website_url = await powerStationRepository.GetOneVariableByName("WebSiteUrl"); + //var website_url = await powerStationRepository.GetOneVariableByName("WebSiteUrl"); - var sendSubject = "密碼更改成功"; - var sendContent = $@"您的新密碼為: { defPasswd} -
立即前往:{website_url}"; + //var sendSubject = "密碼更改成功"; + //var sendContent = $@"您的新密碼為: { defPasswd} + //
立即前往:{website_url}"; - List recipientEmails = new List() - { - user.Email - }; + //List recipientEmails = new List() + //{ + // user.Email + //}; - sendEmailService.Send(recipientEmails, sendSubject, sendContent); + //sendEmailService.Send(recipientEmails, sendSubject, sendContent); apiResult.Code = "0000"; - apiResult.Msg = "變更成功"; + apiResult.Msg = "密碼重置成功為六個零!"; } else { diff --git a/SolarPower/appsettings.Development.json b/SolarPower/appsettings.Development.json index a99f73e..d6045f4 100644 --- a/SolarPower/appsettings.Development.json +++ b/SolarPower/appsettings.Development.json @@ -6,8 +6,8 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "LoginExpireMinute": 60, //nJɶA() - "GoBackDay": 1, //v(I(C))A^Ѽ + "LoginExpireMinute": 60, //�n�J����ɶ��A���(��) + "GoBackDay": 1, //���v����(�I������(�C��))�A�^���Ѽ� //"DBConfig": { // "Server": "MVgHWzR3rGDgD57TUoFunA==", // "port": "r4AoXMUDodcQjIzofGNCcg==", @@ -17,7 +17,7 @@ //}, //"mySql": "server=210.61.91.43;user=idafenweb;Database=solar_master;Port=10068;password=P@ssw0rd;charset='utf8';pooling=true;sslmode=none;", "mySql": "server=60.251.164.103;user=webuser;Database=solar_master;Port=11306;password=FICadmin99;charset='utf8';pooling=true;sslmode=none;", - // + //������� "DBConfig": { "Server": "AVXfxd+IRlLtJ0MCi9HU1g==", "port": "CrEmevYrUsSo7Mkb7Gxn8A==", @@ -25,7 +25,7 @@ "Root": "Aph7AzoiwAmmBHCfS1rqeQ==", "Password": "8WMHBEWuT0XoAB4kzduQHA==" }, - // FIC woG + // FIC �w�o�G��� //"DBConfig": { // "Server": "MWAxcj1mgmbZ8tB6NgApnQ==", // "port": "CY1x+1WYXRCBab3wKnBCOQ==", @@ -49,7 +49,7 @@ "Password": "wswgnluvoodfexrb", "EnableSsl": true }, - "ExceptionTimes": 240, //`qɶA() + "ExceptionTimes": 240, //���`�q���ɶ��A���(����) "ExceptionTimes_Priority1": 1440, "ExceptionTimes_Priority2": 720, "ExceptionTimes_Priority3": 0 diff --git a/solarApp/Service/archiveLowData.cs b/solarApp/Service/archiveLowData.cs index cdb6640..d15cbca 100644 --- a/solarApp/Service/archiveLowData.cs +++ b/solarApp/Service/archiveLowData.cs @@ -290,7 +290,7 @@ namespace solarApp.Service //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】開始執行[{_siteDB}.s{_siteID}_station]的資料表向[{_siteDB}_history.s{_siteID}_station]搬移"); string for_insert_station = $@"INSERT {_siteDB}_history.s{_siteID01}_station(`ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `KWH`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`, `PR`, `MP`, `SOLARHOUR`, `insertTime`) SELECT `ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `KWH`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`, `PR`, `MP`, `SOLARHOUR`, `insertTime` FROM {_siteDB}.s{_siteID01}_station - WHERE FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') < '2022-07'"; + WHERE FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') < '2022-08'"; int rowCT = conn.Execute(for_insert_station, commandTimeout : 600); // System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_station的七月前資料寫入至{_siteDB}_history.s{_siteID}_station【寫入成功】於{dateTime}"); @@ -303,7 +303,7 @@ namespace solarApp.Service //刪除原本的資料 string for_delete_station = $@"DELETE FROM {_siteDB}.s{_siteID01}_station - WHERE FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') < '2022-07'"; + WHERE FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') < '2022-08'"; rowCT = conn.Execute(for_delete_station, commandTimeout: 600); //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_sensoravg搬移至{_siteDB}_history.s{_siteID}_sensoravg【搬移資料成功】於{dateTime} 共 {delete_station.ToString()} 筆"); duration = DateTime.Now - dt_start1; @@ -346,7 +346,7 @@ namespace solarApp.Service // System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】開始執行[{_siteDB}.s{_siteID}_inv]的資料表向[{_siteDB}_history.s{_siteID}_inv]搬移"); string for_insert_inv = $@"INSERT {_siteDB}_history.s{_siteID01}_inv(`ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `INVERTERID`, `SN`, `AC1V`, `AC1A`, `AC1W`, `AC1F`, `AC1WH`, `AC2V`, `AC2A`, `AC2W`, `AC2F`, `AC2WH`, `AC3V`, `AC3A`, `AC3W`, `AC3F`, `AC3WH`, `ACRUNTIME`, `DC1V`, `DC1A`, `DC1W`, `DC1WH`, `DC2V`, `DC2A`, `DC2W`, `DC2WH`, `DC3V`, `DC3A`, `DC3W`, `DC3WH`, `DC4V`, `DC4A`, `DC4W`, `DC4WH`, `DC5V`, `DC5A`, `DC5W`, `DC5WH`, `DCRUNTIME`, `WH`, `TODAYKWH`, `TOTALKWH`, `PR`, `RA1`, `RA2`, `RA3`, `RA4`, `RA5`, `CrdTime`) SELECT `ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `INVERTERID`, `SN`, `AC1V`, `AC1A`, `AC1W`, `AC1F`, `AC1WH`, `AC2V`, `AC2A`, `AC2W`, `AC2F`, `AC2WH`, `AC3V`, `AC3A`, `AC3W`, `AC3F`, `AC3WH`, `ACRUNTIME`, `DC1V`, `DC1A`, `DC1W`, `DC1WH`, `DC2V`, `DC2A`, `DC2W`, `DC2WH`, `DC3V`, `DC3A`, `DC3W`, `DC3WH`, `DC4V`, `DC4A`, `DC4W`, `DC4WH`, `DC5V`, `DC5A`, `DC5W`, `DC5WH`, `DCRUNTIME`, `WH`, `TODAYKWH`, `TOTALKWH`, `PR`, `RA1`, `RA2`, `RA3`, `RA4`, `RA5`, `CrdTime` FROM {_siteDB}.s{_siteID01}_inv - WHERE LEFT(crdTime, 7) < '2022-07' "; + WHERE LEFT(crdTime, 7) < '2022-08' "; int rowCT = conn.Execute(for_insert_inv, commandTimeout: 6000); //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_inv的七月前資料寫入至{_siteDB}_history.s{_siteID}_inv【寫入成功】於{dateTime}"); // log @@ -356,7 +356,7 @@ namespace solarApp.Service dt_start1 = DateTime.Now; string for_delete_inv = $@"DELETE FROM {_siteDB}.s{_siteID01}_inv - WHERE LEFT(crdTime, 7) < '2022-07'"; + WHERE LEFT(crdTime, 7) < '2022-08'"; rowCT = conn.Execute(for_delete_inv, commandTimeout: 6000); //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_sensoravg搬移至{_siteDB}_history.s{_siteID}_sensoravg【搬移資料成功】於{dateTime} 共 {delete_inv.ToString()} 筆"); duration = DateTime.Now - dt_start1; @@ -391,14 +391,14 @@ namespace solarApp.Service //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】開始執行[{_siteDB}.s{_siteID}_sensoravg]的資料表向[{_siteDB}_history.s{_siteID}_sensoravg]搬移"); string for_insert_sensoravg = $@"INSERT {_siteDB}_history.s{_siteID01}_sensoravg(`ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `SENSORAVG01`, `SENSORAVG02`, `SENSORAVG03`, `SENSORAVG04`, `SENSORAVG05`, `SENSORAVG06`, `SENSORAVG07`, `SENSORAVG08`, `SENSORAVG09`, `SENSORAVG10`, `SENSORAVG11`, `SENSORAVG12`, `SENSORAVG13`, `SENSORAVG14`, `SENSORAVG15`, `SENSORAVG16`, `SENSORAVG17`, `SENSORAVG18`, `SENSORAVG19`, `SENSORAVG20`, `SENSORAVG21`, `SENSORAVG22`, `SENSORAVG23`, `SENSORAVG24`, `SENSORAVG25`, `SENSORAVG26`, `SENSORAVG27`, `SENSORAVG28`, `SENSORAVG29`, `SENSORAVG30`, `SENSORAVG31`, `SENSORAVG32`, `SENSORAVG33`, `SENSORAVG34`, `SENSORAVG35`, `SENSORAVG36`, `SENSORAVG37`, `SENSORAVG38`, `SENSORAVG39`, `SENSORAVG40`, `SENSORAVG41`, `SENSORAVG42`, `SENSORAVG43`, `SENSORAVG44`, `SENSORAVG45`, `SENSORAVG46`, `SENSORAVG47`, `SENSORAVG48`, `SENSORAVG49`, `SENSORAVG50`, `CrdTime`) SELECT `ID`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `CONTROLLERID`, `SENSORAVG01`, `SENSORAVG02`, `SENSORAVG03`, `SENSORAVG04`, `SENSORAVG05`, `SENSORAVG06`, `SENSORAVG07`, `SENSORAVG08`, `SENSORAVG09`, `SENSORAVG10`, `SENSORAVG11`, `SENSORAVG12`, `SENSORAVG13`, `SENSORAVG14`, `SENSORAVG15`, `SENSORAVG16`, `SENSORAVG17`, `SENSORAVG18`, `SENSORAVG19`, `SENSORAVG20`, `SENSORAVG21`, `SENSORAVG22`, `SENSORAVG23`, `SENSORAVG24`, `SENSORAVG25`, `SENSORAVG26`, `SENSORAVG27`, `SENSORAVG28`, `SENSORAVG29`, `SENSORAVG30`, `SENSORAVG31`, `SENSORAVG32`, `SENSORAVG33`, `SENSORAVG34`, `SENSORAVG35`, `SENSORAVG36`, `SENSORAVG37`, `SENSORAVG38`, `SENSORAVG39`, `SENSORAVG40`, `SENSORAVG41`, `SENSORAVG42`, `SENSORAVG43`, `SENSORAVG44`, `SENSORAVG45`, `SENSORAVG46`, `SENSORAVG47`, `SENSORAVG48`, `SENSORAVG49`, `SENSORAVG50`, `CrdTime` FROM {_siteDB}.s{_siteID01}_sensoravg - WHERE LEFT(crdTime, 7) < '2022-07'"; + WHERE LEFT(crdTime, 7) < '2022-08'"; int rowCT = conn.Execute(for_insert_sensoravg, commandTimeout: 600); // log TimeSpan duration = DateTime.Now - dt_start1; arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", $"{_siteDB}_history.s{_siteID01}_sensoravg", "0", "", rowCT.ToString(), conn, null); dt_start1 = DateTime.Now; - string for_delete_sensoravg = $@"DELETE FROM {_siteDB}.s{_siteID01}_sensoravg WHERE LEFT(crdTime, 7) < '2022-07'"; + string for_delete_sensoravg = $@"DELETE FROM {_siteDB}.s{_siteID01}_sensoravg WHERE LEFT(crdTime, 7) < '2022-08'"; rowCT = conn.Execute(for_delete_sensoravg, commandTimeout: 600); duration = DateTime.Now - dt_start1; diff --git a/solarApp/Service/procSyncError.cs b/solarApp/Service/procSyncError.cs index e109cb5..3d95c3f 100644 --- a/solarApp/Service/procSyncError.cs +++ b/solarApp/Service/procSyncError.cs @@ -162,8 +162,8 @@ namespace solarApp.Service site_id, alarmID, datestamp, HealthStatus from ( select site_id, datestamp, sourceState, id alarmID, - case when alarmClass = 14 then 3 # Network 控制盒斷線 - 紅燈 - when alarmClass != 14 then 2 end HealthStatus # inv, sensor 異常 黃燈 + case when alarmClass = 31 then 3 # Network 控制盒斷線 - 紅燈 + when alarmClass != 31 then 2 end HealthStatus # inv, sensor 異常 黃燈 from err_main where sourceState = 1 and left(site_id , 1) = '0' and datestamp > '{ System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}' diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index f31f64f..fc0ecf1 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 dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = 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(); @@ -88,6 +88,7 @@ namespace solarApp this.tbUserName = new System.Windows.Forms.TextBox(); this.btSendMail = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); + this.button1 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -392,8 +393,8 @@ namespace solarApp // this.gv_inv_detail.AllowUserToAddRows = false; this.gv_inv_detail.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; 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); @@ -409,8 +410,8 @@ namespace solarApp // this.gv_rpt_invDay.AllowUserToAddRows = false; this.gv_rpt_invDay.AllowUserToDeleteRows = false; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; 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); @@ -580,6 +581,7 @@ namespace solarApp // panel2 // this.panel2.BackColor = System.Drawing.Color.Moccasin; + this.panel2.Controls.Add(this.button1); this.panel2.Controls.Add(this.lbReceiver); this.panel2.Controls.Add(this.tbReceiver); this.panel2.Controls.Add(this.gbox); @@ -743,6 +745,16 @@ namespace solarApp // this.timer1.Interval = 10000; // + // button1 + // + this.button1.Location = new System.Drawing.Point(1288, 73); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(94, 29); + this.button1.TabIndex = 17; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click_1); + // // fmArchive // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); @@ -834,5 +846,6 @@ namespace solarApp private System.Windows.Forms.Label lbMsgStatus; private System.Windows.Forms.TabPage tabPage5; private System.Windows.Forms.Button btSyncErr; + private System.Windows.Forms.Button button1; } } \ No newline at end of file