From 3de2b9da17d49ae099b1a32aa91e5b0e9e5d9be3 Mon Sep 17 00:00:00 2001 From: "jay.chang" Date: Tue, 30 Jan 2024 11:13:46 +0800 Subject: [PATCH] =?UTF-8?q?appsetting=E6=96=B0=E5=A2=9E=E5=9C=96=E7=89=87?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/TenantBillController.cs | 22 ++++++++++--------- FrontendWebApi/appsettings.Development.json | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/FrontendWebApi/ApiControllers/TenantBillController.cs b/FrontendWebApi/ApiControllers/TenantBillController.cs index cc131b3..e62d20c 100644 --- a/FrontendWebApi/ApiControllers/TenantBillController.cs +++ b/FrontendWebApi/ApiControllers/TenantBillController.cs @@ -29,8 +29,8 @@ namespace FrontendWebApi.ApiControllers { //[Route("api/[controller]")] //[ApiController] - public class TenantBillController - //public class TenantBillController : MyBaseApiController + //public class TenantBillController + public class TenantBillController : MyBaseApiController { private readonly IBackendRepository backendRepository; private readonly ILogger _logger; @@ -76,7 +76,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Code = "9999"; apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -111,7 +111,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Msg = "已有相同使用者。"; } - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -145,7 +145,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Msg = "水電報表仍有該用戶,無法修改名稱。"; } - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -172,7 +172,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Msg = "水電報表仍有該用戶,無法刪除。"; } - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -223,7 +223,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Code = "9999"; apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -310,7 +310,7 @@ namespace FrontendWebApi.ApiControllers { apiResult.Code = "9999"; apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return apiResult; @@ -350,7 +350,7 @@ namespace FrontendWebApi.ApiControllers } catch (Exception exception) { - //Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } return new FileContentResult(new byte[0], "application/pdf") { @@ -432,6 +432,8 @@ namespace FrontendWebApi.ApiControllers try { string path = Configuration.GetValue("FilePath:OutputFormTemplate"); + string image = Configuration.GetValue("FilePath:Image"); + //string path = _webHostEnvironment.ContentRootPath + "\\StaticFiles\\import.html"; if (!System.IO.File.Exists(path)) { @@ -447,7 +449,7 @@ namespace FrontendWebApi.ApiControllers { bill += $"
" + $"
" + - $" \"Taipei " + + $" \"Taipei " + $"

水電費用明細

" + $"
" + $"
" + diff --git a/FrontendWebApi/appsettings.Development.json b/FrontendWebApi/appsettings.Development.json index cf16b64..8f75e9e 100644 --- a/FrontendWebApi/appsettings.Development.json +++ b/FrontendWebApi/appsettings.Development.json @@ -13,8 +13,9 @@ "JwtLifeSeconds": 3600 }, "FilePath": { - "OutputForm": "C:\\jay.chang\\ibms\\FrontendWebApi\\wwwroot\\upload\\OutputForm\\", //水電報表 檔案儲存位置 - "OutputFormTemplate": "C:\\jay.chang\\ibms\\FrontendWebApi\\wwwroot\\upload\\OutputFormTemplate\\import.html" // 水電報表範本檔位置 + "OutputForm": "D:\\jay.chang\\dome\\FrontendWebApi\\wwwroot\\upload\\OutputForm\\", //水電報表 檔案儲存位置 + "OutputFormTemplate": "D:\\jay.chang\\dome\\FrontendWebApi\\wwwroot\\upload\\OutputFormTemplate\\import.html", // 水電報表範本檔位置 + "Image": "D:\\jay.chang\\dome\\FrontendWebApi\\wwwroot\\upload\\OutputFormTemplate\\dome.png" // 明細的圖片 }, "DBConfig": { "MySqlDBConfig": {