diff --git a/IRaCIS.Core.Application/Helper/FileConvertHelper.cs b/IRaCIS.Core.Application/Helper/FileConvertHelper.cs new file mode 100644 index 000000000..c79ec4916 --- /dev/null +++ b/IRaCIS.Core.Application/Helper/FileConvertHelper.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Helper +{ + public class FileConvertHelper + { + + + } +} diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index 519545509..7dbdc7716 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -21,6 +21,9 @@ using IRaCIS.Core.Domain.Share.Common; using System.IO; using System.Linq; using Spire.Doc; +using Microsoft.AspNetCore.Http; +using System; +using System.Runtime.InteropServices; namespace IRaCIS.Core.Application.Service { @@ -834,20 +837,30 @@ 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 + { + + } + - } - //手动生成发送的邮件内容,但是并不发送 - if (emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail) - { - isNeedSend = false; + } + //手动生成发送的邮件内容,但是并不发送 + if (emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail) + { + isNeedSend = false; return relativePath; } @@ -862,12 +875,20 @@ namespace IRaCIS.Core.Application.Service MemoryStream pdfMemoryStream = new MemoryStream(); - MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value); - Document document = new Document(); + MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value); - document.LoadFromStream(memoryStream, FileFormat.Docx); - document.SaveToStream(pdfMemoryStream, FileFormat.PDF); - pdfMemoryStream.Seek(0, SeekOrigin.Begin); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Document document = new Document(); + document.LoadFromStream(memoryStream, FileFormat.Docx); + document.SaveToStream(pdfMemoryStream, FileFormat.PDF); + } + else + { + + } + + pdfMemoryStream.Seek(0, SeekOrigin.Begin); sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig() {