diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index f876492..42c9c27 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -6,7 +6,7 @@ "TrialService_ExistPN": "The same Project ID already exists", "SubjectService_ExistSubjectCode": "A patient with the relevant patient ID already exists.", - "SubjectService_ExistImage": "An image study has been uploaded for this patiemt, and the deletion of this patient is not allowed.", + "SubjectService_ExistImage": "An image study has been uploaded for this patient, and the deletion of this patient is not allowed.", "SubjectVisitServiece_ExistOtherInCurrent": "In the patient's study batch, there is an unplanned study batch after the previous study, please re-select the previous study.", "SubjectVisitServiece_ExistName": "Same study batch name has already existed.", @@ -23,7 +23,8 @@ //StudyService "Study_VisitAfterVisitOverError": "The scan date ofthis study ({0}) cannot be earlier than that of any previous study of the same patient.", - "Study_VisitBeforePrevError": "The scan time {0} of current study batch cannot be earlier than that {1} of the previous study batch. Please check whether the study data is correct.", + + "Study_VisitBeforePrevError": "The scan date of this study ({0}) cannot be earlier than that of any previous study of the same patient.", "Study_VisitAfterSubseqError": "The scan time {0} of current study batch cannot be later than the that {1} of the next study batch. Please check whether the study data is correct.", "Study_UploadArchiving": "Someone is currently uploading and archiving the images of this study batch!", "Study_VisitEndedNotAllowed": "The study of this patint is completed, and cannot upload images to this study batch!", diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 2409d61..3d36188 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -6,7 +6,10 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; +using System.Diagnostics; +using System.Linq; using System.Linq.Expressions; +using System.Reflection; using System.Text.RegularExpressions; @@ -26,7 +29,36 @@ namespace IRaCIS.Application.Services private readonly IRepository _visitTaskRepositoryy; - public TestService(IRepository dicRepository, IRepository trialRepository/*, IDistributedCache cache*/ + + + + public void ToPdf(string officePath, string outPutPath) + { + //获取libreoffice命令的路径 + string libreOfficePath = "C:\\Users\\Admin\\Desktop\\新建文件夹\\program\\soffice.exe"; + + ProcessStartInfo procStartInfo = new ProcessStartInfo(libreOfficePath, string.Format("--convert-to pdf --outdir {0} --nologo {1}", outPutPath, officePath)); + procStartInfo.RedirectStandardOutput = true; + procStartInfo.UseShellExecute = false; + procStartInfo.CreateNoWindow = true; + procStartInfo.WorkingDirectory = Environment.CurrentDirectory; + + //开启线程 + Process process = new Process() { StartInfo = procStartInfo, }; + process.Start(); + process.WaitForExit(); + + if (process.ExitCode != 0) + { + throw new BusinessValidationFailedException(process.ExitCode.ToString()); + + } + } + + + + + public TestService(IRepository dicRepository, IRepository trialRepository/*, IDistributedCache cache*/ , IOptionsMonitor systemEmailConfig, IOptionsMonitor basicConfig, IRepository visitTaskRepository) {