水位管理 月份自動取得,異常資料重建
This commit is contained in:
parent
9202857ee4
commit
14fcbd54d6
@ -6,8 +6,8 @@
|
|||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"LoginExpireMinute": 60, //登入到期時間,單位(分)
|
"LoginExpireMinute": 60, //<EFBFBD>n<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>)
|
||||||
"GoBackDay": 1, //補償機制(背景執行(每天)),回推天數
|
"GoBackDay": 1, //<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD>I<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD>C<EFBFBD><EFBFBD>))<EFBFBD>A<EFBFBD>^<EFBFBD><EFBFBD><EFBFBD>Ѽ<EFBFBD>
|
||||||
//"DBConfig": {
|
//"DBConfig": {
|
||||||
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
|
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
|
||||||
// "port": "r4AoXMUDodcQjIzofGNCcg==",
|
// "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=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;",
|
"mySql": "server=60.251.164.103;user=webuser;Database=solar_master;Port=11306;password=FICadmin99;charset='utf8';pooling=true;sslmode=none;",
|
||||||
//正式環境
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
"DBConfig": {
|
"DBConfig": {
|
||||||
"Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
|
"Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
|
||||||
"port": "CY1x+1WYXRCBab3wKnBCOQ==",
|
"port": "CY1x+1WYXRCBab3wKnBCOQ==",
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"Root": "pBX64+ALGFnLiHGRFXNh7w==",
|
"Root": "pBX64+ALGFnLiHGRFXNh7w==",
|
||||||
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
|
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
|
||||||
},
|
},
|
||||||
// FIC 預發佈環境
|
// FIC <EFBFBD>w<EFBFBD>o<EFBFBD>G<EFBFBD><EFBFBD><EFBFBD>
|
||||||
//"DBConfig": {
|
//"DBConfig": {
|
||||||
// "Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
|
// "Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
|
||||||
// "port": "CY1x+1WYXRCBab3wKnBCOQ==",
|
// "port": "CY1x+1WYXRCBab3wKnBCOQ==",
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"Password": "wswgnluvoodfexrb",
|
"Password": "wswgnluvoodfexrb",
|
||||||
"EnableSsl": true
|
"EnableSsl": true
|
||||||
},
|
},
|
||||||
"ExceptionTimes": 240, //異常通知時間,單位(分鐘)
|
"ExceptionTimes": 240, //<EFBFBD><EFBFBD><EFBFBD>`<EFBFBD>q<EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
"ExceptionTimes_Priority1": 1440,
|
"ExceptionTimes_Priority1": 1440,
|
||||||
"ExceptionTimes_Priority2": 720,
|
"ExceptionTimes_Priority2": 720,
|
||||||
"ExceptionTimes_Priority3": 0
|
"ExceptionTimes_Priority3": 0
|
||||||
|
|||||||
@ -746,6 +746,7 @@ set a.inv_02 = b.inv_02 ");
|
|||||||
|
|
||||||
TimeSpan duration = DateTime.Now - dt_start3;
|
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);
|
arclog.insert_log(_powerStationID, "report_day step3 update inv02", duration.TotalSeconds, "inverter_history_hour", "report_invday", "0", "", rowCT.ToString(), conn, cmd);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,7 +58,7 @@ namespace solarApp.Service
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 取得尚未同步的異常資料
|
#region 取得尚未同步的異常資料
|
||||||
ss = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id
|
ss = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id
|
||||||
from alarmorion_orionalarmrecord ";
|
from alarmorion_orionalarmrecord ";
|
||||||
var ds_max = conn.Query<max_id>(ss, commandTimeout: 600).AsList<max_id>();
|
var ds_max = conn.Query<max_id>(ss, commandTimeout: 600).AsList<max_id>();
|
||||||
@ -109,7 +109,7 @@ namespace solarApp.Service
|
|||||||
errValue = SUBSTRING_INDEX(
|
errValue = SUBSTRING_INDEX(
|
||||||
SUBSTRING_INDEX(`value`, '@', 1) # @前面所有string --> e:7
|
SUBSTRING_INDEX(`value`, '@', 1) # @前面所有string --> e:7
|
||||||
, ':', -1)
|
, ':', -1)
|
||||||
where facetName = 4 and alarm in ({sb.ToString()});";
|
where facetName = 8 and alarm in ({sb.ToString()});";
|
||||||
rowCT = conn.Execute(sql, commandTimeout: 600);
|
rowCT = conn.Execute(sql, commandTimeout: 600);
|
||||||
duration = DateTime.Now - dt_start;
|
duration = DateTime.Now - dt_start;
|
||||||
arclog.insert_log("0", "syncError s2 errValue", duration.TotalSeconds, "facetvalue4", "err_main", "0", "", rowCT.ToString(), conn, null);
|
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) # : 後面所有string
|
SUBSTRING_INDEX(SUBSTRING_INDEX(`value`, ':', -1) # : 後面所有string
|
||||||
,'S', -1)
|
,'S', -1)
|
||||||
, 1, 9)
|
, 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);
|
rowCT = conn.Execute(sql, commandTimeout: 600);
|
||||||
duration = DateTime.Now - dt_start;
|
duration = DateTime.Now - dt_start;
|
||||||
arclog.insert_log("0", "syncError s3 errDevice", duration.TotalSeconds, "facetValue8", "err_main", "0", "", rowCT.ToString(), conn, null);
|
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 異常訊息
|
#region update 異常訊息
|
||||||
sql = $@" update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm
|
sql = $@" update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm
|
||||||
set a.errMsg = b.errMsg
|
set a.errMsg = unicode_decode(b.value)
|
||||||
where facetName = 6 and alarm in ({sb.ToString()});";
|
where facetName = 1 and alarm in ({sb.ToString()});";
|
||||||
rowCT = conn.Execute(sql, commandTimeout: 600);
|
rowCT = conn.Execute(sql, commandTimeout: 600);
|
||||||
duration = DateTime.Now - dt_start;
|
duration = DateTime.Now - dt_start;
|
||||||
arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null);
|
arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null);
|
||||||
|
|||||||
36
solarApp/fmArchive.Designer.cs
generated
36
solarApp/fmArchive.Designer.cs
generated
@ -30,8 +30,8 @@ namespace solarApp
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
@ -70,6 +70,7 @@ namespace solarApp
|
|||||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.bt_MoveRawData = new System.Windows.Forms.Button();
|
||||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.lbReceiver = new System.Windows.Forms.Label();
|
this.lbReceiver = new System.Windows.Forms.Label();
|
||||||
@ -88,7 +89,6 @@ namespace solarApp
|
|||||||
this.tbUserName = new System.Windows.Forms.TextBox();
|
this.tbUserName = new System.Windows.Forms.TextBox();
|
||||||
this.btSendMail = new System.Windows.Forms.Button();
|
this.btSendMail = new System.Windows.Forms.Button();
|
||||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||||
this.bt_MoveRawData = new System.Windows.Forms.Button();
|
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
this.tabPage1.SuspendLayout();
|
this.tabPage1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
@ -394,8 +394,8 @@ namespace solarApp
|
|||||||
//
|
//
|
||||||
this.gv_inv_detail.AllowUserToAddRows = false;
|
this.gv_inv_detail.AllowUserToAddRows = false;
|
||||||
this.gv_inv_detail.AllowUserToDeleteRows = false;
|
this.gv_inv_detail.AllowUserToDeleteRows = false;
|
||||||
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
||||||
this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
|
||||||
this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.gv_inv_detail.Location = new System.Drawing.Point(768, 75);
|
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.AllowUserToAddRows = false;
|
||||||
this.gv_rpt_invDay.AllowUserToDeleteRows = false;
|
this.gv_rpt_invDay.AllowUserToDeleteRows = false;
|
||||||
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
||||||
this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2;
|
this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
|
||||||
this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left;
|
this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left;
|
||||||
this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75);
|
this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75);
|
||||||
@ -570,6 +570,16 @@ namespace solarApp
|
|||||||
this.splitContainer2.SplitterWidth = 10;
|
this.splitContainer2.SplitterWidth = 10;
|
||||||
this.splitContainer2.TabIndex = 1;
|
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
|
// richTextBox1
|
||||||
//
|
//
|
||||||
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
@ -743,16 +753,6 @@ namespace solarApp
|
|||||||
//
|
//
|
||||||
this.timer1.Interval = 10000;
|
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
|
// fmArchive
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F);
|
||||||
@ -760,7 +760,7 @@ namespace solarApp
|
|||||||
this.ClientSize = new System.Drawing.Size(1782, 953);
|
this.ClientSize = new System.Drawing.Size(1782, 953);
|
||||||
this.Controls.Add(this.tabControl1);
|
this.Controls.Add(this.tabControl1);
|
||||||
this.Name = "fmArchive";
|
this.Name = "fmArchive";
|
||||||
this.Text = "fmArchive 11-15";
|
this.Text = "fmArchive 03-20 拯救 Kevin";
|
||||||
this.Load += new System.EventHandler(this.fmArchive_Load);
|
this.Load += new System.EventHandler(this.fmArchive_Load);
|
||||||
this.tabControl1.ResumeLayout(false);
|
this.tabControl1.ResumeLayout(false);
|
||||||
this.tabPage1.ResumeLayout(false);
|
this.tabPage1.ResumeLayout(false);
|
||||||
|
|||||||
@ -136,6 +136,35 @@ namespace solarApp
|
|||||||
//bt_archive_Click.PerformClick();
|
//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分鐘跑一次
|
//異常處理 每 5分鐘跑一次
|
||||||
if ((DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && (autoTask == false))
|
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)
|
private void btSendMail_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//tbUserName.Text = "service@mjmtech.com.tw"; //ficgreen01@gmail.com qwe2015qwe
|
||||||
|
//tbPassword.Text = "jqMZyHMM8B2Y2gP&";
|
||||||
|
|
||||||
List<string> user = new List<string>();
|
List<string> user = new List<string>();
|
||||||
user.Add(tbReceiver.Text.Trim());
|
user.Add(tbReceiver.Text.Trim());
|
||||||
List<string> file = new List<string>();
|
List<string> file = new List<string>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user