前端:stationOverview - 運維畫面預設值為:2 維修

This commit is contained in:
jiahao 2023-08-01 17:37:05 +08:00
parent 1c2097b3cb
commit 26da763cbb
6 changed files with 48 additions and 41 deletions

View File

@ -219,7 +219,7 @@ namespace SolarPower.Repository.Implement
try
{
string where = "";
if (filter.Status == 2)
if (filter.Status == 2) //狀態 0:未完成 1:完成 2:未完成-過期 3:完成-過期
{
where = $"opr.Deleted = 1 ";
}
@ -247,7 +247,7 @@ namespace SolarPower.Repository.Implement
sql += " AND opr.EndTime >= @StartDate";
}
if (filter.WorkType > 0)
if (filter.WorkType > 0)//工作項目, 0:清洗 1:巡檢 2:維修
{
filter.WorkType -= 1;
sql += @" AND opr.WorkType = @WorkType";

View File

@ -162,7 +162,7 @@
<script>
var localurl = this.location.href;
var powerids = new Array(0);//當前選擇電站
var Type = 0; // 項目
var Type = 2; // //工作項目, 0:清洗 1:巡檢 2:維修
var stationId;
var errortoID;
var powerStationData;

View File

@ -43,6 +43,7 @@ namespace solarApp.Service
_siteID = siteID;
//搬移的月份
move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
//move_month = System.DateTime.Now.ToString("yyyy-MM"); //這個月
//_date1 = date1;
get_siteInfo();
checkTable();

View File

@ -5,6 +5,8 @@ using MySql.Data.MySqlClient;
using Dapper;
using solarApp.Model;
using System.Configuration;
using Google.Protobuf.WellKnownTypes;
using MySqlX.XDevAPI.Relational;
namespace solarApp.Service
{
@ -86,10 +88,13 @@ namespace solarApp.Service
}
}
#endregion
string sql = "";
int rowCT = 0;
TimeSpan duration;
if (ds.Count > 0)
{
#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`) ";
foreach (var item in ds)
{ // //{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.userAccount}', {item.alarmTransition}, {item.lastUpdate}); ";
}
int rowCT = conn.Execute(sql, commandTimeout: 600);
TimeSpan duration = DateTime.Now - dt_start;
rowCT = conn.Execute(sql, commandTimeout: 600);
duration = DateTime.Now - dt_start;
arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null);
#endregion
@ -152,6 +157,7 @@ namespace solarApp.Service
duration = DateTime.Now - dt_start;
arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null);
#endregion
}
#region
dt_start = DateTime.Now;
@ -162,11 +168,11 @@ namespace solarApp.Service
site_id, alarmID, datestamp, HealthStatus
from (
select site_id, datestamp, sourceState, id alarmID,
case when alarmClass = 1 then 3 # Network -
when alarmClass != 1 then 2 end HealthStatus # inv, sensor
case when alarmClass = 2 then 3 # Network -
when alarmClass != 2 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")}'
and datestamp > '{System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'
order by HealthStatus desc
limit 100
) x
@ -200,7 +206,6 @@ namespace solarApp.Service
arclog.insert_log("0", "syncError s6 inv health", duration.TotalSeconds, "", "err_main", "0", "", rowCT.ToString(), conn, null);
#endregion
}
conn.Close();
}
result = true;

View File

@ -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 06-28 拯救 Kevin";
this.Text = "fmArchive 07-01 拯救 Kevin";
this.Load += new System.EventHandler(this.fmArchive_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);

View File

@ -192,7 +192,7 @@ namespace solarApp
//水位管理 每月 20 日 晚上8點
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 = true;
@ -679,15 +679,16 @@ namespace solarApp
if (CanDoSend)
{
SMTPConfig smtp = new SMTPConfig(); ;
smtp.Host = "msr.hinet.net";
//smtp.Host = "msr.hinet.net";
//smtp.UserName = "ficgreen01@gmail.com";
//smtp.Password = "qwe2015qwe";
//smtp.UserName = "ficgreen02@gmail.com";
//smtp.Password = "qwe20150504qwe";
//smtp.UserName = "shanghohui@gmail.com";
//smtp.Password = "wswgnluvoodfexrb";
//smtp.EnableSsl = true;
//smtp.Port = 587;
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
smtp.Port = 587;
smtp.UserName = tbUserName.Text;
smtp.Password = tbPassword.Text;
if (rbSSL.Checked)