新增单个简历下载

新增简历批量下载
master
xiaochanghai 7 months ago
parent 0dbdc8a937
commit e8995d2e36
  1. 2
      Tiobon.Core.Common/Helper/HttpHelper.cs
  2. 16
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.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;
}

@ -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);

Loading…
Cancel
Save