From 833ba0f6721afa38328e5fd675f4254d5854e89c Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 3 Sep 2021 15:09:57 +0800 Subject: [PATCH] =?UTF-8?q?1.=20bug=20fix=202.=20=E9=9B=BB=E7=AB=99?= =?UTF-8?q?=E5=88=AA=E9=99=A4=20only=20=E5=B9=B3=E5=8F=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=93=A1=203.=20=E8=83=8C=E6=99=AF=E5=9F=B7=E8=A1=8C?= =?UTF-8?q?=E5=8A=A0=E5=85=A5inner=20exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Quartz/Jobs/CalcAvgPowerStationJob.cs | 4 +-- SolarPower/Quartz/Jobs/CalcPowerStationJob.cs | 7 ++-- SolarPower/Views/ExceptionRecord/Index.cshtml | 18 +++++------ SolarPower/Views/Operation/Index.cshtml | 20 ++++++------ .../Views/Operation/OperationRecord.cshtml | 18 +++++------ SolarPower/Views/PowerStation/Index.cshtml | 32 ++++++++++++------- 6 files changed, 55 insertions(+), 44 deletions(-) diff --git a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs index 5db004e..f2ea3e7 100644 --- a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs @@ -947,8 +947,8 @@ namespace SolarPower.Quartz.Jobs } catch (Exception exception) { - logger.LogError("【CalcAvgPowerStationJob】[Exception] - {1}", "", exception.Message); - logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {1}", "", exception.InnerException.Message); + logger.LogError("【CalcAvgPowerStationJob】[Exception] - {0}", exception.Message); + logger.LogError("【CalcAvgPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); } } } diff --git a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs index 91006ed..0cb6234 100644 --- a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs @@ -493,7 +493,7 @@ namespace SolarPower.Quartz.Jobs var exist_meter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, meter_table_name); if (string.IsNullOrEmpty(exist_meter_table)) { - logger.LogError("【CalcPowerStationJob】【查無電站[0]的s{0}01_meter資料表】", powerStation.Code); + logger.LogError("【CalcPowerStationJob】【查無電站[{0}]的s{0}01_meter資料表】", powerStation.Code); } else { @@ -817,13 +817,12 @@ namespace SolarPower.Quartz.Jobs #endregion } - - logger.LogInformation("【CalcPowerStationJob】【任務完成】"); } catch (Exception exception) { - logger.LogError("【{0}】{1}", "CalcPowerStationJob", exception.Message); + logger.LogError("【CalcPowerStationJob】[Exception] - {0}", exception.Message); + logger.LogError("【CalcPowerStationJob】[InnerException] - {0}", exception.InnerException.Message); } } } diff --git a/SolarPower/Views/ExceptionRecord/Index.cshtml b/SolarPower/Views/ExceptionRecord/Index.cshtml index 3ac6200..6cea21d 100644 --- a/SolarPower/Views/ExceptionRecord/Index.cshtml +++ b/SolarPower/Views/ExceptionRecord/Index.cshtml @@ -505,15 +505,15 @@ } powerids = []; - $.each(Allpowerids, function (index, val) { + $('input[name="check_power_station[]"]').map(function () { if (AllpoweridsType) { - $('#check_' + val).prop("checked", true); - powerids.push(val); - } else { - $('#check_' + val).prop("checked", false); - powerids = []; + $(this).prop("checked", true); + powerids.push($(this).val()); } - }) + else { + $(this).prop("checked", false); + } + }); ExceptionTable.ajax.reload(); } //#endregion @@ -602,12 +602,12 @@ $.each(rel.data, function (index, val) { if ($.inArray(parseInt(val.cityId), ids) > -1) { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); powerids.push(String(val.id)); } else { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); if ($.inArray(parseInt(val.id), powerids) > -1) { diff --git a/SolarPower/Views/Operation/Index.cshtml b/SolarPower/Views/Operation/Index.cshtml index 0fd6d3f..1922063 100644 --- a/SolarPower/Views/Operation/Index.cshtml +++ b/SolarPower/Views/Operation/Index.cshtml @@ -464,15 +464,17 @@ } powerids = []; - $.each(Allpowerids, function (index, val) { + + $('input[name="check_power_station[]"]').map(function () { if (AllpoweridsType) { - $('#check_' + val).prop("checked", true); - powerids.push(val); - } else { - $('#check_' + val).prop("checked", false); - powerids = []; + $(this).prop("checked", true); + powerids.push($(this).val()); } - }) + else { + $(this).prop("checked", false); + } + }); + OperationPlanTable.ajax.reload(); } //#endregion @@ -553,12 +555,12 @@ if ($.inArray(parseInt(val.cityId), ids) > -1) { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); powerids.push(String(val.id)); } else { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); if ($.inArray(parseInt(val.id), powerids) > -1) { diff --git a/SolarPower/Views/Operation/OperationRecord.cshtml b/SolarPower/Views/Operation/OperationRecord.cshtml index 282fec0..abd1a02 100644 --- a/SolarPower/Views/Operation/OperationRecord.cshtml +++ b/SolarPower/Views/Operation/OperationRecord.cshtml @@ -614,12 +614,12 @@ if ($.inArray(parseInt(val.cityId), ids) > -1) { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); powerids.push(String(val.id)); } else { $('#CheckPowerStation').append("
"); - $('#station_' + val.id).append(""); + $('#station_' + val.id).append(""); $('#station_' + val.id).append(""); if ($.inArray(parseInt(val.id), powerids) > -1) { @@ -839,15 +839,15 @@ } powerids = []; - $.each(Allpowerids, function (index, val) { + $('input[name="check_power_station[]"]').map(function () { if (AllpoweridsType) { - $('#check_' + val).prop("checked", true); - powerids.push(val); - } else { - $('#check_' + val).prop("checked", false); - powerids = []; + $(this).prop("checked", true); + powerids.push($(this).val()); } - }) + else { + $(this).prop("checked", false); + } + }); if (status == 2) { operationRecordTable.column(10).visible(true); } diff --git a/SolarPower/Views/PowerStation/Index.cshtml b/SolarPower/Views/PowerStation/Index.cshtml index 1a86541..91d3aa6 100644 --- a/SolarPower/Views/PowerStation/Index.cshtml +++ b/SolarPower/Views/PowerStation/Index.cshtml @@ -3,6 +3,8 @@ ViewData["SubNum"] = "1"; ViewData["Title"] = "電站管理"; } +@using SolarPower.Models.Role +@model RoleLayerEnum