From 58e7ec1be99dfeb632997d1e50c37b746cb8d40a Mon Sep 17 00:00:00 2001 From: "jay.chang" Date: Wed, 31 Jan 2024 17:07:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Api=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84Message=20=20=E6=94=B9=E5=96=84pdf=E5=A4=9A=E4=B8=80?= =?UTF-8?q?=E9=A0=81=E7=A9=BA=E7=99=BD=E9=A0=81=E9=9D=A2=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/TenantBillController.cs | 26 ++++++++++++------- .../upload/OutputFormTemplate/import.html | 10 +++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/FrontendWebApi/ApiControllers/TenantBillController.cs b/FrontendWebApi/ApiControllers/TenantBillController.cs index e62d20c..b78f3a8 100644 --- a/FrontendWebApi/ApiControllers/TenantBillController.cs +++ b/FrontendWebApi/ApiControllers/TenantBillController.cs @@ -75,7 +75,7 @@ namespace FrontendWebApi.ApiControllers catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "讀取不到用戶資料。"; Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } @@ -106,7 +106,7 @@ namespace FrontendWebApi.ApiControllers catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "新增用戶失敗。"; if (exception.Message.Contains($" for key 'PRIMARY'")) { apiResult.Msg = "已有相同使用者。"; @@ -135,12 +135,12 @@ namespace FrontendWebApi.ApiControllers await backendRepository.ExecuteSql(sqlString); apiResult.Code = "0000"; - apiResult.Data = "修改成功"; + apiResult.Data = "修改用戶成功"; } catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "修改失敗。"; if (exception.Message.Contains($"a foreign key constraint")) { apiResult.Msg = "水電報表仍有該用戶,無法修改名稱。"; @@ -167,7 +167,7 @@ namespace FrontendWebApi.ApiControllers catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "刪除用戶失敗。"; if (exception.Message.Contains($"a foreign key constraint")) { apiResult.Msg = "水電報表仍有該用戶,無法刪除。"; @@ -222,7 +222,7 @@ namespace FrontendWebApi.ApiControllers catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "讀取水電參考報表失敗。"; Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } @@ -248,10 +248,16 @@ namespace FrontendWebApi.ApiControllers startMonth = tb.start_timestamp.Split("-")[0] + tb.start_timestamp.Split("-")[1]; endMonth = tb.end_timestamp.Split("-")[0] + tb.end_timestamp.Split("-")[1]; } - else + if (start_timestamp == "") { apiResult.Code = "9999"; - apiResult.Msg = "請選擇日期。"; + apiResult.Msg = "請選擇起始日期。"; + return apiResult; + } + if (end_timestamp == "") + { + apiResult.Code = "9999"; + apiResult.Msg = "請選擇結束日期。"; return apiResult; } @@ -296,7 +302,7 @@ namespace FrontendWebApi.ApiControllers // $"WHERE device_number = '{tb.device_number}'"; apiResult.Code = "9999"; apiResult.Msg = "請選擇同一個月份"; - + return apiResult; } @@ -309,7 +315,7 @@ namespace FrontendWebApi.ApiControllers catch (Exception exception) { apiResult.Code = "9999"; - apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + apiResult.Msg = "修改水電參考報表失敗。"; Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } diff --git a/FrontendWebApi/wwwroot/upload/OutputFormTemplate/import.html b/FrontendWebApi/wwwroot/upload/OutputFormTemplate/import.html index fdb43b5..a69998f 100644 --- a/FrontendWebApi/wwwroot/upload/OutputFormTemplate/import.html +++ b/FrontendWebApi/wwwroot/upload/OutputFormTemplate/import.html @@ -9,13 +9,14 @@