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": {