From 5d125c803e9d2de7eaa0a57c3da40adcfd5a8fa5 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Tue, 5 Oct 2021 18:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=B0=E5=B8=B8=E9=A1=9E=E5=9E=8B:d=20?= =?UTF-8?q?=E9=A1=8D=E5=A4=96=E6=96=B0=E5=A2=9E=20=E7=95=B6=E5=89=8D?= =?UTF-8?q?=E6=95=B8=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Models/Overview.cs | 3 ++- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 8 ++++++-- SolarPower/Repository/Implement/OverviewRepository.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/SolarPower/Models/Overview.cs b/SolarPower/Models/Overview.cs index 7e12750..5c19206 100644 --- a/SolarPower/Models/Overview.cs +++ b/SolarPower/Models/Overview.cs @@ -199,7 +199,8 @@ namespace SolarPower.Models public string errMsg { get; set; }//錯誤原因 public string PowerStationName { get; set; }//電站名稱 public int PowerStationId { get; set; }//電站流水號 - public string normalTime { get; set; } + public string normalTime { get; set; }//賦歸時間 + public string errMsgT { get; set; } //errMsgType } public class UserPowerStationTo diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 217919f..79a6381 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -53,8 +53,12 @@ namespace SolarPower.Quartz.Jobs $"設備編號:{Exception.errDevice}" + "
" + $"異常ID編號:{Exception.id}" + "
" + $"異常類別:{Exception.alarmClassName}" + "
" + - $"設備訊息:{Exception.errMsg}" + "
" + - $"發生時間:{Exception.dev_time}"; + $"設備訊息:{Exception.errMsg}" + "
"; + if(Exception.errMsgT == "d") + { + Content += $"當前數值:{Exception.errValue}" + "
"; + } + Content += $"發生時間:{Exception.dev_time}"; foreach (var user in UserListWithPowerstation) { NoticeSchedule DaySchedule = new NoticeSchedule() diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index f314d9f..7e13d05 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -663,7 +663,7 @@ namespace SolarPower.Repository.Implement select a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName,ps.Id as PowerStationId, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, - case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg + case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg ,case when c.errMsg is null then d.errMsg else c.errMsg end errMsgT from err_main a join alarmorion_orionalarmclass b on a.alarmclass = b.id left join ref_err_device c on trim(b.alarmClass) = c.deviceType