From e119589c4b503bc6505bec8ce726907fb64e88fc Mon Sep 17 00:00:00 2001 From: ken Date: Fri, 10 Jun 2022 17:11:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=8E=96=E5=AE=9A=E6=8C=89=E9=88=95+alert?= =?UTF-8?q?=E5=B7=B2=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/OverviewRepository.cs | 8 +- SolarPower/Startup.cs | 92 +++++++++---------- .../Views/Operation/OperationRecord.cshtml | 4 + .../StationOverviewInfo.cshtml | 10 +- .../StationOverview/_OperationRecord.cshtml | 2 +- 5 files changed, 64 insertions(+), 52 deletions(-) diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index d7bf653..c21e702 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -508,7 +508,7 @@ namespace SolarPower.Repository.Implement FROM inverter_history_hour inv WHERE inv.PowerStationId = @PowerStationId AND DATE_FORMAT(inv.timestamp, '%Y-%m-%d') = @Day - ORDER BY inv.TIMESTAMP"; + ORDER BY inv.INVERTERID, inv.TIMESTAMP"; result = (await conn.QueryAsync(sql_power, new { PowerStationId = powerStationId, Day = day })).ToList(); } @@ -533,7 +533,7 @@ namespace SolarPower.Repository.Implement FROM inverter_history_day inv WHERE inv.PowerStationId = @PowerStationId AND DATE_FORMAT(inv.timestamp, '%Y-%m') = @Month - ORDER BY inv.TIMESTAMP"; + ORDER BY inv.INVERTERID, inv.TIMESTAMP"; result = (await conn.QueryAsync(sql_power, new { PowerStationId = powerStationId, Month = month })).ToList(); } @@ -558,7 +558,7 @@ namespace SolarPower.Repository.Implement FROM inverter_history_month inv WHERE inv.PowerStationId = @PowerStationId AND DATE_FORMAT(inv.timestamp, '%Y-%m') BETWEEN @StartMonth AND @EndMonth - ORDER BY inv.TIMESTAMP"; + ORDER BY inv.INVERTERID, inv.TIMESTAMP"; result = (await conn.QueryAsync(sql_power, new { PowerStationId = powerStationId, StartMonth = startMonth, EndMonth = endMonth })).ToList(); } @@ -583,7 +583,7 @@ namespace SolarPower.Repository.Implement FROM inverter_history_month inv WHERE inv.PowerStationId = @PowerStationId AND DATE_FORMAT(inv.timestamp, '%Y') = @Year - ORDER BY inv.TIMESTAMP"; + ORDER BY inv.INVERTERID, inv.TIMESTAMP"; result = (await conn.QueryAsync(sql_power, new { PowerStationId = powerStationId, Year = year })).ToList(); } diff --git a/SolarPower/Startup.cs b/SolarPower/Startup.cs index 8b0ba21..ba0781b 100644 --- a/SolarPower/Startup.cs +++ b/SolarPower/Startup.cs @@ -88,59 +88,59 @@ namespace SolarPower options.IdleTimeout = TimeSpan.FromMinutes(loginExpireMinute); }); - #region 加入背景執行 - //services.AddHostedService(); + //#region 加入背景執行 + ////services.AddHostedService(); - //添加Quartz服務 - services.AddSingleton(); - services.AddSingleton(); - //添加Job - #region 定期計畫 - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:OperationScheduleJob")) - ); - #endregion + ////添加Quartz服務 + //services.AddSingleton(); + //services.AddSingleton(); + ////添加Job + //#region 定期計畫 + //services.AddSingleton(); + //services.AddSingleton( + // new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:OperationScheduleJob")) + //); + //#endregion - #region 計算電站逆變器資訊(每整點2分開始執行15分鐘一個循環) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcInverter15minJob")) - ); - #endregion + //#region 計算電站逆變器資訊(每整點2分開始執行15分鐘一個循環) + //services.AddSingleton(); + //services.AddSingleton( + // new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcInverter15minJob")) + //); + //#endregion - #region 計算電站發電量等資訊(每整點5分執行) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJob")) - //new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?") - ); - #endregion + //#region 計算電站發電量等資訊(每整點5分執行) + //services.AddSingleton(); + //services.AddSingleton( + //new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJob")) + ////new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?") + //); + //#endregion - #region 計算電站日照量、PR、kWP 30日平均、(每天凌晨2點執行) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcAvgPowerStationJob")) - //new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *") - ); - #endregion + //#region 計算電站日照量、PR、kWP 30日平均、(每天凌晨2點執行) + //services.AddSingleton(); + //services.AddSingleton( + //new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcAvgPowerStationJob")) + ////new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *") + //); + //#endregion - #region 寄送Email(每天凌晨2點執行) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:SendEmailJob")) - ); - #endregion + //#region 寄送Email(每天凌晨2點執行) + //services.AddSingleton(); + //services.AddSingleton( + //new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:SendEmailJob")) + //); + //#endregion - #region 查詢異常新增至Email - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue("BackgroundServiceCron:ExceptionSchedule")) - ); - #endregion + //#region 查詢異常新增至Email + //services.AddSingleton(); + //services.AddSingleton( + //new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue("BackgroundServiceCron:ExceptionSchedule")) + //); + //#endregion - services.AddHostedService(); - #endregion + //services.AddHostedService(); + //#endregion services.AddApplicationInsightsTelemetry(); } diff --git a/SolarPower/Views/Operation/OperationRecord.cshtml b/SolarPower/Views/Operation/OperationRecord.cshtml index dc0052f..e2867da 100644 --- a/SolarPower/Views/Operation/OperationRecord.cshtml +++ b/SolarPower/Views/Operation/OperationRecord.cshtml @@ -1149,6 +1149,10 @@ } operationRecordTable.ajax.reload(); } + + alert("撌脖耨孵"); + // 瘨摰 + $("#save-record-btn").attr('disabled', false); } }); } diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index b53e5d1..76dc97d 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -1672,9 +1672,12 @@ //#region 脣銵典株(蝬) function SaveRecord() { + if ($('#work_person_select_modal').val().length > 0 && $("#work_time_modal").val() != "") { if ($("#record-form").valid()) { + // 摰 + $("#save-record-op-btn").attr('disabled', true); var url = "/Operation/SaveOperationRecord"; var formData = new FormData(); @@ -1698,6 +1701,7 @@ else { formData.append("Emailcheck", 0); } + $.ajax({ type: "POST", url: url, @@ -1735,8 +1739,12 @@ operationRecordTable.ajax.reload(); } + + alert("撌脖耨孵"); + // 瘨摰 + $("#save-record-op-btn").attr('disabled', false); } - }); + }); } } else { diff --git a/SolarPower/Views/StationOverview/_OperationRecord.cshtml b/SolarPower/Views/StationOverview/_OperationRecord.cshtml index 6da289f..b2b4783 100644 --- a/SolarPower/Views/StationOverview/_OperationRecord.cshtml +++ b/SolarPower/Views/StationOverview/_OperationRecord.cshtml @@ -197,7 +197,7 @@