From b591fca8367bd3281de080017a5d0268e8c487b2 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Wed, 24 Aug 2022 10:31:10 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8D=8A=E5=A4=9C=E6=AD=B8=E6=AA=94?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A8=BB=E8=A7=A3=E6=8E=89=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E7=95=99winfrom=E7=9A=84=E6=AD=B8=E6=AA=94=E5=8B=95=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Quartz/Jobs/CalcAvgPowerStationJob.cs | 208 +++++++++--------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs index 9d94efb..bde63d4 100644 --- a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs @@ -786,114 +786,114 @@ namespace SolarPower.Quartz.Jobs } #endregion // end from here - #region 補償機制 - var gobackDay = this.Configuration.GetValue("GoBackDay"); //回推天數 - var Connection_string = Configuration.GetValue("mySql"); - var start_date = DateTimeNow.AddDays(-1 * gobackDay); - var end_date = DateTimeNow.AddDays(-1); - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行補償機制】"); - procSensorSvc sensorSvc = new procSensorSvc(Connection_string); - procInvSvc invSvc = new procInvSvc(Connection_string, logger); - procStationSvc siteSvc = new procStationSvc(Connection_string); - foreach (var powerStation in powerStations) - { - start_date = DateTimeNow.AddDays(-1 * gobackDay); - for (; start_date <= end_date; start_date = start_date.AddDays(1)) - { - var day_str = start_date.ToString("yyyy-MM-dd"); - #region 歸檔 Sensor - try - { - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); - sensorSvc.archiveData(powerStation.Code, day_str); - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); - } - catch (Exception exception) - { - logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); - if (exception.InnerException != null) - { - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); - } - } - #endregion + //#region 補償機制 + //var gobackDay = this.Configuration.GetValue("GoBackDay"); //回推天數 + //var Connection_string = Configuration.GetValue("mySql"); + //var start_date = DateTimeNow.AddDays(-1 * gobackDay); + //var end_date = DateTimeNow.AddDays(-1); + //logger.LogInformation("【CalcAvgPowerStationJob】【開始執行補償機制】"); + //procSensorSvc sensorSvc = new procSensorSvc(Connection_string); + //procInvSvc invSvc = new procInvSvc(Connection_string, logger); + //procStationSvc siteSvc = new procStationSvc(Connection_string); + //foreach (var powerStation in powerStations) + //{ + // start_date = DateTimeNow.AddDays(-1 * gobackDay); + // for (; start_date <= end_date; start_date = start_date.AddDays(1)) + // { + // var day_str = start_date.ToString("yyyy-MM-dd"); + // #region 歸檔 Sensor + // try + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); + // sensorSvc.archiveData(powerStation.Code, day_str); + // logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); + // } + // catch (Exception exception) + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str); + // logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + // if (exception.InnerException != null) + // { + // logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); + // } + // } + // #endregion - #region 歸檔 電錶 - try - { - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); - sensorSvc.archiveMeterData(powerStation.Code, day_str); - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); - } - catch (Exception exception) - { - logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); - if (exception.InnerException != null) - { - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); - } - } - #endregion + // #region 歸檔 電錶 + // try + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); + // sensorSvc.archiveMeterData(powerStation.Code, day_str); + // logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); + // } + // catch (Exception exception) + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Meter補償機制】", powerStation.Code, day_str); + // logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + // if (exception.InnerException != null) + // { + // logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); + // } + // } + // #endregion - #region 歸檔 Inv - try - { - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); - invSvc.archiveData(powerStation.Code, day_str); - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); - } - catch (Exception exception) - { - logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); - if (exception.InnerException != null) - { - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); - } - } - #endregion + // #region 歸檔 Inv + // try + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); + // invSvc.archiveData(powerStation.Code, day_str); + // logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); + // } + // catch (Exception exception) + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str); + // logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + // if (exception.InnerException != null) + // { + // logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); + // } + // } + // #endregion - #region 歸檔 Station hour - try - { - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); - siteSvc.archiveData(powerStation.Code, day_str); - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); - } - catch (Exception exception) - { - logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); - if (exception.InnerException != null) - { - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); - } - } - #endregion + // #region 歸檔 Station hour + // try + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); + // siteSvc.archiveData(powerStation.Code, day_str); + // logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); + // } + // catch (Exception exception) + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str); + // logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + // if (exception.InnerException != null) + // { + // logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); + // } + // } + // #endregion - #region 製作日報表 - try - { - logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); - invSvc.report_invDay(powerStation.Code, day_str); - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); - } - catch (Exception exception) - { - logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); - if (exception.InnerException != null) - { - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); - } - } - #endregion - } - } - logger.LogInformation("【CalcAvgPowerStationJob】【執行完成補償機制】"); - #endregion + // #region 製作日報表 + // try + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【開始執行電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); + // invSvc.report_invDay(powerStation.Code, day_str); + // logger.LogInformation("【CalcAvgPowerStationJob】【執行完成電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); + // } + // catch (Exception exception) + // { + // logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的 日報表製作】", powerStation.Code, day_str); + // logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + // if (exception.InnerException != null) + // { + // logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); + // } + // } + // #endregion + // } + //} + //logger.LogInformation("【CalcAvgPowerStationJob】【執行完成補償機制】"); + //#endregion From ddb2c14de9ebd855c9d0609f9743f5dfcfa4a2f3 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Wed, 24 Aug 2022 10:33:08 +0800 Subject: [PATCH 2/8] =?UTF-8?q?solar=5FApp:=20=E6=9B=B4=E6=94=B9=E6=A8=99?= =?UTF-8?q?=E9=A1=8C=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solarApp/fmArchive.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index 19dd64c..0bdf5db 100644 --- a/solarApp/fmArchive.Designer.cs +++ b/solarApp/fmArchive.Designer.cs @@ -762,7 +762,7 @@ namespace solarApp this.ClientSize = new System.Drawing.Size(1782, 953); this.Controls.Add(this.tabControl1); this.Name = "fmArchive"; - this.Text = "fmArchive 0822"; + this.Text = "fmArchive 0824"; this.Load += new System.EventHandler(this.fmArchive_Load); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); From d2d8fbddf102cce4c91e1d202080cb946269b96d Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Wed, 24 Aug 2022 19:44:08 +0800 Subject: [PATCH 3/8] =?UTF-8?q?Email=E6=A0=BC=E5=BC=8F:=20=E7=95=B0?= =?UTF-8?q?=E5=B8=B8=E9=80=9A=E7=9F=A5=E3=80=81=E6=97=A5=E5=A0=B1=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E6=9C=88=E5=A0=B1=E8=A1=A8=E3=80=81=E7=B6=9C=E5=90=88?= =?UTF-8?q?=E5=A0=B1=E8=A1=A8=EF=BC=8C=E4=B8=BB=E6=97=A8=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 9 +++++++-- SolarPower/Quartz/Jobs/OperationScheduleJob.cs | 17 +++++++++++++---- SolarPower/Quartz/Jobs/SendEmailJob.cs | 11 +++-------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 797a454..9828c3b 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -72,15 +72,20 @@ namespace SolarPower.Quartz.Jobs { Content += $"當前數值:{Exception.errValue}" + "
"; } - Content += $"發生時間:{Exception.dev_time}"; + //Content += $"發生時間:{Exception.dev_time}"; + string subTime = $",發生時間:{Exception.dev_time}"; + + foreach (var user in UserListWithPowerstation) { + var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); + string companyName = getCompany.Result; NoticeSchedule DaySchedule = new NoticeSchedule() { UserId = user.Id, EmailType = 4, RecipientEmail = user.Email, - Subject = "異常通知", + Subject = companyName + "太陽能監控" + Exception.alarmClassName + "-異常通知" + subTime, Content = Content, RecipientName = user.Name, Type = 1, diff --git a/SolarPower/Quartz/Jobs/OperationScheduleJob.cs b/SolarPower/Quartz/Jobs/OperationScheduleJob.cs index 911a475..69bf43b 100644 --- a/SolarPower/Quartz/Jobs/OperationScheduleJob.cs +++ b/SolarPower/Quartz/Jobs/OperationScheduleJob.cs @@ -250,6 +250,9 @@ namespace SolarPower.Quartz.Jobs var stationReportName = stationReportController.ExportExcelBackDownload(JsonConvert.SerializeObject(dayexcel, Formatting.Indented)); if (stationReportName != "") { + var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); + string companyName = getCompany.Result; + if (user.Email != null && IsValidEmail(user.Email)) { NoticeSchedule DaySchedule = new NoticeSchedule() @@ -257,7 +260,7 @@ namespace SolarPower.Quartz.Jobs UserId = user.Id, EmailType = 0, RecipientEmail = user.Email, - Subject = "日報表", + Subject = companyName + "太陽能監控-日報表", Attachment = stationReportName, RecipientName = user.Name, Type = 1 @@ -290,12 +293,14 @@ namespace SolarPower.Quartz.Jobs var stationMaxReportName = stationReportController.ExportExcelmaxtableBackDownload(JsonConvert.SerializeObject(maxdayexcel, Formatting.Indented)); if (user.Email != null && IsValidEmail(user.Email)) { + var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); + string companyName = getCompany.Result; NoticeSchedule MaxSchedule = new NoticeSchedule() { UserId = user.Id, EmailType = 2, RecipientEmail = user.Email, - Subject = "綜合報表", + Subject = companyName + "太陽能監控-綜合報表", Attachment = stationMaxReportName, RecipientName = user.Name, Type = 1 @@ -326,10 +331,12 @@ namespace SolarPower.Quartz.Jobs var stationReportmaxmonthName = stationReportController.ExportExcelBackDownload(JsonConvert.SerializeObject(maxmonthexcel, Formatting.Indented)); if (user.Email != null && IsValidEmail(user.Email)) { + var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); + string companyName = getCompany.Result; NoticeSchedule MaxmonthSchedule = new NoticeSchedule() { RecipientEmail = user.Email, - Subject = "綜合報表", + Subject = companyName + "太陽能監控-綜合報表", Attachment = stationReportmaxmonthName, RecipientName = user.Name, Type = 1, @@ -372,10 +379,12 @@ namespace SolarPower.Quartz.Jobs { if (user.Email != null && IsValidEmail(user.Email)) { + var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); + string companyName = getCompany.Result; NoticeSchedule MonthSchedule = new NoticeSchedule() { RecipientEmail = user.Email, - Subject = "月報表", + Subject = companyName + "太陽能監控-月報表", Attachment = stationReportmonthName, RecipientName = user.Name, Type = 1, diff --git a/SolarPower/Quartz/Jobs/SendEmailJob.cs b/SolarPower/Quartz/Jobs/SendEmailJob.cs index 0302aa5..33d55d2 100644 --- a/SolarPower/Quartz/Jobs/SendEmailJob.cs +++ b/SolarPower/Quartz/Jobs/SendEmailJob.cs @@ -54,11 +54,7 @@ namespace SolarPower.Quartz.Jobs { attachments = notice.Attachment.Split(',').ToList(); } - - var getCompany = noticeScheduleRepository.GetCompanyNameById(notice.Id); - string companyName = getCompany.Result; - - var result = Send(recipientEmails, notice.Subject, notice.Content, attachments, companyName); + var result = Send(recipientEmails, notice.Subject, notice.Content, attachments); if (result.CompareTo("成功") == 0) { @@ -99,7 +95,7 @@ namespace SolarPower.Quartz.Jobs } } - private string Send(List recipientEmails, string subject, string content, List attachments, string companyName) + private string Send(List recipientEmails, string subject, string content, List attachments) { var reason = string.Empty; var CanDoSend = true; @@ -108,8 +104,7 @@ namespace SolarPower.Quartz.Jobs MyMail.SubjectEncoding = System.Text.Encoding.UTF8;//郵件標題編碼 MyMail.BodyEncoding = System.Text.Encoding.UTF8; //郵件內容編碼 MyMail.IsBodyHtml = true; //是否使用html格式 - //var kkk = $"FIC 太陽能電站管理系統通知 <{smtp.UserName}>"; - var kkk = companyName + $" 太陽能電站管理系統通知 <{smtp.UserName}>"; + var kkk = $"太陽能電站管理系統通知 <{smtp.UserName}>"; MyMail.From = new System.Net.Mail.MailAddress(kkk); //寄件人 foreach (var email in recipientEmails) { From 7e93a3691f6b54691b42b57ad32c86ae77285551 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Thu, 25 Aug 2022 14:41:43 +0800 Subject: [PATCH 4/8] =?UTF-8?q?Email=E6=A0=BC=E5=BC=8F:=20=E8=AE=8A?= =?UTF-8?q?=E6=9B=B4=E7=95=B0=E5=B8=B8=E5=92=8C=E5=A0=B1=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 26 ++++++++++++------- .../Quartz/Jobs/OperationScheduleJob.cs | 8 +++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 9828c3b..72882ed 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -63,19 +63,27 @@ namespace SolarPower.Quartz.Jobs { var UserListWithPowerstation = await overviewRepository.GetUserListWithPowerstation(Exception.PowerStationId); - var Content = $"電站名稱:{Exception.PowerStationName}" + "
" + - $"設備編號:{Exception.errDevice}" + "
" + - $"異常ID編號:{Exception.id}" + "
" + + //var Content = $"電站名稱:{Exception.PowerStationName}" + "
" + + // $"設備編號:{Exception.errDevice}" + "
" + + // $"異常ID編號:{Exception.id}" + "
" + + // $"異常類別:{Exception.alarmClassName}" + "
" + + // $"異常訊息:{Exception.errMsg}" + "
"; + //if(Exception.errMsgT == "d") + //{ + // Content += $"當前數值:{Exception.errValue}" + "
"; + //} + //Content += $"發生時間:{Exception.dev_time}"; + var Content = $"發生時間:{Exception.dev_time}" + "
" + + $"電站名稱:{Exception.PowerStationName}" + "
" + $"異常類別:{Exception.alarmClassName}" + "
" + - $"設備訊息:{Exception.errMsg}" + "
"; - if(Exception.errMsgT == "d") + $"異常訊息:{Exception.errMsg}" + "
" + + $"設備編號:{Exception.errDevice}" + "
" + + $"異常編號:{Exception.id}" + "
"; + if (Exception.errMsgT == "d") { Content += $"當前數值:{Exception.errValue}" + "
"; } - //Content += $"發生時間:{Exception.dev_time}"; - string subTime = $",發生時間:{Exception.dev_time}"; - foreach (var user in UserListWithPowerstation) { var getCompany = noticeScheduleRepository.GetCompanyNameById(user.Id); @@ -85,7 +93,7 @@ namespace SolarPower.Quartz.Jobs UserId = user.Id, EmailType = 4, RecipientEmail = user.Email, - Subject = companyName + "太陽能監控" + Exception.alarmClassName + "-異常通知" + subTime, + Subject = "太陽能監控系統異常通知-" + Exception.PowerStationName + "-" + Exception.alarmClassName, Content = Content, RecipientName = user.Name, Type = 1, diff --git a/SolarPower/Quartz/Jobs/OperationScheduleJob.cs b/SolarPower/Quartz/Jobs/OperationScheduleJob.cs index 69bf43b..d476084 100644 --- a/SolarPower/Quartz/Jobs/OperationScheduleJob.cs +++ b/SolarPower/Quartz/Jobs/OperationScheduleJob.cs @@ -260,7 +260,7 @@ namespace SolarPower.Quartz.Jobs UserId = user.Id, EmailType = 0, RecipientEmail = user.Email, - Subject = companyName + "太陽能監控-日報表", + Subject = companyName + "-太陽能監控系統-日報表", Attachment = stationReportName, RecipientName = user.Name, Type = 1 @@ -300,7 +300,7 @@ namespace SolarPower.Quartz.Jobs UserId = user.Id, EmailType = 2, RecipientEmail = user.Email, - Subject = companyName + "太陽能監控-綜合報表", + Subject = companyName + "-太陽能監控系統-綜合報表", Attachment = stationMaxReportName, RecipientName = user.Name, Type = 1 @@ -336,7 +336,7 @@ namespace SolarPower.Quartz.Jobs NoticeSchedule MaxmonthSchedule = new NoticeSchedule() { RecipientEmail = user.Email, - Subject = companyName + "太陽能監控-綜合報表", + Subject = companyName + "-太陽能監控系統-綜合報表", Attachment = stationReportmaxmonthName, RecipientName = user.Name, Type = 1, @@ -384,7 +384,7 @@ namespace SolarPower.Quartz.Jobs NoticeSchedule MonthSchedule = new NoticeSchedule() { RecipientEmail = user.Email, - Subject = companyName + "太陽能監控-月報表", + Subject = companyName + "-太陽能監控系統-月報表", Attachment = stationReportmonthName, RecipientName = user.Name, Type = 1, From e5856f3c33bab19d9d8a0c4675236dd1a2212323 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Thu, 25 Aug 2022 20:05:35 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=9B=BB=E7=AB=99=E8=B3=87=E8=A8=8A:=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3Loading=E4=B8=8D=E6=9C=83=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StationOverviewInfo.cshtml | 55 ++++++++++++++++--- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 6f37cc1..ff7f8c7 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -39,7 +39,7 @@ { } @@ -48,7 +48,7 @@ { } @@ -57,7 +57,7 @@ { } @@ -66,7 +66,7 @@ { } @@ -75,7 +75,7 @@ { } @@ -86,7 +86,7 @@ { } @@ -95,7 +95,7 @@ { } @@ -196,8 +196,47 @@ } } - $(function () { + function checkPage() { + isloadingdone_uptodate = true; + isloadingdone_info = true; + isloadingdone_inverterinfo = true; + isloadingdone_inverter = true; + isloadingdone_history = true; + isloadingdone_exception = true; + isloadingdone_operation = true; + var i1 = document.getElementById("page_UpToDate"); + var i2 = document.getElementById("page_Info"); + var i3 = document.getElementById("page_InverterInfo"); + var i4 = document.getElementById("page_Inverter"); + var i5 = document.getElementById("page_History"); + var i6 = document.getElementById("page_Exception"); + var i7 = document.getElementById("page_OperationRecord"); + if (i1 != null) + { + isloadingdone_uptodate = false; + } + if (i2 != null) { + isloadingdone_info = false; + } + if (i3 != null) { + isloadingdone_inverterinfo = false; + } + if (i4 != null) { + isloadingdone_inverter = false; + } + if (i5 != null) { + isloadingdone_history = false; + } + if (i6 != null) { + isloadingdone_exception = false; + } + if (i7 != null) { + isloadingdone_operation = false; + } + } + $(function () { + checkPage(); var url = new URL(location.href); stationId = url.searchParams.get('stationId'); From 8da421258a4c986a9620260f61139811cb494e32 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Fri, 26 Aug 2022 15:31:17 +0800 Subject: [PATCH 6/8] =?UTF-8?q?solar=5FApp:=20=E6=9B=B4=E6=94=B9=E5=8D=8A?= =?UTF-8?q?=E5=A4=9C=E6=AD=B8=E6=AA=94(=E6=97=A5=E5=A0=B1=E8=A1=A8)?= =?UTF-8?q?=E5=9F=B7=E8=A1=8C=E9=A0=86=E5=BA=8F=E3=80=81=E7=95=B0=E5=B8=B8?= =?UTF-8?q?=E8=99=95=E7=90=86=E7=9A=84=E6=99=82=E9=96=93=E5=88=A4=E6=96=B7?= =?UTF-8?q?=E5=A4=9A=E5=8A=A0=E7=A7=92=E6=95=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solarApp/fmArchive.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index e7db969..1ef2021 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -117,7 +117,7 @@ namespace solarApp } //異常處理 每 5分鐘跑一次 - if ((DateTime.Now.Minute % 5) == 0 && autoTask == false) + if ((DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && autoTask == false) { autoTask = true; lbMsgTitle.Text = "異常處理 " + DateTime.Now.ToString() + " timer start"; @@ -306,7 +306,6 @@ namespace solarApp sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); invSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); siteSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); - invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); } } sensorSvc.isFirst = true; @@ -317,6 +316,7 @@ namespace solarApp { sensorSvc.archiveSensorHistoryHourData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); sensorSvc.isFirst = false; + invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); } } autoTask = true; From 08d888117e4df55df5ffa1b47c45cc40a12951a2 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Mon, 29 Aug 2022 12:53:04 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=95=B0=E5=B8=B8=E9=80=9A=E7=9F=A5:=20pri?= =?UTF-8?q?ority=E7=82=BA3=E7=9A=84=E7=95=B0=E5=B8=B8=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E6=88=90=E4=B8=8D=E8=AB=96=E6=98=AF=E5=90=A6=E8=B3=A6=E6=AD=B8?= =?UTF-8?q?=EF=BC=8C=E9=83=BD=E9=80=81=E5=88=B0=E5=AF=84=E4=BF=A1=E8=B3=87?= =?UTF-8?q?=E6=96=99=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 72882ed..b19a634 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -53,8 +53,7 @@ namespace SolarPower.Quartz.Jobs x.priority == 2 && (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority2).ToList(); - var ExceptionListex3 = ExceptionList.Where(x => x.sourceState == 1 && - x.priority == 3 && + var ExceptionListex3 = ExceptionList.Where(x => x.priority == 3 && (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority3).ToList(); ExceptionListex.AddRange(ExceptionListex2); ExceptionListex.AddRange(ExceptionListex3); From ccd29ae8401b29476448718fe7cad76975a2f53b Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Tue, 30 Aug 2022 09:37:08 +0800 Subject: [PATCH 8/8] =?UTF-8?q?solar=5FApp:=20=E4=BF=AE=E6=94=B9=E7=95=B0?= =?UTF-8?q?=E5=B8=B8=E5=90=8C=E6=AD=A5=E7=9A=84=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solarApp/fmArchive.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index 1ef2021..96ba532 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -19,6 +19,7 @@ namespace solarApp System.Timers.Timer _timer; bool autoTask = false; //測試自動跑 irrDayHour 累計日照小時差異 procSyncError svc = new procSyncError(); // 異常資料同步 + DateTime doTimerTaskTime = DateTime.Now; public fmArchive() { InitializeComponent(); @@ -113,12 +114,14 @@ namespace solarApp dtSelect1.Value = System.DateTime.Now.AddDays(-1); dtSelect2.Value = System.DateTime.Now.AddDays(-1); bt_archive.PerformClick(); + autoTask = false; //bt_archive_Click.PerformClick(); } //異常處理 每 5分鐘跑一次 - if ((DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && autoTask == false) + if ( DateTime.Now.Hour >= 05 && (DateTime.Now.Minute % 5) == 0 && (DateTime.Now.Second) < 30 && (autoTask == false || (DateTime.Now - doTimerTaskTime).TotalMinutes > 30)) { + doTimerTaskTime = DateTime.Now; autoTask = true; lbMsgTitle.Text = "異常處理 " + DateTime.Now.ToString() + " timer start"; btSyncErr.PerformClick(); @@ -319,7 +322,7 @@ namespace solarApp invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); } } - autoTask = true; + lbMsgTitle.Text = System.DateTime.Now.ToString() + " 完成!"; }