From de1d971e44998f99b9cd6ac9a4418e512d3b6738 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 30 Nov 2023 11:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=8E=AF=E5=A2=83=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.Uat_IRC.json | 25 +++++++++++++++ .../Helper/FileConvertHelper.cs | 14 +++++++++ .../Document/TrialEmailNoticeConfigService.cs | 31 +++++++++++++++---- 3 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 IRaCIS.Core.Application/Helper/FileConvertHelper.cs diff --git a/IRaCIS.Core.API/appsettings.Uat_IRC.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json index 570b586c7..f5ccb5824 100644 --- a/IRaCIS.Core.API/appsettings.Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json @@ -22,6 +22,31 @@ "Region": "oss-cn-shanghai" }, + "ObjectStoreService": { + + "ObjectStoreUse": "AliyunOSS", + + "AliyunOSS": { + "regionId": "cn-shanghai", + "endpoint": "https://oss-cn-shanghai.aliyuncs.com", + "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", + "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", + "bucketName": "zy-irc-uat-store", + "roleArn": "acs:ram::1899121822495495:role/oss-upload", + "viewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com", + "region": "oss-cn-shanghai" + }, + + "MinIO": { + "endpoint": "http://192.168.3.68", + "port": "8001", + "useSSL": false, + "accessKey": "IDFkwEpWej0b4DtiuThL", + "secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h", + "bucketName": "test" + } + }, + "BasicSystemConfig": { "OpenUserComplexPassword": true, 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 91d9e117e..fb598e65e 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -23,6 +23,7 @@ using System.Linq; using Spire.Doc; using Microsoft.AspNetCore.Http; using System; +using System.Runtime.InteropServices; namespace IRaCIS.Core.Application.Service { @@ -662,13 +663,23 @@ 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 + { + + } + } @@ -691,10 +702,18 @@ namespace IRaCIS.Core.Application.Service MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value); - Document document = new Document(); - document.LoadFromStream(memoryStream, FileFormat.Docx); - document.SaveToStream(pdfMemoryStream, FileFormat.PDF); + 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()