From e8995d2e36f849a88dc611f23e5f3ef8cfd8d41a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 28 Nov 2024 09:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8D=95=E4=B8=AA=E7=AE=80?= =?UTF-8?q?=E5=8E=86=E4=B8=8B=E8=BD=BD=20=E6=96=B0=E5=A2=9E=E7=AE=80?= =?UTF-8?q?=E5=8E=86=E6=89=B9=E9=87=8F=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Common/Helper/HttpHelper.cs | 2 +- Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Tiobon.Core.Common/Helper/HttpHelper.cs b/Tiobon.Core.Common/Helper/HttpHelper.cs index 53fc867b..5806a1ef 100644 --- a/Tiobon.Core.Common/Helper/HttpHelper.cs +++ b/Tiobon.Core.Common/Helper/HttpHelper.cs @@ -15,7 +15,7 @@ public class HttpHelper { string result = string.Empty; Uri getUrl = new Uri(serviceAddress); - Httpclient.Timeout = new TimeSpan(0, 0, 60); + //Httpclient.Timeout = new TimeSpan(0, 0, 60); result = await Httpclient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync(); return result; } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 00efb6bb..d1152727 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -2,9 +2,6 @@ using DinkToPdf.Contracts; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -using MySqlX.XDevAPI.Common; -using Org.BouncyCastle.Utilities; -using SharpCompress.Common; using System.IO.Compression; using static Tiobon.Core.Model.Consts; @@ -2385,9 +2382,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1"; string frontUrl = AppSettings.app(["Startup", "FrontUrl"]); string path = string.Empty; frontUrl += "/Advanced"; - if (Env.IsDevelopment()) - frontUrl = "http://localhost:9292"; - //} + //if (Env.IsDevelopment()) + // frontUrl = "http://localhost:9292"; if (ids.Count == 1) { @@ -2398,7 +2394,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1"; ColorMode = ColorMode.Color, Orientation = Orientation.Portrait, PaperSize = PaperKind.A4, - DocumentTitle = "PDF Report", + DocumentTitle = entity.StaffName, }; var objectSettings = new ObjectSettings @@ -2440,13 +2436,13 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1"; for (int i = 0; i < ids.Count; i++) { var entity = await base.QueryById(ids[i]); - var returnData = await HttpHelper.GetAsync(frontUrl + "/api/Ghrh_ResumeTemplatePreview/" + ids[0]); + var returnData = await HttpHelper.GetAsync(frontUrl + "/api/Ghrh_ResumeTemplatePreview/" + ids[i]); var globalSettings = new GlobalSettings { ColorMode = ColorMode.Color, Orientation = Orientation.Portrait, PaperSize = PaperKind.A4, - DocumentTitle = "PDF Report", + DocumentTitle = entity.StaffName, }; var objectSettings = new ObjectSettings @@ -2463,7 +2459,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1"; }; var fileBytes = _converter.Convert(pdf); - + var fileName = pathHeader + entity.StaffName + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf"; files.Add(_hostingEnvironment.WebRootPath + fileName); var ms = new MemoryStream(fileBytes);