電站資訊-歷史紀錄: 修改歷年的日均發電度數、累積日照量
This commit is contained in:
parent
eea5486df1
commit
bc33b47ce1
@ -204,6 +204,8 @@ namespace SolarPower.Models
|
||||
/// </summary>
|
||||
public double IrrDay { get; set; }
|
||||
public double IrrDayHour { get; set; }
|
||||
public double GeneratingCapacity { get; set; }
|
||||
public int days { get; set; }
|
||||
}
|
||||
|
||||
public class ExceptionEmailInfo
|
||||
|
||||
@ -731,12 +731,18 @@ namespace SolarPower.Repository.Implement
|
||||
// LEFT JOIN sensor_history_month P ON P.`TIMESTAMP` = C.`TIMESTAMP` AND P.PowerStationId = C.PowerStationId
|
||||
// WHERE C.PowerStationId = {post.PowerstationId}
|
||||
// GROUP BY left(c.`TIMESTAMP`, 4) ORDER BY C.`TIMESTAMP` ";
|
||||
sql = $@" select left(c.`TIMESTAMP`, 4) AS `TIMESTAMP`, sum(monthKWH) AS KWH, round(AVG(PR), 2) AS PR , round(AVG(PR), 2) AS avgPR ,
|
||||
ifnull(avg( P.IrrDay), 0) irrDay, avg(P.Temperature) AS Temp
|
||||
sql = $@"select * from (
|
||||
select left(c.`TIMESTAMP`, 4) AS `TIMESTAMP`, sum(monthKWH) AS KWH, round(AVG(PR), 2) AS PR , round(AVG(PR), 2) AS avgPR ,
|
||||
ifnull(avg( P.IrrDay), 0) irrDay, avg(P.Temperature) AS Temp, ps.GeneratingCapacity AS GeneratingCapacity
|
||||
FROM power_station_history_month C
|
||||
LEFT JOIN sensor_history_month P ON DATE_FORMAT(P.TIMESTAMP, '%Y-%M') = DATE_FORMAT(C.TIMESTAMP, '%Y-%M') AND P.PowerStationId = C.PowerStationId
|
||||
LEFT JOIN power_station ps ON ps.id = C.PowerStationId
|
||||
WHERE C.PowerStationId = {post.PowerstationId}
|
||||
group by left(c.`TIMESTAMP`, 4) ";
|
||||
group by left(c.`TIMESTAMP`, 4)
|
||||
)x join
|
||||
(
|
||||
select year(timestamp) yyyy, count(*) days from sensor_history_day where PowerStationId = {post.PowerstationId} group by year(timestamp)
|
||||
)y on x.`TIMESTAMP` = y.yyyy";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -2648,6 +2648,8 @@
|
||||
var times = 1;
|
||||
var ALLkwhkwp = 0;
|
||||
var kwhkwp = 0;
|
||||
var ALLDays = 0;
|
||||
var ALLavgdaykwh = 0;
|
||||
|
||||
|
||||
$.each(rel.data, function (index, val) {
|
||||
@ -2675,6 +2677,7 @@
|
||||
//暫時先執行到這--->取kwhkwp
|
||||
|
||||
var nowDisplayIrrDay = 0;
|
||||
var avgdaykwh = 0;
|
||||
|
||||
if (val.length != 0) {
|
||||
if (groupType != 6) {
|
||||
@ -2682,7 +2685,7 @@
|
||||
if (groupType == 0 && kwhkwp < val.kwhkwp.toFixed(2)) {
|
||||
kwhkwp = val.kwhkwp.toFixed(2);
|
||||
}
|
||||
if (groupType != 0) {
|
||||
if (groupType != 0 && groupType != 3) {
|
||||
ALLkwhkwp += val.kwhkwp;
|
||||
kwhkwp = (ALLkwhkwp / times).toFixed(2);
|
||||
times++;
|
||||
@ -2691,16 +2694,25 @@
|
||||
nowDisplayIrrDay = val.irrDayHour.toFixed(2);
|
||||
}
|
||||
else {
|
||||
nowDisplayIrrDay = val.irradiance.toFixed(2);
|
||||
nowDisplayIrrDay = val.irrDay.toFixed(2);
|
||||
}
|
||||
if (groupType == 3)
|
||||
{
|
||||
ALLDays += val.days;
|
||||
avgdaykwh = (val.kwh / val.generatingCapacity / val.days);
|
||||
ALLavgdaykwh += avgdaykwh;
|
||||
}
|
||||
else
|
||||
{
|
||||
avgdaykwh = val.kwhkwp;
|
||||
}
|
||||
// console.log(val);
|
||||
diffSOLARHOURALL = val.solarhour;
|
||||
$('#HistoryDetailTable').append('<tr>' +
|
||||
'<td>' + val.timestamp + '</td>' +
|
||||
'<td>' + (toThousands(val.kwh.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(val.kwhkwp.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(nowDisplayIrrDay)) + '</td>' + //irrDay
|
||||
//'<td>' + val.irradiance.toFixed(2) + '</td>' +
|
||||
'<td>' + (toThousands(avgdaykwh.toFixed(2))) + '</td>' +//val.kwhkwp
|
||||
'<td>' + (toThousands(nowDisplayIrrDay)) + '</td>' +
|
||||
'<td>' + (toThousands(val.pr.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(val.temp.toFixed(2))) + '</td>' +
|
||||
'</tr>');
|
||||
@ -2713,25 +2725,33 @@
|
||||
listtemperature.push(parseFloat(val.temp.toFixed(2)));
|
||||
listsolarhour.push(parseFloat(val.solarhour.toFixed(2)));
|
||||
listpr.push(parseFloat(val.pr.toFixed(2)));
|
||||
listkwhkwp.push(parseFloat(val.kwhkwp.toFixed(2)));
|
||||
listkwhkwp.push(parseFloat(avgdaykwh));//val.kwhkwp
|
||||
}
|
||||
else
|
||||
{
|
||||
if (groupType == 0 && kwhkwp < val.kwhkwp.toFixed(2)) {
|
||||
kwhkwp = val.kwhkwp.toFixed(2);
|
||||
}
|
||||
if (groupType != 0) {
|
||||
if (groupType != 0 && groupType != 3) {
|
||||
ALLkwhkwp += val.kwhkwp;
|
||||
kwhkwp = (ALLkwhkwp / times).toFixed(2);
|
||||
times++;
|
||||
}
|
||||
|
||||
if (groupType == 3) {
|
||||
ALLDays += val.days;
|
||||
avgdaykwh = (val.kwh / val.generatingCapacity / val.days);
|
||||
ALLavgdaykwh += avgdaykwh;
|
||||
}
|
||||
else {
|
||||
avgdaykwh = val.kwhkwp;
|
||||
}
|
||||
diffSOLARHOURALL += val.diffSOLARHOUR;
|
||||
$('#HistoryDetailTable').append('<tr>' +
|
||||
'<td>' + val.timestamp + '</td>' +
|
||||
'<td>' + (toThousands(val.kwh.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(val.kwhkwp.toFixed(2))) + '</td>' +
|
||||
|
||||
//'<td>' + val.irradiance.toFixed(2) + '</td>' +
|
||||
'<td>' + (toThousands(avgdaykwh.toFixed(2))) + '</td>' +//val.kwhkwp
|
||||
'<td>' + (toThousands(val.irrDay.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(val.pr.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(val.temp.toFixed(2))) + '</td>' +
|
||||
'</tr>');
|
||||
@ -2744,7 +2764,7 @@
|
||||
listtemperature.push(parseFloat(val.temp.toFixed(2)));
|
||||
listsolarhour.push(parseFloat(val.solarhour.toFixed(2)));
|
||||
listpr.push(parseFloat(val.pr.toFixed(2)));
|
||||
listkwhkwp.push(parseFloat(val.kwhkwp.toFixed(2)));
|
||||
listkwhkwp.push(parseFloat(avgdaykwh));//val.kwhkwp
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -2866,10 +2886,18 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
var avgK = 0;
|
||||
if (groupType == 3) {
|
||||
avgK = ALLavgdaykwh / rel.data.length;//(kwhALL / rel.data[0].generatingCapacity / ALLDays).toFixed(2);
|
||||
}
|
||||
else {
|
||||
avgdaykwh = kwhkwp;
|
||||
}
|
||||
|
||||
$('#HistoryTotalTable').append('<tr>' +
|
||||
'<td>' + TimestampALL + '</td>' +
|
||||
'<td>' + (toThousands(kwhALL.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(kwhkwp)) + '</td>' +
|
||||
'<td>' + (toThousands(avgK.toFixed(2))) + '</td>' +
|
||||
//'<td>' + irradianceALL.toFixed(2) + '</td>' + // 改成累積日照 by jiahao 2022-04-30 00:444
|
||||
'<td>' + (toThousands(avgIrr_day.toFixed(2))) + '</td>' +
|
||||
'<td>' + (toThousands(avgPR.toFixed(2))) + '</td>' +
|
||||
|
||||
Loading…
Reference in New Issue
Block a user