Merge branch 'Test.IRC' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.IRC
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2023-11-30 14:22:35 +08:00
12 changed files with 216 additions and 92 deletions
@@ -23,6 +23,9 @@ using System.Linq;
using Spire.Doc;
using Microsoft.AspNetCore.Http;
using System;
using System.Runtime.InteropServices;
using SharpCompress.Common;
using SkiaSharp;
namespace IRaCIS.Core.Application.Service
{
@@ -58,7 +61,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<SubjectVisit> subjectVisitRepository,
IRepository<TrialEmailBlackUser> trialEmailBlackUserRepository,
IRepository<EmailNoticeConfig> emailNoticeConfigRepository
, IEmailSendService emailSendService
, IEmailSendService emailSendService
)
{
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
@@ -634,7 +637,7 @@ namespace IRaCIS.Core.Application.Service
FileStream = File.OpenRead(phyPath),
});
await SendEmailHelper.SendEmailAsync(sendEmailConfig);
return string.Empty;
@@ -662,13 +665,31 @@ namespace IRaCIS.Core.Application.Service
MemoryStream wordMemoryStream = new MemoryStream();
Document document = new Document();
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
document.SaveToFile(serverFilePath, FileFormat.PDF);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Document document = new Document();
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
document.SaveToFile(serverFilePath, FileFormat.PDF);
}
else
{
var wordStoreServerPath = Path.Combine(Path.GetDirectoryName(serverFilePath), Path.GetFileNameWithoutExtension(serverFilePath)+".docx");
using (FileStream fileStream = new FileStream(wordStoreServerPath, FileMode.Create, FileAccess.Write))
{
wordMemoryStream.WriteTo(fileStream);
}
FileConvertHelper.ConvertWordToPdf(wordStoreServerPath, Path.GetDirectoryName(serverFilePath));
File.Delete(wordStoreServerPath);
}
}
@@ -686,17 +707,39 @@ namespace IRaCIS.Core.Application.Service
{
MemoryStream memoryStream = new MemoryStream();
MemoryStream wordMemoryStream = new MemoryStream();
MemoryStream pdfMemoryStream = new MemoryStream();
MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value);
Document document = new Document();
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Document document = new Document();
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
}
else
{
var wordStoreServerPath = Path.Combine(Path.GetDirectoryName(serverFilePath), Path.GetFileNameWithoutExtension(serverFilePath) + ".docx");
using (FileStream fileStream = new FileStream(wordStoreServerPath, FileMode.Create, FileAccess.Write))
{
wordMemoryStream.WriteTo(fileStream);
}
FileConvertHelper.ConvertWordToPdf(wordStoreServerPath, Path.GetDirectoryName(serverFilePath));
File.Delete(wordStoreServerPath);
using (FileStream fileStream = new FileStream(serverFilePath, FileMode.Open, FileAccess.Read))
{
fileStream.CopyTo(pdfMemoryStream);
}
}
document.LoadFromStream(memoryStream, FileFormat.Docx);
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
pdfMemoryStream.Seek(0, SeekOrigin.Begin);
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
{
FileName = $"{taskInfo.SubjectCode}_{Path.GetFileNameWithoutExtension(_userInfo.IsEn_Us ? trialEmailConfig.AttachName : trialEmailConfig.AttachNameCN)}.pdf",
@@ -60,10 +60,7 @@ namespace IRaCIS.Application.Services
//---该医院下已经注册有医生,不可以删除。
return ResponseOutput.NotOk(_localizer["Hospital_HasDoctors"]);
}
//if (_userRepository.Find().Any(t => t.OrganizationId == hospitalId))
//{
// return ResponseOutput.NotOk("该医院下存在用户,暂时无法删除。");
//}
var success = await _hospitalRepository.BatchDeleteNoTrackingAsync(x => x.Id == hospitalId);
@@ -31,8 +31,8 @@ namespace IRaCIS.Application.Services
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.AliasName), t => t.AliasName.Contains(searchModel.AliasName))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Country.Contains(searchModel.Province))
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider);
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
@@ -76,11 +76,6 @@ namespace IRaCIS.Application.Services
}
}
/// <summary> 删除研究中心 </summary>
@@ -109,7 +109,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap<Site, SiteSelectDTO>()
.ForMember(d => d.HospitalName, u => u.MapFrom(s => s.Hospital.HospitalName));
.ForMember(d => d.HospitalName, u => u.MapFrom(s => isEn_Us? s.Hospital.HospitalName:s.Hospital.HospitalNameCN));
//trial site 选择列表 subjectVisit pannel 模式添加的时候