Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
ee5e10dace
@ -785,12 +785,13 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
|
|
||||||
#region 補償機制
|
#region 補償機制
|
||||||
var gobackDay = this.Configuration.GetValue<int>("GoBackDay"); //回推天數
|
var gobackDay = this.Configuration.GetValue<int>("GoBackDay"); //回推天數
|
||||||
|
var Connection_string = Configuration.GetValue<string>("mySql");
|
||||||
var start_date = DateTimeNow.AddDays(-1 * gobackDay);
|
var start_date = DateTimeNow.AddDays(-1 * gobackDay);
|
||||||
var end_date = DateTimeNow.AddDays(-1);
|
var end_date = DateTimeNow.AddDays(-1);
|
||||||
logger.LogInformation("【CalcAvgPowerStationJob】【開始補償機制】");
|
logger.LogInformation("【CalcAvgPowerStationJob】【開始補償機制】");
|
||||||
procSensorSvc sensorSvc = new procSensorSvc();
|
procSensorSvc sensorSvc = new procSensorSvc(Connection_string);
|
||||||
procInvSvc invSvc = new procInvSvc();
|
procInvSvc invSvc = new procInvSvc(Connection_string);
|
||||||
procStationSvc siteSvc = new procStationSvc();
|
procStationSvc siteSvc = new procStationSvc(Connection_string);
|
||||||
foreach (var powerStation in powerStations)
|
foreach (var powerStation in powerStations)
|
||||||
{
|
{
|
||||||
foreach (DateTime day in EachDay(start_date, end_date))
|
foreach (DateTime day in EachDay(start_date, end_date))
|
||||||
@ -806,8 +807,11 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
{
|
{
|
||||||
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str);
|
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Sensor補償機制】", powerStation.Code, day_str);
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
||||||
|
if (exception.InnerException != null)
|
||||||
|
{
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -819,8 +823,11 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
{
|
{
|
||||||
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str);
|
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Inverter補償機制】", powerStation.Code, day_str);
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
||||||
|
if (exception.InnerException != null)
|
||||||
|
{
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -832,10 +839,13 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
{
|
{
|
||||||
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str);
|
logger.LogInformation("【CalcAvgPowerStationJob】【執行失敗電站[{0}]在{1}的Site補償機制】", powerStation.Code, day_str);
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
||||||
|
if (exception.InnerException != null)
|
||||||
|
{
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 寄送日月報
|
#region 寄送日月報
|
||||||
@ -1012,9 +1022,12 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message);
|
||||||
|
if(exception.InnerException != null)
|
||||||
|
{
|
||||||
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<DateTime> EachDay(DateTime from, DateTime thru)
|
public IEnumerable<DateTime> EachDay(DateTime from, DateTime thru)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -822,8 +822,11 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
logger.LogError("【CalcPowerStationJob】[Exception] - {0}", exception.Message);
|
logger.LogError("【CalcPowerStationJob】[Exception] - {0}", exception.Message);
|
||||||
|
if (exception.InnerException != null)
|
||||||
|
{
|
||||||
logger.LogError("【CalcPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
logger.LogError("【CalcPowerStationJob】[InnerException] - {0}", exception.InnerException.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
"Root": "mWlR2HshQNhRRE34jg4kdg==",
|
"Root": "mWlR2HshQNhRRE34jg4kdg==",
|
||||||
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
|
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
|
||||||
},
|
},
|
||||||
|
"mySql": "server=210.61.91.43;user=idafenweb;Database=solar_power_test;Port=10068;password=P@ssw0rd;charset='utf8';pooling=true;sslmode=none;",
|
||||||
//"DBConfig": {
|
//"DBConfig": {
|
||||||
// "Server": "AVXfxd+IRlLtJ0MCi9HU1g==",
|
// "Server": "AVXfxd+IRlLtJ0MCi9HU1g==",
|
||||||
// "port": "CrEmevYrUsSo7Mkb7Gxn8A==",
|
// "port": "CrEmevYrUsSo7Mkb7Gxn8A==",
|
||||||
@ -24,7 +25,7 @@
|
|||||||
//},
|
//},
|
||||||
"BackgroundServiceCron": {
|
"BackgroundServiceCron": {
|
||||||
"CalcPowerStationJob": "0 5 * * * ?",
|
"CalcPowerStationJob": "0 5 * * * ?",
|
||||||
"CalcAvgPowerStationJob": "0 0 2 * * ?",
|
"CalcAvgPowerStationJob": "0/10 * * * * ?",
|
||||||
"OperationScheduleJob": "0 0 2 * * ?",
|
"OperationScheduleJob": "0 0 2 * * ?",
|
||||||
"CalcInverter15minJob": "0 2/15 * * * ?",
|
"CalcInverter15minJob": "0 2/15 * * * ?",
|
||||||
"SendEmailJob": "0 0/5 * * * ?",
|
"SendEmailJob": "0 0/5 * * * ?",
|
||||||
@ -36,7 +37,7 @@
|
|||||||
"UserName": "shanghohui@gmail.com",
|
"UserName": "shanghohui@gmail.com",
|
||||||
"Password": "wswgnluvoodfexrb",
|
"Password": "wswgnluvoodfexrb",
|
||||||
"EnableSsl": true
|
"EnableSsl": true
|
||||||
},
|
}
|
||||||
//"SMTPConfig": {
|
//"SMTPConfig": {
|
||||||
// "Host": "smtp.gmail.com",
|
// "Host": "smtp.gmail.com",
|
||||||
// "Port": 25,
|
// "Port": 25,
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"LoginExpireMinute": 60, //登入到期時間,單位(分)
|
"LoginExpireMinute": 60, //登入到期時間,單位(分)
|
||||||
|
"mySql": "server=60.251.164.103;user=webuser;Database=solar_master;Port=11306;password=FICadmin99;charset='utf8';pooling=true;sslmode=none;",
|
||||||
//"DBConfig": {
|
//"DBConfig": {
|
||||||
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
|
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
|
||||||
// "port": "r4AoXMUDodcQjIzofGNCcg==",
|
// "port": "r4AoXMUDodcQjIzofGNCcg==",
|
||||||
|
|||||||
@ -11,7 +11,19 @@ namespace solarApp.Service
|
|||||||
{
|
{
|
||||||
public class procInvSvc
|
public class procInvSvc
|
||||||
{
|
{
|
||||||
string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
string Connection1 = string.Empty;
|
||||||
|
|
||||||
|
public procInvSvc(string Connection_parame = null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Connection_parame))
|
||||||
|
{
|
||||||
|
Connection1 = Connection_parame;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string _siteID { get; set; }
|
public string _siteID { get; set; }
|
||||||
public string _siteDB { get; set; }
|
public string _siteDB { get; set; }
|
||||||
|
|||||||
@ -11,7 +11,20 @@ namespace solarApp.Service
|
|||||||
{
|
{
|
||||||
public class procSensorSvc
|
public class procSensorSvc
|
||||||
{
|
{
|
||||||
string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
string Connection1 = string.Empty;
|
||||||
|
|
||||||
|
public procSensorSvc(string Connection_parame = null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Connection_parame))
|
||||||
|
{
|
||||||
|
Connection1 = Connection_parame;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public string _siteID { get; set; }
|
public string _siteID { get; set; }
|
||||||
public string _siteDB { get; set; }
|
public string _siteDB { get; set; }
|
||||||
|
|||||||
@ -10,7 +10,19 @@ namespace solarApp.Service
|
|||||||
{
|
{
|
||||||
public class procStationSvc
|
public class procStationSvc
|
||||||
{
|
{
|
||||||
string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
string Connection1 = string.Empty;
|
||||||
|
|
||||||
|
public procStationSvc(string Connection_parame = null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Connection_parame))
|
||||||
|
{
|
||||||
|
Connection1 = Connection_parame;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string _siteID { get; set; }
|
public string _siteID { get; set; }
|
||||||
public string _siteDB { get; set; }
|
public string _siteDB { get; set; }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user