diff --git a/SolarPower/Controllers/PowerStationController.cs b/SolarPower/Controllers/PowerStationController.cs index b678478..a513baf 100644 --- a/SolarPower/Controllers/PowerStationController.cs +++ b/SolarPower/Controllers/PowerStationController.cs @@ -2172,14 +2172,16 @@ namespace SolarPower.Controllers /// 取得該使用者可看的所有電站分佈縣市以及各縣市電站數量 /// /// - public async Task>> GetSolarCitySummary() + public async Task>> GetSolarCitySummary() { - ApiResult> apiResult = new ApiResult>(); - List solaramount = new List(); + ApiResult> apiResult = new ApiResult>(); + List solaramount = new List(); try { apiResult.Code = "0000"; - solaramount = await powerStationRepository.GetSolarCitySummary(myUser); + //solaramount = await powerStationRepository.GetSolarCitySummary(myUser); + solaramount = myPowerStationService.GetMyCities(myUser); + apiResult.Data = solaramount; } catch (Exception exception) @@ -2202,7 +2204,9 @@ namespace SolarPower.Controllers try { apiResult.Code = "0000"; - solaramount = await powerStationRepository.GetSolarByCity(myUser, cityid); + //solaramount = await powerStationRepository.GetSolarByCity(myUser, cityid); + + solaramount = myPowerStationService.GetMyPowerStations(myUser, cityid); foreach (var solar in solaramount) { diff --git a/SolarPower/Services/Implement/MyPowerStationService.cs b/SolarPower/Services/Implement/MyPowerStationService.cs index 0522503..c511adb 100644 --- a/SolarPower/Services/Implement/MyPowerStationService.cs +++ b/SolarPower/Services/Implement/MyPowerStationService.cs @@ -46,6 +46,7 @@ namespace SolarPower.Services.Implement foreach (var powerStations_group_item in myPowerStations_group) { MyPowerStationGroupByCity myPowerStationGroupByCity = new MyPowerStationGroupByCity(); + myPowerStationGroupByCity.CityId = powerStations_group_item.Key; myPowerStationGroupByCity.CityName = powerStations_group_item.First().CityName; myPowerStationGroupByCity.Amount = powerStations_group_item.Count(); myPowerStationGroupByCity.MyPowerStations = powerStations_group_item.ToList(); diff --git a/SolarPower/Views/AnalysisStationCombine/Index.cshtml b/SolarPower/Views/AnalysisStationCombine/Index.cshtml index dc3444e..60ad5a9 100644 --- a/SolarPower/Views/AnalysisStationCombine/Index.cshtml +++ b/SolarPower/Views/AnalysisStationCombine/Index.cshtml @@ -84,11 +84,11 @@

今日發電量

-

0.00

+

0.00

總發電量

-

0.00

+

0.00

@@ -102,14 +102,14 @@

今日發電金額

-

0.00

+

0.00

總發金額

-

0.00

+

0.00

- + }
@@ -119,11 +119,11 @@

今日有效日照時數

-

0.00

+

0.00

平均有效日照時數

-

0.00

+

0.00

@@ -135,11 +135,11 @@

今日PR值

-

0.00

+

0.00

平均 PR 值

-

0.00

+

0.00

@@ -152,11 +152,11 @@

今日減碳量

-

0.00

+

0.00

總減碳量

-

0.00

+

0.00

@@ -398,6 +398,7 @@ $('#total_kwhkwp').html(rel.data.all_KWH_KWP.toFixed(2)); $('#total_PR').html(rel.data.all_PR.toFixed(2)); $('#total_carbon').html(rel.data.all_Carbon.toFixed(2)); + $('#total_irradiance').html(rel.data.all_Carbon.toFixed(2)); $('#today_kwh').html(rel.data.now_kwh.toFixed(2)); @@ -405,6 +406,7 @@ $('#today_kwhkwp').html(rel.data.now_KWH_KWP.toFixed(2)); $('#today_PR').html(rel.data.now_PR.toFixed(2)); $('#today_carbon').html(rel.data.now_Carbon.toFixed(2)); + $('#today_irradiance').html(rel.data.now_Carbon.toFixed(2)); chart(); }) diff --git a/SolarPower/Views/PowerStation/Index.cshtml b/SolarPower/Views/PowerStation/Index.cshtml index 32d29f3..1a86541 100644 --- a/SolarPower/Views/PowerStation/Index.cshtml +++ b/SolarPower/Views/PowerStation/Index.cshtml @@ -437,7 +437,7 @@ $('#templateAreaTab').find('li').attr('id', 'AreaTab' + val.cityId).clone().appendTo($('#areaTab')); $('#AreaTab' + val.cityId).find('a').attr('href', '#tab-' + val.cityId); $('#AreaTab' + val.cityId).find('a').attr('class', 'nav-link fs-lg px-4'); - $('#AreaTab' + val.cityId).find('#areaName').html(val.city) + $('#AreaTab' + val.cityId).find('#areaName').html(val.cityName) $('#AreaTab' + val.cityId).find('#solarCount').html(val.amount) //alert(val.cityId+val.city + val.amount); //電站區域內容 @@ -455,12 +455,12 @@ } - function addPowerStationCard(idsd) { + function addPowerStationCard(ids) { //alert(ids); var url = "/PowerStation/GetSolarByCity"; var send_data = { - cityid: idsd + cityid: ids } $.post(url, send_data, function (rel) { if (rel.code != "0000") { @@ -473,6 +473,11 @@ }); $.each(rel.data, function (index, val) { //電站卡片 + + if (val.electricityMeterAt == undefined || val.electricityMeterAt == null) { + val.electricityMeterAt = ""; + } + $('#templateCard').find('.col-xl-2').attr('id', 'card' + val.id).clone().appendTo($('#solarCard' + val.cityId)); $('#card' + val.id).find('#editSolarUrl').attr('href', localurl + '/edit?stationId=' + val.id); $('#card' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay); @@ -487,6 +492,7 @@ '' + val.name + '' + '' + val.generatingCapacity.toFixed(2) + '' + '' + val.inverterAmount + '' + + '' + val.electricityMeterAt + '' + ' ' + diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index a030946..f4e52d0 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -122,7 +122,12 @@ }); //預設查詢自己的公司 - $("#select_power_station_company").val(@ViewBag.myUser.CompanyId).trigger('change'); + if (powerStationData == undefined || powerStationData == null) { + $("#select_power_station_company").val(@ViewBag.myUser.CompanyId).trigger('change'); + } + else { + $("#select_power_station_company").val(powerStationData.companyId).trigger('change'); + } }); //#endregion @@ -1074,15 +1079,7 @@ if ($('#power_station_operation_personnel').val().length == 0) { $('#power_station_operation_personnel-error').show(); } - - - - - } - - - } //#endregion diff --git a/SolarPower/Views/PowerStation/_StationInfo.cshtml b/SolarPower/Views/PowerStation/_StationInfo.cshtml index 2fd332c..cb0cb4e 100644 --- a/SolarPower/Views/PowerStation/_StationInfo.cshtml +++ b/SolarPower/Views/PowerStation/_StationInfo.cshtml @@ -23,7 +23,7 @@
@@ -31,7 +31,7 @@
@@ -178,7 +178,7 @@
-
+
光電板
diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index 091756c..2c24e4a 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -71,7 +71,7 @@
-
+

發電量

kW h
@@ -79,15 +79,15 @@

今日發電量

-

0.00

+

0.00

累積發電量

-

0.00

+

0.00

-
+

日照度

k W/㎡
@@ -95,15 +95,15 @@

即時平均日照度

-

0.00

+

0.00

平均日照度(30天)

-

0.00

+

0.00

-
+

PR值

%
@@ -111,15 +111,15 @@

即時平均 PR 值

-

0.00

+

0.00

平均 PR 值(30天)

-

0.00

+

0.00

-
+

有效日照時數

hr
@@ -127,15 +127,15 @@

即時平均有效日照時數

-

0.00

+

0.00

平均有效日照時數(30天)

-

0.00

+

0.00

-
+

減碳量

kG
@@ -143,11 +143,11 @@

今日減碳量

-

0.00

+

0.00

累積減碳量

-

0.00

+

0.00

@@ -185,7 +185,7 @@ {
@*

發電金額

*@ -

2,5840 NT

+

0 NT

}
@@ -386,8 +386,7 @@ $("#today_kwhkwp").html(0); $("#avg_kwhkwp").html(0); $("#today_carbon").html(0); - $("#total_power_station_count").html(0); - $("#total_capacity").html(0); + $("#total_carbon").html(0); $("#update_at").html(0); } else { @@ -582,7 +581,7 @@ StatusType = true; }*@ - var checked = $(this).attr("data-checked"); + var checked = $(this).attr("data-checked") == "true"; if (checked) { $(this).attr("data-checked", false); $("input[name='powerStationStatus[]']").prop('checked', false); diff --git a/SolarPower/Views/StationOverview/_Info.cshtml b/SolarPower/Views/StationOverview/_Info.cshtml index c8228d1..488ae10 100644 --- a/SolarPower/Views/StationOverview/_Info.cshtml +++ b/SolarPower/Views/StationOverview/_Info.cshtml @@ -151,7 +151,7 @@
-
+
光電板
diff --git a/SolarPower/Views/StationOverview/_UpToDate.cshtml b/SolarPower/Views/StationOverview/_UpToDate.cshtml index ae82fa9..542cbc3 100644 --- a/SolarPower/Views/StationOverview/_UpToDate.cshtml +++ b/SolarPower/Views/StationOverview/_UpToDate.cshtml @@ -8,11 +8,11 @@

今日發電量

-

0.00

+

0.00

累積發電量

-

0.00

+

0.00

@@ -23,12 +23,12 @@
-

總發金額

-

0.00

+

發電金額

+

0.00

-

平均發電金額

-

0.00

+

總發電金額

+

0.00

@@ -40,11 +40,11 @@

即時平均日照度

-

0.00

+

0.00

平均日照度(30天)

-

0.00

+

0.00

@@ -56,11 +56,11 @@

即時平均 PR 值

-

0.00

+

0.00

平均 PR 值(30天)

-

0.00

+

0.00

@@ -72,11 +72,11 @@

即時平均有效日照時數

-

0.00

+

0.00

平均有效日照時數(30天)

-

0.00

+

0.00

@@ -88,11 +88,11 @@

今日減碳量

-

0.00

+

0.00

累積減碳量

-

0.00

+

0.00