Email格式: 變更異常和報表

This commit is contained in:
wanling040@gmail.com 2022-08-25 14:41:43 +08:00
parent d2d8fbddf1
commit 7e93a3691f
2 changed files with 21 additions and 13 deletions

View File

@ -63,18 +63,26 @@ namespace SolarPower.Quartz.Jobs
{
var UserListWithPowerstation = await overviewRepository.GetUserListWithPowerstation(Exception.PowerStationId);
var Content = $"電站名稱:{Exception.PowerStationName}" + "<br>" +
$"設備編號:{Exception.errDevice}" + "<br>" +
$"異常ID編號:{Exception.id}" + "<br>" +
//var Content = $"電站名稱:{Exception.PowerStationName}" + "<br>" +
// $"設備編號:{Exception.errDevice}" + "<br>" +
// $"異常ID編號:{Exception.id}" + "<br>" +
// $"異常類別:{Exception.alarmClassName}" + "<br>" +
// $"異常訊息:{Exception.errMsg}" + "<br>";
//if(Exception.errMsgT == "d")
//{
// Content += $"當前數值:{Exception.errValue}" + "<br>";
//}
//Content += $"發生時間:{Exception.dev_time}";
var Content = $"發生時間:{Exception.dev_time}" + "<br>" +
$"電站名稱:{Exception.PowerStationName}" + "<br>" +
$"異常類別:{Exception.alarmClassName}" + "<br>" +
$"設備訊息:{Exception.errMsg}" + "<br>";
$"異常訊息:{Exception.errMsg}" + "<br>" +
$"設備編號:{Exception.errDevice}" + "<br>" +
$"異常編號:{Exception.id}" + "<br>";
if (Exception.errMsgT == "d")
{
Content += $"當前數值:{Exception.errValue}" + "<br>";
}
//Content += $"發生時間:{Exception.dev_time}";
string subTime = $",發生時間:{Exception.dev_time}";
foreach (var user in UserListWithPowerstation)
{
@ -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,

View File

@ -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,