水位管理 月份自動取得,異常資料重建

This commit is contained in:
GiteaAdmin 2023-03-20 15:16:01 +08:00
parent 9202857ee4
commit 14fcbd54d6
5 changed files with 62 additions and 28 deletions

View File

@ -6,8 +6,8 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"LoginExpireMinute": 60, //()
"GoBackDay": 1, //(())
"LoginExpireMinute": 60, //<EFBFBD>n<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>)
"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": {
// "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;",
//
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
"DBConfig": {
"Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
"port": "CY1x+1WYXRCBab3wKnBCOQ==",
@ -25,7 +25,7 @@
"Root": "pBX64+ALGFnLiHGRFXNh7w==",
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
},
// FIC
// FIC <EFBFBD>w<EFBFBD>o<EFBFBD>G<EFBFBD><EFBFBD><EFBFBD>
//"DBConfig": {
// "Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
// "port": "CY1x+1WYXRCBab3wKnBCOQ==",
@ -49,7 +49,7 @@
"Password": "wswgnluvoodfexrb",
"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_Priority2": 720,
"ExceptionTimes_Priority3": 0

View File

@ -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)
{

View File

@ -109,7 +109,7 @@ namespace solarApp.Service
errValue = SUBSTRING_INDEX(
SUBSTRING_INDEX(`value`, '@', 1) # @string --> 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) # : string
,'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);

View File

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

View File

@ -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<string> user = new List<string>();
user.Add(tbReceiver.Text.Trim());
List<string> file = new List<string>();