From 14fcbd54d61732d892325f60ea0f58406a35af62 Mon Sep 17 00:00:00 2001 From: GiteaAdmin Date: Mon, 20 Mar 2023 15:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E4=BD=8D=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E8=87=AA=E5=8B=95=E5=8F=96=E5=BE=97=EF=BC=8C?= =?UTF-8?q?=E7=95=B0=E5=B8=B8=E8=B3=87=E6=96=99=E9=87=8D=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/appsettings.Staging.json | 10 ++++---- solarApp/Service/procInvSvc.cs | 1 + solarApp/Service/procSyncError.cs | 10 ++++---- solarApp/fmArchive.Designer.cs | 36 ++++++++++++++--------------- solarApp/fmArchive.cs | 33 ++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 28 deletions(-) diff --git a/SolarPower/appsettings.Staging.json b/SolarPower/appsettings.Staging.json index e4f3a12..ee95355 100644 --- a/SolarPower/appsettings.Staging.json +++ b/SolarPower/appsettings.Staging.json @@ -6,8 +6,8 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "LoginExpireMinute": 60, //登入到期時間,單位(分) - "GoBackDay": 1, //補償機制(背景執行(每天)),回推天數 + "LoginExpireMinute": 60, //嚙緯嚙皚嚙踝蕭嚙踝蕭伅嚙踝蕭A嚙踝蕭嚙(嚙踝蕭) + "GoBackDay": 1, //嚙踝蕭嚙緞嚙踝蕭嚙踝蕭(嚙瘢嚙踝蕭嚙踝蕭嚙踝蕭(嚙瘠嚙踝蕭))嚙璀嚙稷嚙踝蕭嚙諸潘蕭 //"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": "MWAxcj1mgmbZ8tB6NgApnQ==", "port": "CY1x+1WYXRCBab3wKnBCOQ==", @@ -25,7 +25,7 @@ "Root": "pBX64+ALGFnLiHGRFXNh7w==", "Password": "y4uPqlH9ncTgR/I07qpwaA==" }, - // FIC 預發佈環境 + // FIC 嚙緩嚙緻嚙瘦嚙踝蕭嚙 //"DBConfig": { // "Server": "MWAxcj1mgmbZ8tB6NgApnQ==", // "port": "CY1x+1WYXRCBab3wKnBCOQ==", @@ -49,7 +49,7 @@ "Password": "wswgnluvoodfexrb", "EnableSsl": true }, - "ExceptionTimes": 240, //異常通知時間,單位(分鐘) + "ExceptionTimes": 240, //嚙踝蕭嚙窯嚙緬嚙踝蕭嚙褕塚蕭嚙璀嚙踝蕭嚙(嚙踝蕭嚙踝蕭) "ExceptionTimes_Priority1": 1440, "ExceptionTimes_Priority2": 720, "ExceptionTimes_Priority3": 0 diff --git a/solarApp/Service/procInvSvc.cs b/solarApp/Service/procInvSvc.cs index 649af35..7f1c51c 100644 --- a/solarApp/Service/procInvSvc.cs +++ b/solarApp/Service/procInvSvc.cs @@ -746,6 +746,7 @@ set a.inv_02 = b.inv_02 "); TimeSpan duration = DateTime.Now - dt_start3; arclog.insert_log(_powerStationID, "report_day step3 update inv02", duration.TotalSeconds, "inverter_history_hour", "report_invday", "0", "", rowCT.ToString(), conn, cmd); + } catch (Exception ex) { diff --git a/solarApp/Service/procSyncError.cs b/solarApp/Service/procSyncError.cs index 248aab2..2ee029b 100644 --- a/solarApp/Service/procSyncError.cs +++ b/solarApp/Service/procSyncError.cs @@ -58,7 +58,7 @@ namespace solarApp.Service #endregion - #region 敺撠芸甇亦啣虜鞈 + #region 敺撠芸甇亦啣虜鞈 ss = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id from alarmorion_orionalarmrecord "; var ds_max = conn.Query(ss, commandTimeout: 600).AsList(); @@ -109,7 +109,7 @@ namespace solarApp.Service errValue = SUBSTRING_INDEX( SUBSTRING_INDEX(`value`, '@', 1) # @Xstring --> e:7 , ':', -1) - where facetName = 4 and alarm in ({sb.ToString()});"; + where facetName = 8 and alarm in ({sb.ToString()});"; rowCT = conn.Execute(sql, commandTimeout: 600); duration = DateTime.Now - dt_start; arclog.insert_log("0", "syncError s2 errValue", duration.TotalSeconds, "facetvalue4", "err_main", "0", "", rowCT.ToString(), conn, null); @@ -126,7 +126,7 @@ namespace solarApp.Service SUBSTRING_INDEX(SUBSTRING_INDEX(`value`, ':', -1) # : 敺Xstring ,'S', -1) , 1, 9) - where facetName = 8 and a.site_id is null and a.datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';"; + where facetName = 2 and a.site_id is null and a.datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';"; rowCT = conn.Execute(sql, commandTimeout: 600); duration = DateTime.Now - dt_start; arclog.insert_log("0", "syncError s3 errDevice", duration.TotalSeconds, "facetValue8", "err_main", "0", "", rowCT.ToString(), conn, null); @@ -146,8 +146,8 @@ namespace solarApp.Service #region update 啣虜閮 sql = $@" update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm - set a.errMsg = b.errMsg - where facetName = 6 and alarm in ({sb.ToString()});"; + set a.errMsg = unicode_decode(b.value) + where facetName = 1 and alarm in ({sb.ToString()});"; rowCT = conn.Execute(sql, commandTimeout: 600); duration = DateTime.Now - dt_start; arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null); diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index 4133ae9..c8a7217 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(); @@ -70,6 +70,7 @@ namespace solarApp this.tabPage5 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.bt_MoveRawData = new System.Windows.Forms.Button(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.panel2 = new System.Windows.Forms.Panel(); this.lbReceiver = new System.Windows.Forms.Label(); @@ -88,7 +89,6 @@ 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.bt_MoveRawData = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -394,8 +394,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); @@ -411,8 +411,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); @@ -570,6 +570,16 @@ namespace solarApp this.splitContainer2.SplitterWidth = 10; this.splitContainer2.TabIndex = 1; // + // bt_MoveRawData + // + this.bt_MoveRawData.Location = new System.Drawing.Point(59, 425); + this.bt_MoveRawData.Name = "bt_MoveRawData"; + this.bt_MoveRawData.Size = new System.Drawing.Size(148, 65); + this.bt_MoveRawData.TabIndex = 18; + this.bt_MoveRawData.Text = "MoveRawData"; + this.bt_MoveRawData.UseVisualStyleBackColor = true; + this.bt_MoveRawData.Click += new System.EventHandler(this.bt_MoveRawData_Click); + // // richTextBox1 // this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -743,16 +753,6 @@ namespace solarApp // this.timer1.Interval = 10000; // - // bt_MoveRawData - // - this.bt_MoveRawData.Location = new System.Drawing.Point(59, 425); - this.bt_MoveRawData.Name = "bt_MoveRawData"; - this.bt_MoveRawData.Size = new System.Drawing.Size(148, 65); - this.bt_MoveRawData.TabIndex = 18; - this.bt_MoveRawData.Text = "MoveRawData"; - this.bt_MoveRawData.UseVisualStyleBackColor = true; - this.bt_MoveRawData.Click += new System.EventHandler(this.bt_MoveRawData_Click); - // // fmArchive // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); @@ -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 11-15"; + this.Text = "fmArchive 03-20 舀 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 4d4817b..ccfecf8 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -136,6 +136,35 @@ namespace solarApp //bt_archive_Click.PerformClick(); } + #region 鋆甇豢鞈 2023-01-24 and 01-27 + //if ((DateTime.Now.ToString("yyyy-MM-dd") == "2023-02-01")) + //{ + // if (DateTime.Now.Hour == 01 && DateTime.Now.Minute == 30) + // { + // //MessageBox.Show("ok"); + // autoTask = true; + // lbMsgTitle.Text = DateTime.Now.ToString() + " timer start"; + // dtSelect1.Value = System.DateTime.Now.AddDays(-8); + // dtSelect2.Value = System.DateTime.Now.AddDays(-8); + // bt_archive.PerformClick(); + // autoTask = false; + // //bt_archive_Click.PerformClick(); + // } + // //2023-01-27 + // if (DateTime.Now.Hour == 03 && DateTime.Now.Minute == 00) + // { + // //MessageBox.Show("ok"); + // autoTask = true; + // lbMsgTitle.Text = DateTime.Now.ToString() + " timer start"; + // dtSelect1.Value = System.DateTime.Now.AddDays(-5); + // dtSelect2.Value = System.DateTime.Now.AddDays(-5); + // bt_archive.PerformClick(); + // autoTask = false; + // //bt_archive_Click.PerformClick(); + // } + //} + #endregion + //啣虜 瘥 5頝銝甈 if ((DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && (autoTask == false)) { @@ -709,6 +738,10 @@ namespace solarApp private void btSendMail_Click(object sender, EventArgs e) { + + //tbUserName.Text = "service@mjmtech.com.tw"; //ficgreen01@gmail.com qwe2015qwe + //tbPassword.Text = "jqMZyHMM8B2Y2gP&"; + List user = new List(); user.Add(tbReceiver.Text.Trim()); List file = new List();