Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
873ddc32c2
@ -107,7 +107,6 @@ namespace SolarPower.Controllers
|
||||
|
||||
int stationId = stationId_param == "new" ? 0 : int.Parse(stationId_param);
|
||||
|
||||
|
||||
if (stationId > 0)
|
||||
{
|
||||
var hasSubTagNum = false;
|
||||
@ -133,16 +132,7 @@ namespace SolarPower.Controllers
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//電站管理的新增電站
|
||||
ViewData["SubNum"] = myPowerStationSummaries.Count();
|
||||
ViewData["TagNum"] = 0;
|
||||
}
|
||||
}else if(controllerName == "PowerStation" && actionName == "Index")
|
||||
{
|
||||
ViewData["SubNum"] = myPowerStationSummaries.Count();
|
||||
ViewData["TagNum"] = 0;
|
||||
|
||||
}
|
||||
|
||||
ViewBag.auths = auth_arr;
|
||||
|
||||
@ -146,8 +146,6 @@ namespace SolarPower.Quartz.Jobs
|
||||
calcPowerStation.Id = powerStation.Id;
|
||||
var dateNowDay = DateTimeNow.AddDays(-1).ToString("yyyy-MM-dd");
|
||||
|
||||
dateNowDay = "2021-07-19";
|
||||
|
||||
#region step2-1. 計算該電站的30天平均資料
|
||||
var table_name = String.Format("`{0}`.`s{1}01_station`", powerStation.SiteDB, powerStation.Code);
|
||||
logger.LogInformation("【CalcAvgPowerStationJob】【開始計算電站[{0}]在{1}的30天平均資料】", powerStation.Code, dateNowDay);
|
||||
|
||||
@ -68,7 +68,7 @@ namespace SolarPower.Quartz.Jobs
|
||||
var calcPowerStation = new PowerStation();
|
||||
calcPowerStation.Id = powerStation.Id;
|
||||
|
||||
var dateTime = DateTimeNow.AddHours(-3).ToString("yyyy-MM-dd HH");
|
||||
var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH");
|
||||
|
||||
#region step2-1. 取得該電站的當前這小時的歷史資料
|
||||
var table_name = String.Format("`{0}`.s{1}01_station", powerStation.SiteDB, powerStation.Code);
|
||||
@ -355,8 +355,8 @@ namespace SolarPower.Quartz.Jobs
|
||||
"Today_kwh",
|
||||
"Total_kwh",
|
||||
"today_kwhkwp",
|
||||
"today_monery",
|
||||
"total_monery",
|
||||
"today_money",
|
||||
"total_money",
|
||||
"today_PR",
|
||||
"today_carbon",
|
||||
"total_carbon",
|
||||
|
||||
@ -578,8 +578,8 @@ namespace SolarPower.Repository.Implement
|
||||
`Total_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '總發電量',
|
||||
`today_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '今日kwhkwp',
|
||||
`avg_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '30天平均kwhkwp',
|
||||
`today_monery` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日金額',
|
||||
`total_monery` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '總金額',
|
||||
`today_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日金額',
|
||||
`total_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '總金額',
|
||||
`today_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '電站Pr值',
|
||||
`avg_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '平均Pr值',
|
||||
`today_carbon` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日減碳量',
|
||||
|
||||
@ -53,8 +53,8 @@ namespace SolarPower.Repository.Implement
|
||||
AVG(ps.avg_PR) AS avg_PR,
|
||||
AVG(ps.today_kwhkwp) AS today_kwhkwp,
|
||||
AVG(ps.avg_kwhkwp) AS avg_kwhkwp,
|
||||
SUM(ps.today_monery) AS today_monery,
|
||||
SUM(ps.total_monery) AS total_monery,
|
||||
SUM(ps.today_money) AS today_monery,
|
||||
SUM(ps.total_money) AS total_monery,
|
||||
SUM(ps.today_carbon) AS today_carbon,
|
||||
SUM(ps.total_carbon) AS total_carbon
|
||||
FROM power_station ps
|
||||
@ -224,7 +224,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_day ps
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m-%d')
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') BETWEEN @StartDay AND @NowDay";
|
||||
|
||||
@ -248,7 +248,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_day ps
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m-%d')
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') BETWEEN @StartDay AND @NowDay";
|
||||
|
||||
@ -273,7 +273,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_month ps
|
||||
LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m')
|
||||
LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(pyr.timestamp, '%Y-%m')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y') = @Year";
|
||||
|
||||
@ -385,7 +385,7 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql_power = @$"SELECT DATE_FORMAT(inv.TIMESTAMP, '%Y-%m-%d %H') AS TIMESTAMP,
|
||||
var sql_power = @$"SELECT DATE_FORMAT(inv.TIMESTAMP, '%H %p') AS TIMESTAMP,
|
||||
inv.INVERTERID,
|
||||
inv.KWH
|
||||
FROM inverter_history_hour inv
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<div id="panel-5" class="panel">
|
||||
<div class="panel-container show">
|
||||
<div class="panel-content">
|
||||
<div class="row subheader">
|
||||
<div class="row subheader d-flex justify-content-between">
|
||||
<div class="col-xl-2">
|
||||
<h1 class="subheader-title">
|
||||
<span class="icon-stack fa-1x">
|
||||
@ -2229,8 +2229,7 @@
|
||||
data: listirradiance
|
||||
}, {
|
||||
type: 'bar',
|
||||
borderColor: 'rgba(103, 180, 172, 1)',
|
||||
backgroundColor: 'rgba(103, 180, 172, 0.2)',
|
||||
backgroundColor: 'rgba(103, 180, 172, 1)',
|
||||
borderWidth: 1,
|
||||
label: '發電量(kWh)',
|
||||
yAxisID: 'A',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user