From d4e1e68552e950e57ce4eb43e359490953b3884b Mon Sep 17 00:00:00 2001 From: b110212000 Date: Fri, 11 Feb 2022 17:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 4 +- .../Views/AnalysisStationCombine/Index.cshtml | 24 +++++------ SolarPower/Views/ExceptionRecord/Index.cshtml | 8 ++++ SolarPower/Views/MapOverview/Index.cshtml | 33 ++++++++------- SolarPower/Views/Operation/Index.cshtml | 5 +++ .../Views/Operation/OperationRecord.cshtml | 9 +++++ SolarPower/Views/StationOverview/Index.cshtml | 28 ++++++------- .../StationOverviewInfo.cshtml | 40 ++++++++++++------- .../Views/StationOverview/_Inverter.cshtml | 2 +- SolarPower/Views/StationReport/Index.cshtml | 18 +-------- SolarPower/wwwroot/js/site.js | 21 ++++++++++ 11 files changed, 118 insertions(+), 74 deletions(-) diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 79a6381..86af364 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -42,7 +42,9 @@ namespace SolarPower.Quartz.Jobs var ExceptionList = await overviewRepository.GetEmailExceptionList(); if(ExceptionList.Count > 0 ) { - var ExceptionListex = ExceptionList.Where(x => x.normalTime == "1970-01-01 08:00:00" && DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).Minutes >= ExceptionTimes).ToList(); + //var a = ExceptionList.Where(x=>x.id == 39835).Select(x => (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60)).ToList(); + + var ExceptionListex = ExceptionList.Where(x => x.normalTime == "1970-01-01 08:00:00" && (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes).ToList(); foreach (var Exception in ExceptionListex) diff --git a/SolarPower/Views/AnalysisStationCombine/Index.cshtml b/SolarPower/Views/AnalysisStationCombine/Index.cshtml index bcde727..945dcf0 100644 --- a/SolarPower/Views/AnalysisStationCombine/Index.cshtml +++ b/SolarPower/Views/AnalysisStationCombine/Index.cshtml @@ -425,20 +425,20 @@ toast_error(rel.msg); return; } - $('#total_kwh').html(rel.data.all_kwh.toFixed(2)); - $('#total_money').html(rel.data.all_money.toFixed()); - $('#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_irradiance.toFixed(2)); + $('#total_kwh').html(toThousands(rel.data.all_kwh.toFixed(2))); + $('#total_money').html(toThousands(rel.data.all_money.toFixed())); + $('#total_kwhkwp').html(toThousands(rel.data.all_KWH_KWP.toFixed(2))); + $('#total_PR').html(toThousands(rel.data.all_PR.toFixed(2))); + $('#total_carbon').html(toThousands(rel.data.all_Carbon.toFixed(2))); + $('#total_irradiance').html(toThousands(rel.data.all_irradiance.toFixed(2))); - $('#today_kwh').html(rel.data.now_kwh.toFixed(2)); - $('#today_money').html(rel.data.now_money.toFixed()); - $('#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_irradiance.toFixed(2)); + $('#today_kwh').html(toThousands(rel.data.now_kwh.toFixed(2))); + $('#today_money').html(toThousands(rel.data.now_money.toFixed())); + $('#today_kwhkwp').html(toThousands(rel.data.now_KWH_KWP.toFixed(2))); + $('#today_PR').html(toThousands(rel.data.now_PR.toFixed(2))); + $('#today_carbon').html(toThousands(rel.data.now_Carbon.toFixed(2))); + $('#today_irradiance').html(toThousands(rel.data.now_irradiance.toFixed(2))); chart(); }) diff --git a/SolarPower/Views/ExceptionRecord/Index.cshtml b/SolarPower/Views/ExceptionRecord/Index.cshtml index 33c3170..84d553a 100644 --- a/SolarPower/Views/ExceptionRecord/Index.cshtml +++ b/SolarPower/Views/ExceptionRecord/Index.cshtml @@ -397,6 +397,7 @@ if (data == null || data.length == 0) { this.data = []; } + $('#Exception_Table_wrapper').show(); return data; } }, @@ -409,6 +410,7 @@ //#region 改變項目 function ChangeType(type) { + $('#Exception_Table_wrapper').hide(); Type = type; for (var i = 0; i < 2; i++) { var name = "button" + i; @@ -428,6 +430,7 @@ //#region 縣市全選 function Allcity() { + $('#Exception_Table_wrapper').hide(); var Newpowerids = new Array(0); ids = []; $.each(Allids, function (index, val) { @@ -482,6 +485,7 @@ //#region 查詢近30天 function ChangeDate30() { + $('#Exception_Table_wrapper').hide(); var today = new Date(); var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); @@ -498,6 +502,7 @@ //#region 電站全選 function Allpowerstation() { + $('#Exception_Table_wrapper').hide(); if (AllpoweridsType) { AllpoweridsType = false; } else { @@ -520,6 +525,7 @@ //#region 選擇縣市 $('#city').on("click", "button", function () { + $('#Exception_Table_wrapper').hide(); var clickid = $(this).attr('id'); var classid = clickid.split("_"); var Newpowerids = new Array(0); @@ -572,6 +578,7 @@ //#region 選擇電站checkbox $('#CheckPowerStation').on("click", "input", function () { + $('#Exception_Table_wrapper').hide(); var clickid = $(this).attr('id'); var classid = clickid.split("_"); var job = document.getElementById(clickid); @@ -587,6 +594,7 @@ //#endregion function getPowerStationCheckBox() { + $('#Exception_Table_wrapper').hide(); var send_data = { cityIds: ids } diff --git a/SolarPower/Views/MapOverview/Index.cshtml b/SolarPower/Views/MapOverview/Index.cshtml index 4f33c0e..35a9c93 100644 --- a/SolarPower/Views/MapOverview/Index.cshtml +++ b/SolarPower/Views/MapOverview/Index.cshtml @@ -194,9 +194,12 @@ "columns": [{ "data": "cityName" }, { - "data": "subPowerStationCount" + "data": "subPowerStationCount", + "render": function (data, type, row) { + return toThousands(data); + } }, { - "data": "subTotalCapacity" + "data": "subTotalCapacity" }], "columnDefs": [{ 'targets': 2, @@ -205,7 +208,7 @@ 'createdCell': function (td, cellData, rowData, row, col) { @*$(td).append('
');*@ cellData = cellData.toFixed(3); - $(td).html(cellData); + $(td).html(toThousands(cellData)); } }], "language": { @@ -243,18 +246,18 @@ mapOverview = rel.data; - $("#today_kwh").html(mapOverview.today_kwh.toFixed(2)); - $("#total_kwh").html(mapOverview.total_kwh.toFixed(2)); - $("#today_irradiance").html(mapOverview.today_irradiance.toFixed(2)); - $("#avg_irradiance").html(mapOverview.avg_irradiance.toFixed(2)); - $("#today_PR").html(mapOverview.today_PR.toFixed(2)); - $("#avg_PR").html(mapOverview.avg_PR.toFixed(2)); - $("#today_kwhkwp").html(mapOverview.today_kwhkwp.toFixed(2)); - $("#avg_kwhkwp").html(mapOverview.avg_kwhkwp.toFixed(2)); - $("#today_carbon").html(mapOverview.today_carbon.toFixed(2)); - $("#total_carbon").html(mapOverview.total_carbon.toFixed(2)); - $("#total_power_station_count").html(mapOverview.totalPowerStationCount); - $("#total_capacity").html(mapOverview.totalCapacity.toFixed(3)); + $("#today_kwh").html(toThousands(mapOverview.today_kwh.toFixed(2))); + $("#total_kwh").html(toThousands(mapOverview.total_kwh.toFixed(2))); + $("#today_irradiance").html(toThousands(mapOverview.today_irradiance.toFixed(2))); + $("#avg_irradiance").html(toThousands(mapOverview.avg_irradiance.toFixed(2))); + $("#today_PR").html(toThousands(mapOverview.today_PR.toFixed(2))); + $("#avg_PR").html(toThousands(mapOverview.avg_PR.toFixed(2))); + $("#today_kwhkwp").html(toThousands(mapOverview.today_kwhkwp.toFixed(2))); + $("#avg_kwhkwp").html(toThousands(mapOverview.avg_kwhkwp.toFixed(2))); + $("#today_carbon").html(toThousands(mapOverview.today_carbon.toFixed(2))); + $("#total_carbon").html(toThousands(mapOverview.total_carbon.toFixed(2))); + $("#total_power_station_count").html(toThousands(mapOverview.totalPowerStationCount)); + $("#total_capacity").html(toThousands(mapOverview.totalCapacity.toFixed(3))); $("#update_at").html(mapOverview.updatedAt); capacityTable.clear().rows.add(mapOverview.capacityDataTables).draw(); diff --git a/SolarPower/Views/Operation/Index.cshtml b/SolarPower/Views/Operation/Index.cshtml index 388a94a..b2fa2cc 100644 --- a/SolarPower/Views/Operation/Index.cshtml +++ b/SolarPower/Views/Operation/Index.cshtml @@ -383,6 +383,7 @@ if (data == null || data.length == 0) { this.data = []; } + $('#OperationPlan_table_wrapper').show(); return data; } }, @@ -457,6 +458,7 @@ //#region 電站全選 function Allpowerstation() { + $('#OperationPlan_table_wrapper').hide(); if (AllpoweridsType) { AllpoweridsType = false; } else { @@ -535,6 +537,7 @@ //#endregion function getPowerStationCheckBox() { + $('#OperationPlan_table_wrapper').hide(); var send_data = { cityIds: ids } @@ -576,6 +579,7 @@ //#region 選擇電站checkbox $('#CheckPowerStation').on("click", "input", function () { + $('#OperationPlan_table_wrapper').hide(); var clickid = $(this).attr('id'); var classid = clickid.split("_"); var job = document.getElementById(clickid); @@ -593,6 +597,7 @@ //#region 更改項目 function ChangeType(Num) { + $('#OperationPlan_table_wrapper').hide(); type = Num; OperationPlanTable.ajax.reload(); if (Num == 9) diff --git a/SolarPower/Views/Operation/OperationRecord.cshtml b/SolarPower/Views/Operation/OperationRecord.cshtml index dac2a90..3ef8926 100644 --- a/SolarPower/Views/Operation/OperationRecord.cshtml +++ b/SolarPower/Views/Operation/OperationRecord.cshtml @@ -595,6 +595,7 @@ } else { realdata = this.data; } + $('#operation_record_table_wrapper').show(); return realdata; } }, @@ -664,6 +665,7 @@ //#region 改變項目 function ChangeType(type) { + $('#operation_record_table_wrapper').hide(); Type = type; for (var i = 0; i < 4; i++) { @@ -719,6 +721,7 @@ //#region 縣市全選 function Allcity() { + $('#operation_record_table_wrapper').hide(); var Newpowerids = new Array(0); ids = []; $.each(Allids, function (index, val) { @@ -862,6 +865,7 @@ //#region 電站全選 function Allpowerstation() { + $('#operation_record_table_wrapper').hide(); if (AllpoweridsType) { AllpoweridsType = false; } else { @@ -890,6 +894,7 @@ //#region 選擇縣市 $('#city').on("click", "button", function () { + $('#operation_record_table_wrapper').hide(); var clickid = $(this).attr('id'); var classid = clickid.split("_"); var Newpowerids = new Array(0); @@ -947,6 +952,7 @@ //#region 選擇電站checkbox $('#CheckPowerStation').on("click", "input", function () { + $('#operation_record_table_wrapper').hide(); var clickid = $(this).attr('id'); var classid = clickid.split("_"); var job = document.getElementById(clickid); @@ -1428,6 +1434,7 @@ //#region 查詢近30天 function ChangeDate30() { + $('#operation_record_table_wrapper').hide(); var today = new Date(); var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); @@ -1444,6 +1451,7 @@ //#region 改狀態 function CheckStatus(type, e) { + $('#operation_record_table_wrapper').hide(); status = type; if ($(".status-type").hasClass("btn-success")) { $(".status-type").removeClass("btn-success").addClass("btn-secondary"); @@ -1460,6 +1468,7 @@ //#endregion function Search() { + $('#operation_record_table_wrapper').hide(); Searchtype = true; AllidsType = false; AllpoweridsType = false; diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index 6f96a5e..ede6ce9 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -427,15 +427,15 @@ $('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id); @*$('#card_' + val.id).find('#date').html(time.getMonth() + "/" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes());*@ $('#card_' + val.id).find('#date').html(val.electricityMeterAt); - $('#card_' + val.id).find('#today_kwh').html(val.today_kWh.toFixed(2)); - $('#card_' + val.id).find('#Capacity').html(val.generatingCapacity.toFixed(3)); + $('#card_' + val.id).find('#today_kwh').html(toThousands(val.today_kWh.toFixed(2))); + $('#card_' + val.id).find('#Capacity').html(toThousands(val.generatingCapacity.toFixed(3))); @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) { - $('#card_' + val.id).find('#PowerRate').html((val.today_Money).toFixed()); + $('#card_' + val.id).find('#PowerRate').html(toThousands((val.today_Money).toFixed())); } - $('#card_' + val.id).find('#PR').html(val.today_PR); + $('#card_' + val.id).find('#PR').html(toThousands(val.today_PR)); $('#card_' + val.id).find('#aria').attr('aria-valuenow', val.today_PR); $('#card_' + val.id).find('#aria').attr('style', "width:" + val.today_PR + "%;"); powerids.push(val.id); @@ -505,16 +505,16 @@ $("#update_at").html(mapOverview.updatedAt); });*@ - $("#today_kwh").html(powerStationSummary.today_kwh.toFixed(2)); - $("#total_kwh").html(powerStationSummary.total_kwh.toFixed(2)); - $("#today_irradiance").html(powerStationSummary.today_irradiance.toFixed(2)); - $("#avg_irradiance").html(powerStationSummary.avg_irradiance.toFixed(2)); - $("#today_PR").html(powerStationSummary.today_PR.toFixed(2)); - $("#avg_PR").html(powerStationSummary.avg_PR.toFixed(2)); - $("#today_kwhkwp").html(powerStationSummary.today_kwhkwp.toFixed(2)); - $("#avg_kwhkwp").html(powerStationSummary.avg_kwhkwp.toFixed(2)); - $("#today_carbon").html(powerStationSummary.today_carbon.toFixed(2)); - $("#total_carbon").html(powerStationSummary.total_carbon.toFixed(2)); + $("#today_kwh").html(toThousands(powerStationSummary.today_kwh.toFixed(2))); + $("#total_kwh").html(toThousands(powerStationSummary.total_kwh.toFixed(2))); + $("#today_irradiance").html(toThousands(powerStationSummary.today_irradiance.toFixed(2))); + $("#avg_irradiance").html(toThousands(powerStationSummary.avg_irradiance.toFixed(2))); + $("#today_PR").html(toThousands(powerStationSummary.today_PR.toFixed(2))); + $("#avg_PR").html(toThousands(powerStationSummary.avg_PR.toFixed(2))); + $("#today_kwhkwp").html(toThousands(powerStationSummary.today_kwhkwp.toFixed(2))); + $("#avg_kwhkwp").html(toThousands(powerStationSummary.avg_kwhkwp.toFixed(2))); + $("#today_carbon").html(toThousands(powerStationSummary.today_carbon.toFixed(2))); + $("#total_carbon").html(toThousands(powerStationSummary.total_carbon.toFixed(2))); $("#update_at").html(powerStationSummary.updatedAt); } diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index ed4c5c2..43f3c40 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -215,18 +215,18 @@ } stationOverview = rel.data; - $("#today_kwh").html(stationOverview.today_kwh.toFixed(2)); - $("#total_kwh").html(stationOverview.total_kwh.toFixed(2)); - $("#today_irradiance").html(stationOverview.today_irradiance.toFixed(2)); - $("#avg_irradiance").html(stationOverview.avg_irradiance.toFixed(2)); - $("#today_PR").html(stationOverview.today_PR.toFixed(2)); - $("#avg_PR").html(stationOverview.avg_PR.toFixed(2)); - $("#today_kwhkwp").html(stationOverview.today_kwhkwp.toFixed(2)); - $("#avg_kwhkwp").html(stationOverview.avg_kwhkwp.toFixed(2)); - $("#total_money").html(stationOverview.total_money.toFixed()); - $("#today_money").html(stationOverview.today_money.toFixed()); - $("#today_carbon").html(stationOverview.today_carbon.toFixed(2)); - $("#total_carbon").html(stationOverview.total_carbon.toFixed(2)); + $("#today_kwh").html(toThousands(stationOverview.today_kwh.toFixed(2))); + $("#total_kwh").html(toThousands(stationOverview.total_kwh.toFixed(2))); + $("#today_irradiance").html(toThousands(stationOverview.today_irradiance.toFixed(2))); + $("#avg_irradiance").html(toThousands(stationOverview.avg_irradiance.toFixed(2))); + $("#today_PR").html(toThousands(stationOverview.today_PR.toFixed(2))); + $("#avg_PR").html(toThousands(stationOverview.avg_PR.toFixed(2))); + $("#today_kwhkwp").html(toThousands(stationOverview.today_kwhkwp.toFixed(2))); + $("#avg_kwhkwp").html(toThousands(stationOverview.avg_kwhkwp.toFixed(2))); + $("#total_money").html(toThousands(stationOverview.total_money.toFixed())); + $("#today_money").html(toThousands(stationOverview.today_money.toFixed())); + $("#today_carbon").html(toThousands(stationOverview.today_carbon.toFixed(2))); + $("#total_carbon").html(toThousands(stationOverview.total_carbon.toFixed(2))); $("#update_at").html(stationOverview.updatedAt); var statusicon; @@ -913,7 +913,7 @@ if (data == null || data.length == 0) { this.data = []; } - + $('#operation_record_table_wrapper').show(); return data; } }, @@ -1112,6 +1112,7 @@ if (data == null || data.length == 0) { this.data = []; } + $("#Exception_Table_wrapper").show(); return data; } }, @@ -1361,6 +1362,7 @@ //#region 查詢近30天(異常) function ChangeDate30exception() { + $("#Exception_Table_wrapper").hide(); var today = new Date(); var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); @@ -1471,6 +1473,7 @@ //#region 改變異常紀錄狀態 function ChangeStatus(type) { + $("#Exception_Table_wrapper").hide(); err_status = type; var name; var name2; @@ -1484,6 +1487,7 @@ document.getElementById(name).setAttribute("class", "btn btn-success waves-effect waves-themed"); document.getElementById(name2).setAttribute("class", "btn btn-secondary waves-effect waves-themed"); ExceptionTable.ajax.reload(); + } //#endregion @@ -1605,6 +1609,7 @@ //#region 查詢近30天(運維) function ChangeDate30() { + $('#operation_record_table_wrapper').hide(); var today = new Date(); var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); @@ -1788,6 +1793,7 @@ //#region 改變項目(運維) function ChangeType(type) { + $('#operation_record_table_wrapper').hide(); Type = type; for (var i = 0; i < 4; i++) { var name = "button" + i; @@ -2038,7 +2044,7 @@ //#region 載入逆便器分析HeatMap資料 function LoadInvertAnalysisHeatMap() { - + $('#InverterResult').attr("style", "display:none !important;"); var checkInverts = $("input[name='selectedInvert[]']:checked").map(function () { return $(this).val(); }).get(); @@ -2125,6 +2131,8 @@ series: myseries, }); + + $('#InverterResult').removeAttr("style", "display:none !important;"); }, 'json'); //#endregion @@ -2202,6 +2210,8 @@ } function LoadInvertAnalysiskwhBar() { + $('#inverter-kWh-convas-div').hide(); + var url = "/StationOverview/GetInverterkwhBarAnalysis"; var send_data = { PowerStationId: stationId, @@ -2264,6 +2274,8 @@ }); //#endregion + $('#inverter-kWh-convas-div').show(); + }, 'json'); } diff --git a/SolarPower/Views/StationOverview/_Inverter.cshtml b/SolarPower/Views/StationOverview/_Inverter.cshtml index 2d21816..c89e0c7 100644 --- a/SolarPower/Views/StationOverview/_Inverter.cshtml +++ b/SolarPower/Views/StationOverview/_Inverter.cshtml @@ -22,7 +22,7 @@ -
+
diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index 63b73e8..57e6ecf 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -1456,22 +1456,6 @@ return hirerate; } - function toThousands(num) { - var num = (num || 0).toString(), result = ''; - var last = ""; - if (num.indexOf('.') != -1) { - var nn = num.split('.'); - num = nn[0]; - last = "." + nn[1]; - } - - while (num.length > 3) { - result = ',' + num.slice(-3) + result; - num = num.slice(0, num.length - 3); - } - if (num) { result = num + result + last; } - - return result; - } + } \ No newline at end of file diff --git a/SolarPower/wwwroot/js/site.js b/SolarPower/wwwroot/js/site.js index da943a0..f6a3080 100644 --- a/SolarPower/wwwroot/js/site.js +++ b/SolarPower/wwwroot/js/site.js @@ -153,3 +153,24 @@ function ChangePassword() { } } //#endregion + + +//#region 千分位 +function toThousands(num) { + var num = (num || 0).toString(), result = ''; + var last = ""; + if (num.indexOf('.') != -1) { + var nn = num.split('.'); + num = nn[0]; + last = "." + nn[1]; + } + + while (num.length > 3) { + result = ',' + num.slice(-3) + result; + num = num.slice(0, num.length - 3); + } + if (num) { result = num + result + last; } + + return result; +} +//#endregion