From 1fadeb302255537cfcb17a13e7f63f2d32331684 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 16 Jul 2021 16:30:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=81=8B=E7=B6=ADbug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Controllers/OperationController.cs | 6 ++++-- SolarPower/Quartz/Jobs/CalcInverter15minJob.cs | 4 ++-- SolarPower/Repository/Implement/OperationRepository.cs | 2 +- SolarPower/Views/Operation/OperationRecord.cshtml | 3 +++ SolarPower/appsettings.Development.json | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SolarPower/Controllers/OperationController.cs b/SolarPower/Controllers/OperationController.cs index f145244..2ddb184 100644 --- a/SolarPower/Controllers/OperationController.cs +++ b/SolarPower/Controllers/OperationController.cs @@ -500,9 +500,9 @@ namespace SolarPower.Controllers /// /// /// - public async Task> SaveOperationRecode([FromForm] PostOperationRecode post) + public async Task> SaveOperationRecode([FromForm] PostOperationRecode post) { - ApiResult apiResult = new ApiResult(); + ApiResult apiResult = new ApiResult(); OperationRecode operationRecode = null; @@ -570,6 +570,7 @@ namespace SolarPower.Controllers apiResult.Code = "0000"; apiResult.Msg = "儲存成功"; + apiResult.Data = id; #endregion } else @@ -648,6 +649,7 @@ namespace SolarPower.Controllers apiResult.Code = "0000"; apiResult.Msg = "儲存成功"; + apiResult.Data = operationRecode.Id; #endregion } } diff --git a/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs b/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs index 7fa7ff8..4c3e0f7 100644 --- a/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs +++ b/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs @@ -28,8 +28,8 @@ namespace SolarPower.Quartz.Jobs #region step1. 找出所有電站 logger.LogInformation("【CalcInverter15minJob】【開始取得電站資料】"); var powerStations = await powerStationRepository.GetAllAsync(); - logger.LogInformation("【CalcPowerStationJob】【取得成功電站資料】"); - logger.LogInformation("【CalcPowerStationJob】【電站資料】 - {0}", System.Text.Json.JsonSerializer.Serialize(powerStations)); + logger.LogInformation("【CalcInverter15minJob】【取得成功電站資料】"); + logger.LogInformation("【CalcInverter15minJob】【電站資料】 - {0}", System.Text.Json.JsonSerializer.Serialize(powerStations)); #endregion List calcInverter15mins = new List(); diff --git a/SolarPower/Repository/Implement/OperationRepository.cs b/SolarPower/Repository/Implement/OperationRepository.cs index 35b2af5..0004af0 100644 --- a/SolarPower/Repository/Implement/OperationRepository.cs +++ b/SolarPower/Repository/Implement/OperationRepository.cs @@ -227,7 +227,7 @@ namespace SolarPower.Repository.Implement if (filter.WorkType > 0) { filter.WorkType -= 1; - sql += @" AND opr.WorkType = @WorkType"; + sql += @" AND opr.WorkType = @WorkType ORDER BY CreatedAt DESC"; } else { diff --git a/SolarPower/Views/Operation/OperationRecord.cshtml b/SolarPower/Views/Operation/OperationRecord.cshtml index d921f11..e6a2856 100644 --- a/SolarPower/Views/Operation/OperationRecord.cshtml +++ b/SolarPower/Views/Operation/OperationRecord.cshtml @@ -495,6 +495,7 @@ $(".fix-div").show(); $("#recode-form").trigger("reset"); $("input[name=status_modal][value='" + 0 + "']").prop('checked', true); //狀態 + $("#recode_files_div > .row").empty(); $("#recode-form-modal").modal(); } @@ -738,6 +739,8 @@ if (myDropzone.files.length > 0) { + selected_id = rel.data; + myDropzone.processQueue(); myDropzone.on("successmultiple", function (file, rel) { diff --git a/SolarPower/appsettings.Development.json b/SolarPower/appsettings.Development.json index edb74e9..bb68462 100644 --- a/SolarPower/appsettings.Development.json +++ b/SolarPower/appsettings.Development.json @@ -6,7 +6,7 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "LoginExpireMinute": 60, //?n?J???????A???(??) + "LoginExpireMinute": 60, //nJɶA() "DBConfig": { "Server": "MVgHWzR3rGDgD57TUoFunA==", "port": "r4AoXMUDodcQjIzofGNCcg==",