From 7e93a3691f6b54691b42b57ad32c86ae77285551 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Thu, 25 Aug 2022 14:41:43 +0800 Subject: [PATCH] =?UTF-8?q?Email=E6=A0=BC=E5=BC=8F:=20=E8=AE=8A=E6=9B=B4?= =?UTF-8?q?=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,