修改邮件和阅片跟踪
parent
a489350d21
commit
aad722603a
|
@ -12,7 +12,7 @@ public static class FileStoreHelper
|
||||||
|
|
||||||
|
|
||||||
//处理文件名 压缩包,或者目录类的 会带上相对路径
|
//处理文件名 压缩包,或者目录类的 会带上相对路径
|
||||||
public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName)
|
public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName,bool isChangeToPdfFormat=false)
|
||||||
{
|
{
|
||||||
|
|
||||||
//带目录层级,需要后端处理前端的路径
|
//带目录层级,需要后端处理前端的路径
|
||||||
|
@ -34,7 +34,18 @@ public static class FileStoreHelper
|
||||||
fileName = fileName.Replace($"{matchResult.Value}", "");
|
fileName = fileName.Replace($"{matchResult.Value}", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
var trustedFileNameForFileStorage = Guid.NewGuid().ToString() + fileName;
|
|
||||||
|
var trustedFileNameForFileStorage = string.Empty;
|
||||||
|
|
||||||
|
if (isChangeToPdfFormat==false)
|
||||||
|
{
|
||||||
|
trustedFileNameForFileStorage= Guid.NewGuid().ToString() + fileName;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trustedFileNameForFileStorage=Guid.NewGuid().ToString() + Path.GetFileNameWithoutExtension(fileName) + ".pdf";
|
||||||
|
}
|
||||||
|
|
||||||
return (trustedFileNameForFileStorage, fileName);
|
return (trustedFileNameForFileStorage, fileName);
|
||||||
}
|
}
|
||||||
|
@ -420,7 +431,7 @@ public static class FileStoreHelper
|
||||||
|
|
||||||
// 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径
|
// 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径
|
||||||
|
|
||||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId)
|
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId,bool isChangeToPdfFormat=false)
|
||||||
{
|
{
|
||||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||||
|
|
||||||
|
@ -428,7 +439,7 @@ public static class FileStoreHelper
|
||||||
|
|
||||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||||
|
|
||||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
|
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName, isChangeToPdfFormat);
|
||||||
|
|
||||||
|
|
||||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="fo-dicom.Drawing" Version="4.0.8" />
|
<PackageReference Include="fo-dicom.Drawing" Version="4.0.8" />
|
||||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.0.3" />
|
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.0.3" />
|
||||||
|
<PackageReference Include="FreeSpire.Doc" Version="10.8.0" />
|
||||||
<PackageReference Include="Hangfire" Version="1.7.31">
|
<PackageReference Include="Hangfire" Version="1.7.31">
|
||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -713,7 +713,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
/// <param name="queryVisitTask"></param>
|
/// <param name="queryVisitTask"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<ReadingTaskView>/*, object?)*/> GetReadingTaskList(VisitTaskQuery queryVisitTask)
|
public async Task<(PageOutput<ReadingTaskView>, object?)> GetReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||||
{
|
{
|
||||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||||
|
@ -743,9 +743,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||||
|
|
||||||
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
|
|
||||||
return pageList;
|
return (pageList,trialTaskConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Share.Common;
|
using IRaCIS.Core.Domain.Share.Common;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Spire.Doc;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -770,6 +771,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var phyPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, sendFileRelativePath);
|
var phyPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, sendFileRelativePath);
|
||||||
|
|
||||||
|
|
||||||
//先预先生成了邮件,发送预先生成的邮件
|
//先预先生成了邮件,发送预先生成的邮件
|
||||||
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
{
|
{
|
||||||
|
@ -797,11 +799,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId);
|
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId,true);
|
||||||
|
|
||||||
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
||||||
{
|
{
|
||||||
MiniSoftware.MiniWord.SaveAsByTemplate(serverFilePath, path, value);
|
|
||||||
|
MemoryStream wordMemoryStream = new MemoryStream();
|
||||||
|
|
||||||
|
Document document = new Document();
|
||||||
|
|
||||||
|
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
|
||||||
|
|
||||||
|
document.LoadFromStream(wordMemoryStream,FileFormat.Docx);
|
||||||
|
|
||||||
|
document.SaveToFile(serverFilePath, FileFormat.PDF);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//手动生成发送的邮件内容,但是并不发送
|
//手动生成发送的邮件内容,但是并不发送
|
||||||
|
@ -819,16 +831,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
MemoryStream memoryStream = new MemoryStream();
|
MemoryStream memoryStream = new MemoryStream();
|
||||||
|
MemoryStream pdfMemoryStream = new MemoryStream();
|
||||||
|
|
||||||
|
|
||||||
MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value);
|
MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value);
|
||||||
|
Document document = new Document();
|
||||||
|
|
||||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
document.LoadFromStream(memoryStream, FileFormat.Docx);
|
||||||
|
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
|
||||||
|
pdfMemoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
{
|
{
|
||||||
FileName = $"{taskInfo.SubjectCode}_{emailConfig.FileName}",
|
FileName = $"{taskInfo.SubjectCode}_{emailConfig.FileName}",
|
||||||
|
|
||||||
FileStream = memoryStream
|
FileStream = pdfMemoryStream
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -220,36 +220,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public class TrialTaskConfigView : TrialTaskConfig
|
public class TrialTaskConfigView : TrialTaskConfig
|
||||||
{
|
{
|
||||||
public ReadingTaskViewMethod ReadingTaskViewEnum { get; set; }
|
|
||||||
|
|
||||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
|
||||||
|
|
||||||
//public ReadingMethod ReadingType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 阅片是否显示受试者信息
|
|
||||||
/// </summary>
|
|
||||||
public bool IsReadingShowSubjectInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 阅片是否显示既往结果
|
|
||||||
/// </summary>
|
|
||||||
public bool IsReadingShowPreviousResults { get; set; }
|
|
||||||
|
|
||||||
public ReadingTool ReadingTool { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// QC流程 0 不审,1 单审,2双审
|
|
||||||
/// </summary>
|
|
||||||
public TrialQCProcess QCProcessEnum { get; set; } = TrialQCProcess.DoubleAudit;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 影像一致性核查
|
|
||||||
/// </summary>
|
|
||||||
public bool IsImageConsistencyVerification { get; set; } = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialReadingTaskViewConfig
|
public class TrialReadingTaskViewConfig
|
||||||
|
|
Loading…
Reference in New Issue