debug 月報表匯出 - 平均發電量為 0
This commit is contained in:
parent
c0a7a2a7dc
commit
37f769d4f5
@ -472,7 +472,7 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
#region 顯示body //RowPosition = 1
|
#region 顯示body //RowPosition = 1
|
||||||
RowPosition++;
|
RowPosition++;
|
||||||
var avghour = "0"; var avgKWHKWP = "0"; var avgdayKWH = "0"; var monthKWH = "0"; var monthmoney = "0"; var monthmoneyone = "0";
|
var avghour = "0"; var avgKWHKWP = "0"; var avgdayKWH = "0"; double avgdayKWH_value = 0; var monthKWH = "0"; var monthmoney = "0"; var monthmoneyone = "0";
|
||||||
var monthGeneratingCapacity = "";
|
var monthGeneratingCapacity = "";
|
||||||
var check_hire = false;
|
var check_hire = false;
|
||||||
var sitedb = "";
|
var sitedb = "";
|
||||||
@ -488,7 +488,7 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
avghour = Convert.ToString( dbody["tothour"]) ?? "NaN";
|
avghour = Convert.ToString( dbody["tothour"]) ?? "NaN";
|
||||||
avgKWHKWP = Convert.ToString(dbody["KWHKWP"]) ?? "NaN";
|
avgKWHKWP = Convert.ToString(dbody["KWHKWP"]) ?? "NaN";
|
||||||
avgKWHKWP = Convert.ToString(dbody["dayKWH"]) ?? "NaN";
|
avgdayKWH = Convert.ToString(dbody["dayKWH"]) ?? "NaN";
|
||||||
|
|
||||||
//if (dbody.TryGetValue("tothour", out vv))
|
//if (dbody.TryGetValue("tothour", out vv))
|
||||||
// avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
|
// avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
|
||||||
@ -507,7 +507,14 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
//avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
|
//avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
|
||||||
//avgKWHKWP = (Convert.ToDouble(dbody["KWHKWP"].ToString()) + Convert.ToDouble(avgKWHKWP)).ToString();
|
//avgKWHKWP = (Convert.ToDouble(dbody["KWHKWP"].ToString()) + Convert.ToDouble(avgKWHKWP)).ToString();
|
||||||
//avgdayKWH = (Convert.ToDouble(dbody["dayKWH"].ToString()) + Convert.ToDouble(avgdayKWH)).ToString();
|
|
||||||
|
//累加 平均發電量(日)
|
||||||
|
if (avgdayKWH != "NaN")
|
||||||
|
avgdayKWH_value += Convert.ToDouble(avgdayKWH);
|
||||||
|
|
||||||
|
|
||||||
|
// avgdayKWH = (Convert.ToDouble(dbody["dayKWH"].ToString()) + Convert.ToDouble(avgdayKWH)).ToString();
|
||||||
|
|
||||||
monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString();
|
monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString();
|
||||||
monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString();
|
monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString();
|
||||||
monthmoneyone = dbody["monthmoneyone"] == null ? "0" : dbody["monthmoneyone"].ToString();
|
monthmoneyone = dbody["monthmoneyone"] == null ? "0" : dbody["monthmoneyone"].ToString();
|
||||||
@ -635,7 +642,7 @@ namespace SolarPower.Controllers
|
|||||||
cell.CellStyle = styleLine12;
|
cell.CellStyle = styleLine12;
|
||||||
index++;
|
index++;
|
||||||
cell = row.CreateCell(index);
|
cell = row.CreateCell(index);
|
||||||
cell.SetCellValue(Math.Round(Convert.ToDouble(avgdayKWH) / Useday,2));
|
cell.SetCellValue(Math.Round(avgdayKWH_value / Useday, 2));
|
||||||
cell.CellStyle = styleLine12;
|
cell.CellStyle = styleLine12;
|
||||||
index++;
|
index++;
|
||||||
cell = row.CreateCell(index);
|
cell = row.CreateCell(index);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace solarApp.Service
|
|||||||
// string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM");
|
// string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM");
|
||||||
_siteID = siteID;
|
_siteID = siteID;
|
||||||
//搬移的月份
|
//搬移的月份
|
||||||
move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM")+ "--01";
|
move_month = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM")+ "--01";
|
||||||
// move_month = System.DateTime.Now.ToString("yyyy-MM") + "--01"; //這個月
|
// move_month = System.DateTime.Now.ToString("yyyy-MM") + "--01"; //這個月
|
||||||
//_date1 = date1;
|
//_date1 = date1;
|
||||||
get_siteInfo();
|
get_siteInfo();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user