前端:stationOverview - 運維畫面預設值為:2 維修
This commit is contained in:
parent
1c2097b3cb
commit
26da763cbb
@ -219,7 +219,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string where = "";
|
string where = "";
|
||||||
if (filter.Status == 2)
|
if (filter.Status == 2) //狀態 0:未完成 1:完成 2:未完成-過期 3:完成-過期
|
||||||
{
|
{
|
||||||
where = $"opr.Deleted = 1 ";
|
where = $"opr.Deleted = 1 ";
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
sql += " AND opr.EndTime >= @StartDate";
|
sql += " AND opr.EndTime >= @StartDate";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.WorkType > 0)
|
if (filter.WorkType > 0)//工作項目, 0:清洗 1:巡檢 2:維修
|
||||||
{
|
{
|
||||||
filter.WorkType -= 1;
|
filter.WorkType -= 1;
|
||||||
sql += @" AND opr.WorkType = @WorkType";
|
sql += @" AND opr.WorkType = @WorkType";
|
||||||
|
|||||||
@ -162,7 +162,7 @@
|
|||||||
<script>
|
<script>
|
||||||
var localurl = this.location.href;
|
var localurl = this.location.href;
|
||||||
var powerids = new Array(0);//當前選擇電站
|
var powerids = new Array(0);//當前選擇電站
|
||||||
var Type = 0; // 項目
|
var Type = 2; // //工作項目, 0:清洗 1:巡檢 2:維修
|
||||||
var stationId;
|
var stationId;
|
||||||
var errortoID;
|
var errortoID;
|
||||||
var powerStationData;
|
var powerStationData;
|
||||||
|
|||||||
@ -43,6 +43,7 @@ namespace solarApp.Service
|
|||||||
_siteID = siteID;
|
_siteID = siteID;
|
||||||
//搬移的月份
|
//搬移的月份
|
||||||
move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
|
move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
|
||||||
|
//move_month = System.DateTime.Now.ToString("yyyy-MM"); //這個月
|
||||||
//_date1 = date1;
|
//_date1 = date1;
|
||||||
get_siteInfo();
|
get_siteInfo();
|
||||||
checkTable();
|
checkTable();
|
||||||
|
|||||||
@ -5,6 +5,8 @@ using MySql.Data.MySqlClient;
|
|||||||
using Dapper;
|
using Dapper;
|
||||||
using solarApp.Model;
|
using solarApp.Model;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
|
using Google.Protobuf.WellKnownTypes;
|
||||||
|
using MySqlX.XDevAPI.Relational;
|
||||||
|
|
||||||
namespace solarApp.Service
|
namespace solarApp.Service
|
||||||
{
|
{
|
||||||
@ -86,10 +88,13 @@ namespace solarApp.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
string sql = "";
|
||||||
|
int rowCT = 0;
|
||||||
|
TimeSpan duration;
|
||||||
if (ds.Count > 0)
|
if (ds.Count > 0)
|
||||||
{
|
{
|
||||||
#region 新增異常值 err_main
|
#region 新增異常值 err_main
|
||||||
string sql = "";
|
|
||||||
string sql_header = "INSERT INTO `err_main`(`id`, `timestamp`, `datestamp`, `uuidHash`, `uuid`, `isOpen`, `sourceState`, `ackState`, `ackRequired`, `alarmClass`, `priority`, `normalTime`, `ackTime`, `userAccount`, `alarmTransition`, `lastUpdate`) ";
|
string sql_header = "INSERT INTO `err_main`(`id`, `timestamp`, `datestamp`, `uuidHash`, `uuid`, `isOpen`, `sourceState`, `ackState`, `ackRequired`, `alarmClass`, `priority`, `normalTime`, `ackTime`, `userAccount`, `alarmTransition`, `lastUpdate`) ";
|
||||||
foreach (var item in ds)
|
foreach (var item in ds)
|
||||||
{ // //{item.uuidHash}, '{Convert.ToBase64String(item.uuid)}'
|
{ // //{item.uuidHash}, '{Convert.ToBase64String(item.uuid)}'
|
||||||
@ -97,8 +102,8 @@ namespace solarApp.Service
|
|||||||
, {item.isOpen}, {item.sourceState}, {item.ackState}, {item.ackRequired}, {item.alarmClass}, {item.priority}, {item.normalTime}, {item.ackTime}
|
, {item.isOpen}, {item.sourceState}, {item.ackState}, {item.ackRequired}, {item.alarmClass}, {item.priority}, {item.normalTime}, {item.ackTime}
|
||||||
, '{item.userAccount}', {item.alarmTransition}, {item.lastUpdate}); ";
|
, '{item.userAccount}', {item.alarmTransition}, {item.lastUpdate}); ";
|
||||||
}
|
}
|
||||||
int rowCT = conn.Execute(sql, commandTimeout: 600);
|
rowCT = conn.Execute(sql, commandTimeout: 600);
|
||||||
TimeSpan duration = DateTime.Now - dt_start;
|
duration = DateTime.Now - dt_start;
|
||||||
arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null);
|
arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -152,6 +157,7 @@ namespace solarApp.Service
|
|||||||
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);
|
||||||
#endregion
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
#region 更新全部的燈號
|
#region 更新全部的燈號
|
||||||
dt_start = DateTime.Now;
|
dt_start = DateTime.Now;
|
||||||
@ -162,8 +168,8 @@ namespace solarApp.Service
|
|||||||
site_id, alarmID, datestamp, HealthStatus
|
site_id, alarmID, datestamp, HealthStatus
|
||||||
from (
|
from (
|
||||||
select site_id, datestamp, sourceState, id alarmID,
|
select site_id, datestamp, sourceState, id alarmID,
|
||||||
case when alarmClass = 1 then 3 # Network 控制盒斷線 - 紅燈
|
case when alarmClass = 2 then 3 # Network 控制盒斷線 - 紅燈
|
||||||
when alarmClass != 1 then 2 end HealthStatus # inv, sensor 異常 黃燈
|
when alarmClass != 2 then 2 end HealthStatus # inv, sensor 異常 黃燈
|
||||||
from err_main
|
from err_main
|
||||||
where sourceState = 1 and left(site_id , 1) = '0'
|
where sourceState = 1 and left(site_id , 1) = '0'
|
||||||
and datestamp > '{System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'
|
and datestamp > '{System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'
|
||||||
@ -200,7 +206,6 @@ namespace solarApp.Service
|
|||||||
arclog.insert_log("0", "syncError s6 inv health", duration.TotalSeconds, "", "err_main", "0", "", rowCT.ToString(), conn, null);
|
arclog.insert_log("0", "syncError s6 inv health", duration.TotalSeconds, "", "err_main", "0", "", rowCT.ToString(), conn, null);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
conn.Close();
|
conn.Close();
|
||||||
}
|
}
|
||||||
result = true;
|
result = true;
|
||||||
|
|||||||
2
solarApp/fmArchive.Designer.cs
generated
2
solarApp/fmArchive.Designer.cs
generated
@ -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 06-28 拯救 Kevin";
|
this.Text = "fmArchive 07-01 拯救 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);
|
||||||
|
|||||||
@ -192,7 +192,7 @@ namespace solarApp
|
|||||||
|
|
||||||
//水位管理 每月 20 日 晚上8點
|
//水位管理 每月 20 日 晚上8點
|
||||||
if (System.DateTime.Now.Day == 20 && System.DateTime.Now.Hour == 20 && DateTime.Now.Minute == 00
|
if (System.DateTime.Now.Day == 20 && System.DateTime.Now.Hour == 20 && DateTime.Now.Minute == 00
|
||||||
&& (DateTime.Now.Second >= 0 && DateTime.Now.Second <= 10)
|
&& (DateTime.Now.Second >= 0 && DateTime.Now.Second <= 20)
|
||||||
&& autoTask == false)
|
&& autoTask == false)
|
||||||
{
|
{
|
||||||
autoTask = true;
|
autoTask = true;
|
||||||
@ -679,15 +679,16 @@ namespace solarApp
|
|||||||
if (CanDoSend)
|
if (CanDoSend)
|
||||||
{
|
{
|
||||||
SMTPConfig smtp = new SMTPConfig(); ;
|
SMTPConfig smtp = new SMTPConfig(); ;
|
||||||
smtp.Host = "msr.hinet.net";
|
//smtp.Host = "msr.hinet.net";
|
||||||
//smtp.UserName = "ficgreen01@gmail.com";
|
//smtp.UserName = "ficgreen01@gmail.com";
|
||||||
//smtp.Password = "qwe2015qwe";
|
//smtp.Password = "qwe2015qwe";
|
||||||
//smtp.UserName = "ficgreen02@gmail.com";
|
//smtp.UserName = "ficgreen02@gmail.com";
|
||||||
//smtp.Password = "qwe20150504qwe";
|
//smtp.Password = "qwe20150504qwe";
|
||||||
//smtp.UserName = "shanghohui@gmail.com";
|
//smtp.UserName = "shanghohui@gmail.com";
|
||||||
//smtp.Password = "wswgnluvoodfexrb";
|
//smtp.Password = "wswgnluvoodfexrb";
|
||||||
//smtp.EnableSsl = true;
|
smtp.Host = "smtp.gmail.com";
|
||||||
//smtp.Port = 587;
|
smtp.EnableSsl = true;
|
||||||
|
smtp.Port = 587;
|
||||||
smtp.UserName = tbUserName.Text;
|
smtp.UserName = tbUserName.Text;
|
||||||
smtp.Password = tbPassword.Text;
|
smtp.Password = tbPassword.Text;
|
||||||
if (rbSSL.Checked)
|
if (rbSSL.Checked)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user