From a2d702780fef0aa7bb7c11e8a0b84c1d8738ce59 Mon Sep 17 00:00:00 2001 From: cesar liu Date: Wed, 7 Sep 2022 15:43:35 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E7=95=B0=E5=B8=B8=E7=99=BC=E4=BD=88?= =?UTF-8?q?=E6=99=82=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index ae7bc8a..e12b1b6 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -48,29 +48,17 @@ namespace SolarPower.Quartz.Jobs // 立刻發報 var ExceptionListex = ExceptionList.Where(x => x.priority == 1 ).ToList(); // 12小時後發報 - var ExceptionListex2 = ExceptionList.Where(x => x.sourceState == 1 && - x.priority == 2 && - (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalMinutes/ 60) >= ExceptionTimes_Priority2).ToList(); + var ExceptionListex2 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 2 && + (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalMinutes) >= ExceptionTimes_Priority2).ToList(); // 24小時後發報 var ExceptionListex3 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 3 && - (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority3).ToList(); + (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalMinutes) >= ExceptionTimes_Priority3).ToList(); ExceptionListex.AddRange(ExceptionListex2); ExceptionListex.AddRange(ExceptionListex3); foreach (var Exception in ExceptionListex) { - var UserListWithPowerstation = await overviewRepository.GetUserListWithPowerstation(Exception.PowerStationId); - - //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 UserListWithPowerstation = await overviewRepository.GetUserListWithPowerstation(Exception.PowerStationId); var Content = $"發生時間:{Exception.dev_time}" + "
" + $"電站名稱:{Exception.PowerStationName}" + "
" + $"異常類別:{Exception.alarmClassName}" + "
" +