diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs
index 7d3468a..01967dd 100644
--- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs
+++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs
@@ -45,14 +45,14 @@ namespace SolarPower.Quartz.Jobs
{
var UserListWithPowerstation = await overviewRepository.GetUserListWithPowerstation(Exception.PowerStationId);
- foreach (var user in UserListWithPowerstation)
- {
- var Content = $"電站名稱:{Exception.PowerStationName}" + "
" +
+ var Content = $"電站名稱:{Exception.PowerStationName}" + "
" +
$"設備編號:{Exception.errDevice}" + "
" +
$"異常ID編號:{Exception.id}" + "
" +
$"異常類別:{Exception.alarmClassName}" + "
" +
$"設備訊息:{Exception.errMsg}" + "
" +
- $"發生時間:{Exception.dev_time}" ;
+ $"發生時間:{Exception.dev_time}";
+ foreach (var user in UserListWithPowerstation)
+ {
NoticeSchedule DaySchedule = new NoticeSchedule()
{
UserId = user.Id,
@@ -77,12 +77,14 @@ namespace SolarPower.Quartz.Jobs
};
await noticeScheduleRepository.AddOneAsync(DaySchedule, properties);
- var powerstation = await powerStationRepository.GetOneAsync(Exception.PowerStationId);
- if(powerstation.line_token != null)
- {
- Content = " %0D%0A " + Content.Replace("
", " %0D%0A ");
- CallLineToken(Content, powerstation.line_token);
- }
+
+ }
+
+ var powerstation = await powerStationRepository.GetOneAsync(Exception.PowerStationId);
+ if (powerstation.line_token != null)
+ {
+ Content = " %0D%0A " + Content.Replace("
", " %0D%0A ");
+ CallLineToken(Content, powerstation.line_token);
}
}
}