From 254a17d6d3d634920734fed9290162db5554e77d Mon Sep 17 00:00:00 2001 From: cesar liu Date: Wed, 15 Jun 2022 22:36:01 +0800 Subject: [PATCH] =?UTF-8?q?debug=20:=20=E9=9B=BB=E7=AB=99=E5=95=9F?= =?UTF-8?q?=E7=94=A8=E6=AA=A2=E6=9F=A5=20-=20inv=20=E5=84=98=E6=AA=A2?= =?UTF-8?q?=E6=9F=A5=E6=98=AF=E5=90=A6=E5=95=9F=E7=94=A8=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E7=AE=A1=E6=98=AF=E5=90=A6=E7=82=BA=E7=95=B0=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs | 8 ++++---- SolarPower/Repository/Implement/PowerStationRepository.cs | 4 ++-- SolarPower/appsettings.Development.json | 2 +- SolarPower/appsettings.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs index bddd8d7..9d94efb 100644 --- a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs @@ -227,7 +227,7 @@ namespace SolarPower.Quartz.Jobs var dateNowMonth = DateTimeNow.AddDays(-1).ToString("yyyy-MM"); Root2 observation = null; - + // from here #region 氣象觀測(取資料) try { @@ -326,9 +326,9 @@ namespace SolarPower.Quartz.Jobs #region 60天刪除operation_record var OperationDeletes = await powerStationRepository.GetAllDataList("operation_record", "Deleted = 1"); List deleteoperations = new List(); - foreach(var deletes in OperationDeletes) + foreach (var deletes in OperationDeletes) { - if(DateTime.Now.AddDays(-60) > Convert.ToDateTime(deletes.UpdatedAt)) + if (DateTime.Now.AddDays(-60) > Convert.ToDateTime(deletes.UpdatedAt)) { deleteoperations.Add(deletes.Id); } @@ -785,7 +785,7 @@ namespace SolarPower.Quartz.Jobs await powerStationRepository.UpdateMeterHistoryMonthList(updatemeterHistoryMonths); } #endregion - + // end from here #region 補償機制 var gobackDay = this.Configuration.GetValue("GoBackDay"); //回推天數 var Connection_string = Configuration.GetValue("mySql"); diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 1d7d758..21caa36 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -6016,11 +6016,11 @@ namespace SolarPower.Repository.Implement select '{code}' , 'inverter', 'inverter_isnull', case when count(*) > 0 then 0 else 1 end isError, now(), - case when count(*) > 0 then Null else '電站無逆變器' end error_reason + case when count(*) > 0 then Null else '電站無逆變器或未啟用' end error_reason from {DBname}.power_station a join {DBname}.controller b on a.id = b.PowerStationId join {DBname}.inverter c on b.id = c.ControllerId - where a.`Code` = '{code}' and c.Deleted = 0 and c.Enabled = 1 and c.Status = 1 ;"; + where a.`Code` = '{code}' and c.Deleted = 0 and c.Enabled = 1 and c.Status > 0 ;"; await conn.ExecuteAsync(sql); // # 回傳結果 diff --git a/SolarPower/appsettings.Development.json b/SolarPower/appsettings.Development.json index 6d01b33..4b4c3e5 100644 --- a/SolarPower/appsettings.Development.json +++ b/SolarPower/appsettings.Development.json @@ -34,7 +34,7 @@ //}, "BackgroundServiceCron": { "CalcPowerStationJob": "0 5 * * * ?", - "CalcAvgPowerStationJob": "0 0 2 * * ?", + "CalcAvgPowerStationJob": "0 12 0 * * ?", "OperationScheduleJob": "0 0 8 * * ?", "CalcInverter15minJob": "0 2/15 * * * ?", "SendEmailJob": "0 0/5 * * * ?", diff --git a/SolarPower/appsettings.json b/SolarPower/appsettings.json index 4d4ba38..151dcc4 100644 --- a/SolarPower/appsettings.json +++ b/SolarPower/appsettings.json @@ -36,7 +36,7 @@ }, "BackgroundServiceCron": { "CalcPowerStationJob": "0 5 * * * ?", - "CalcAvgPowerStationJob": "0 0 2 * * ?", + "CalcAvgPowerStationJob": "0 12 0 * * ?", "OperationScheduleJob": "0 0 8 * * ?", "CalcInverter15minJob": "0 2/15 * * * ?", "SendEmailJob": "0 0/5 * * * ?",