diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 02465e67b..2cb56ec0e 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1316,7 +1316,7 @@
-
+
邮件日志
@@ -1326,6 +1326,33 @@
+
+
+ 获取邮件日志列表
+
+
+
+
+
+
+ 获取单条邮件日志详情
+
+
+
+
+
+
+ 重发邮件
+
+
+
+
+
+
+ 同步邮件
+
+
+
邮件筛选条件构建
@@ -8069,6 +8096,61 @@
任务名称
+
+
+ 阅片期名称
+
+
+
+
+ 阅片配置的类型
+
+
+
+
+ 阅片期类型
+
+
+
+
+ 阅片期名称
+
+
+
+
+ 中心编号
+
+
+
+
+ 受试者编号
+
+
+
+
+ 访视名称
+
+
+
+
+ 最晚拍片日期
+
+
+
+
+ 来源
+
+
+
+
+ 是否生成任务
+
+
+
+
+ 生成任务时间
+
+
受试者ID
@@ -10759,6 +10841,46 @@
阅片期ID
+
+
+ 阅片范围
+
+
+
+
+ 中心ID
+
+
+
+
+ 项目ID
+
+
+
+
+ 截止日期
+
+
+
+
+ 截止访视
+
+
+
+
+ 访视计划ID
+
+
+
+
+ 阅片期名称
+
+
+
+
+ 类型
+
+
阅片范围
@@ -10799,6 +10921,26 @@
类型
+
+
+ 中心Id
+
+
+
+
+ 受试者Code
+
+
+
+
+ 是否加入阅片计划
+
+
+
+
+ 是否生成阅片计划
+
+
获取影像阅片预览的Dto
@@ -10849,6 +10991,26 @@
阅片期名称
+
+
+ 是否加入阅片计划
+
+
+
+
+ 是否生成阅片计划
+
+
+
+
+ 是否生成任务
+
+
+
+
+ 生成时间
+
+
id
@@ -14251,6 +14413,13 @@
+
+
+ 生效或者新增访视的时候添加阅片期
+
+
+
+
获取选中的计划 (增加标准不影响 因为阅片期设置关联了标准)
@@ -14286,6 +14455,26 @@
+
+
+ 判断是否修改了阅片期计划的参数
+
+
+
+
+
+ 添加阅片计划并生成阅片期(在阅片期已经生效的情况下添加)
+
+
+
+
+
+
+ 移除阅片计划
+
+
+
+
获取影像阅片的预览 // 需要清除之前已经选中的 (增加标准搜索,已修改)
@@ -14323,6 +14512,13 @@
+
+
+ 获取读片模块分页列表 //加了标准参数
+
+
+
+
获取单条详情信息
@@ -15651,6 +15847,41 @@
CommonDocumentAddOrEdit 列表查询参数模型
+
+
+ 附件名称
+
+
+
+
+ 附件路径
+
+
+
+
+ 邮件Id
+
+
+
+
+ 收件人姓名
+
+
+
+
+ 收件人地址
+
+
+
+
+ 收件人类型
+
+
+
+
+ 排序
+
+
邮件Id
@@ -15666,21 +15897,6 @@
邮件主题
-
-
- 收件人
-
-
-
-
- 抄送人
-
-
-
-
- 附件
-
-
日期
@@ -16812,6 +17028,11 @@
UserWLTemplateQuery 列表查询参数模型
+
+
+ 是否双屏
+
+
UserWLTemplateAddOrEdit 列表查询参数模型
diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs
index be251f0c6..e564e7887 100644
--- a/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs
@@ -16,7 +16,54 @@ public class EmailLogView : EmailLogAddOrEdit
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
-
+
+ public List RecipientList { get; set; }
+
+ public List AttachmentList { get; set; }
+
+}
+
+
+public class EmaliAttachmentInfo
+{
+ ///
+ /// 附件名称
+ ///
+ public string AttachmentName { get; set; }
+ ///
+ /// 附件路径
+ ///
+ public string AttachmentPath { get; set; }
+}
+
+public class EmailRecipientLogView
+{
+ public Guid Id { get; set; }
+
+ ///
+ /// 邮件Id
+ ///
+ public Guid EmailLogId { get; set; }
+
+ ///
+ /// 收件人姓名
+ ///
+ public string RecipientName { get; set; }
+
+ ///
+ /// 收件人地址
+ ///
+ public string RecipientAddress { get; set; }
+
+ ///
+ /// 收件人类型
+ ///
+ public RecipientType RecipientTypeEnum { get; set; }
+
+ ///
+ /// 排序
+ ///
+ public int Sort { get; set; }
}
@@ -39,21 +86,6 @@ public class EmailLogAddOrEdit
///
public string EmailSubject { get; set; } = string.Empty;
- ///
- /// 收件人
- ///
- public List ToRecipients { get; set; }
-
- ///
- /// 抄送人
- ///
- public List CcRecipients { get; set; }
-
- ///
- /// 附件
- ///
- public List Attachments { get; set; }
-
///
/// 日期
///
@@ -85,19 +117,37 @@ public class EmailLogAddOrEdit
public EmailState EmailStateEnum { get; set; }
}
+public class GetEmailInfoOutDto:EmailLogView
+{
+
+}
+
+public class GetEmailInfoInDto
+{
+ public Guid Id { get; set; }
+}
+
+
+public class ResendEmailInDto
+{
+ public Guid Id { get; set; }
+}
+
public class EmailLogQuery:PageInput
{
-
+ public Guid? TrialId { get; set; }
+
public DateTime? EmailStartDate { get; set; }
public DateTime? EmailEndDate { get; set; }
- public EmailState EmailStateEnum { get; set; }
-
- public string? ToRecipientName { get; set; }
+ public EmailState? EmailStateEnum { get; set; }
+
+ public string ToRecipientName { get; set; } = string.Empty;
+
+ public string CcRecipientName { get; set; } = string.Empty;
- public string? CcRecipientName { get; set; }
}
diff --git a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs
index 8f89bfa33..467243a23 100644
--- a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs
+++ b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs
@@ -4,6 +4,7 @@
// 生成时间 2025-10-28 06:22:42Z
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
+using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
@@ -13,9 +14,12 @@ using MailKit;
using MailKit.Net.Imap;
using MailKit.Search;
using MailKit.Security;
+using MassTransit;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using MimeKit;
+using System.IO;
+using System.Linq;
using System.Net.Mail;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service;
@@ -30,95 +34,313 @@ namespace IRaCIS.Core.Application.Service;
///
[ApiExplorerSettings(GroupName = "Common")]
public class EmailLogService(IRepository _emailLogRepository,
+ IRepository _trialRepository,
+ IRepository _emailAttachmentLogRepository,
+ IOSSService oSSService,
+ IRepository _emailRecipientLogRepository,
IOptionsMonitor systemEmailConfig,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService, IEmailLogService
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
+ ///
+ /// 获取邮件日志列表
+ ///
+ ///
+ ///
[HttpPost]
- public async Task> GetEmailLogList(EmailLogQuery inQuery)
+ public async Task> GetEmailLogList(EmailLogQuery inDto)
{
+ var emailFromEmail = await _trialRepository.Where(x=>x.Id==inDto.TrialId).Select(x=>x.EmailFromEmail).FirstOrDefaultAsync();
- PageOutput pageOutput = new PageOutput();
-
- switch (inQuery.EmailStateEnum)
+ if (emailFromEmail.IsNullOrEmpty())
{
- case EmailState.Success:
-
- using (var client = new ImapClient())
+ emailFromEmail = _systemEmailConfig.FromEmail;
+ }
+ var emailLogQueryable = _emailLogRepository
+ .Where(x=>x.SenderAddress== emailFromEmail)
+ .WhereIf(inDto.EmailStartDate.HasValue, x => x.EmailDate >= inDto.EmailStartDate.Value)
+ .WhereIf(inDto.EmailEndDate.HasValue, x => x.EmailDate <= inDto.EmailEndDate.Value)
+ .WhereIf(inDto.EmailStateEnum.HasValue, x => x.EmailStateEnum == inDto.EmailStateEnum.Value)
+ .WhereIf(inDto.CcRecipientName.IsNotNullOrEmpty(),x=>x.EmailRecipientLogList.Any(x=>x.RecipientTypeEnum==RecipientType.Cc&&x.RecipientName.Contains(inDto.CcRecipientName)))
+ .WhereIf(inDto.ToRecipientName.IsNotNullOrEmpty(), x => x.EmailRecipientLogList.Any(x => x.RecipientTypeEnum == RecipientType.To && x.RecipientName.Contains(inDto.ToRecipientName)))
+ .ProjectTo(_mapper.ConfigurationProvider);
+
+ var defalutSortArray = new string[] { nameof(EmailLogView.EmailDate) + " desc" };
+ var pageList = await emailLogQueryable.ToPagedListAsync(inDto, defalutSortArray);
+
+ return pageList;
+
+
+ }
+
+ ///
+ /// 获取单条邮件日志详情
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetEmailInfo(GetEmailInfoInDto inDto)
+ {
+
+ var emailInfo=await _emailLogRepository
+ .Where(x => x.Id == inDto.Id).Include(x=>x.EmailRecipientLogList)
+ .ProjectTo(_mapper.ConfigurationProvider).AsNoTracking()
+ .FirstNotNullAsync();
+
+ if (emailInfo.UniqueId.IsNotNullOrEmpty())
+ {
+ using (var client = new ImapClient())
+ {
+ try
+ {
+ client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
+ client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
+ var sentFolder = client.GetFolder("已发送");
+ sentFolder.Open(FolderAccess.ReadOnly);
+ var uid = new UniqueId(uint.Parse(emailInfo.UniqueId));
+ var message = sentFolder.GetMessage(uid);
+ emailInfo.Content = message.HtmlBody ?? string.Empty;
+
+
+ if (emailInfo.AttachmentList.Count == 0)
+ {
+ List< EmaliAttachmentInfo > attachmentInfos = new List();
+ foreach (var att in message.Attachments)
+ {
+ EmaliAttachmentInfo emaliAttachmentInfo = new EmaliAttachmentInfo();
+ emaliAttachmentInfo.AttachmentName = att.ContentDisposition?.FileName ?? att.ContentType.Name ?? "unknown";
+
+ // 2. 解码后的流直接上传,不落盘
+ if (att is MimePart part)
+ {
+ // 重要:每次上传新建一个独立流,否则迭代过程中流位置会乱
+ await using var decodeStream = new MemoryStream();
+ await part.Content.DecodeToAsync(decodeStream);
+ decodeStream.Position = 0;
+
+
+ emaliAttachmentInfo.AttachmentPath = await oSSService.UploadToOSSAsync(
+ fileStream: decodeStream,
+ oosFolderPath: $"EmailAttachment/{emailInfo.Id}", // OSS 虚拟目录
+ fileRealName: emaliAttachmentInfo.AttachmentName,
+ isFileNameAddGuid: true); // 让方法自己在文件名前加 Guid
+
+ attachmentInfos.Add(emaliAttachmentInfo);
+ }
+
+ }
+
+ List emailAttachmentLog = attachmentInfos.Select(x => new EmailAttachmentLog()
+ {
+ EmailLogId = emailInfo.Id.Value,
+ AttachmentName = x.AttachmentName,
+ AttachmentPath = x.AttachmentPath,
+ }).ToList();
+
+ await _emailAttachmentLogRepository.AddRangeAsync(emailAttachmentLog);
+ await _emailAttachmentLogRepository.SaveChangesAsync();
+
+ emailInfo.AttachmentList = attachmentInfos;
+ }
+
+
+ sentFolder.Close();
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+ client.Disconnect(true);
+ }
+ }
+ }
+
+ //var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId.ToString()}/InspectionUpload/DataReconciliation", realFileName);
+
+ return emailInfo;
+ }
+
+ ///
+ /// 重发邮件
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task ResendEmail(ResendEmailInDto inDto)
+ {
+ var emailInfo = await _emailLogRepository
+ .Where(x => x.Id == inDto.Id)
+ .ProjectTo(_mapper.ConfigurationProvider)
+ .FirstNotNullAsync();
+
+ if (emailInfo.UniqueId.IsNotNullOrEmpty())
+ {
+ using (var client = new ImapClient())
+ {
+ try
+ {
+ client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
+ client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
+ var sentFolder = client.GetFolder("已发送");
+ sentFolder.Open(FolderAccess.ReadOnly);
+ var uid = new UniqueId(uint.Parse(emailInfo.UniqueId));
+ var message = sentFolder.GetMessage(uid);
+ emailInfo.Content = message.HtmlBody ?? string.Empty;
+ sentFolder.Close();
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+ client.Disconnect(true);
+ }
+ }
+ }
+
+
+ var messageToSend = new MimeMessage();
+ // 发件地址
+ messageToSend.From.Add(new MailboxAddress(emailInfo.SenderName, emailInfo.SenderAddress));
+
+ foreach (var item in emailInfo.RecipientList.Where(x => x.RecipientTypeEnum == RecipientType.To))
+ {
+ messageToSend.To.Add(new MailboxAddress(item.RecipientName, item.RecipientAddress));
+ }
+ foreach (var item in emailInfo.RecipientList.Where(x => x.RecipientTypeEnum == RecipientType.Cc))
+ {
+ messageToSend.Cc.Add(new MailboxAddress(item.RecipientName, item.RecipientAddress));
+ }
+
+
+ messageToSend.Subject = emailInfo.EmailSubject;
+
+ var builder = new BodyBuilder();
+
+ builder.HtmlBody = emailInfo.Content;
+
+ messageToSend.Body = builder.ToMessageBody();
+
+ await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
+
+ return ResponseOutput.Ok();
+ }
+
+ ///
+ /// 同步邮件
+ ///
+ ///
+ [HttpPost]
+ public async Task SynchronizationEmail()
+ {
+
+ var maxTime=await _emailLogRepository.MaxAsync(t => t.EmailDate);
+
+ List emailList = new List();
+ List EmailRecipientLogList = new List();
+
+ using (var client = new ImapClient())
+ {
+ try
+ {
+ client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
+ client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
+ var sentFolder = client.GetFolder("已发送");
+ sentFolder.Open(FolderAccess.ReadOnly);
+
+ var startDate = maxTime ?? DateTime.MinValue;
+ var searchQuery = SearchQuery.All.And(SearchQuery.DeliveredAfter(startDate));
+ var uids = sentFolder.Search(searchQuery).ToList();
+
+
+ foreach (var uid in uids)
{
try
{
- client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
- client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
- var sentFolder = client.GetFolder("已发送");
- sentFolder.Open(FolderAccess.ReadOnly);
+ //var message = sentFolder.GetMessage(uid);
+ // var emailView = ConvertToEmailLogView(uid, message);
- // 构建搜索查询条件
- var searchQuery = BuildSearchQuery(inQuery);
-
- var orderBy = new[] { OrderBy.ReverseDate };
- // 搜索符合条件的邮件UID
-
-
- if (client.Capabilities.HasFlag(ImapCapabilities.Sort))
+ var message = sentFolder.GetMessage(uid);
+ var emaillog = new EmailLog
{
- Console.WriteLine("服务器支持 SORT 扩展");
- }
- else
+ Id=NewId.NextGuid(),
+ UniqueId = uid.ToString(),
+ MessageId = message.MessageId ?? string.Empty,
+ EmailSubject = message.Subject ?? string.Empty,
+ EmailDate = message.Date.UtcDateTime,
+ EmailStateEnum = EmailState.Success,
+ };
+
+ var fromMailbox = message.From.Mailboxes.FirstOrDefault();
+ if (fromMailbox != null)
{
- Console.WriteLine("服务器不支持 SORT,需本地排序");
+ emaillog.SenderAddress = fromMailbox.Address;
+ emaillog.SenderName = fromMailbox.Name ?? string.Empty;
}
+ List recipientLogs= new List();
- //var uids = sentFolder.Sort(searchQuery, orderBy).Skip((inQuery.PageIndex - 1) * inQuery.PageSize).Take(inQuery.PageSize).ToList();
+ int sort = 0;
+ message.To.Mailboxes.ForEach(x =>
+ {
+ recipientLogs.Add(new EmailRecipientLog()
+ {
+ RecipientName = x.Name ?? string.Empty,
+ RecipientAddress = x.Address,
+ EmailLogId= emaillog.Id,
+ RecipientTypeEnum = RecipientType.To,
+ Sort= sort++,
+ });
+ });
+ sort = 0;
+ message.Cc.Mailboxes.ForEach(x =>
+ {
+ recipientLogs.Add(new EmailRecipientLog()
+ {
+ RecipientName = x.Name ?? string.Empty,
+ RecipientAddress = x.Address,
+ EmailLogId = emaillog.Id,
+ RecipientTypeEnum = RecipientType.Cc,
+ Sort = sort++,
+ });
+ });
+ emailList.Add(emaillog);
+ EmailRecipientLogList.AddRange(recipientLogs);
- var uids = sentFolder.Search(searchQuery).Skip((inQuery.PageIndex - 1) * inQuery.PageSize).Take(inQuery.PageSize).ToList();
-
- // 获取邮件并排序(按时间倒序)
- var emailList = GetEmailsWithSorting(sentFolder, uids);
-
- // 应用内存中的过滤条件(对于无法通过IMAP搜索的条件)
- //var filteredEmails = ApplyMemoryFilters(emailList, inQuery);
-
- pageOutput.TotalCount = sentFolder.Search(searchQuery).Count();
- pageOutput.PageIndex = inQuery.PageIndex;
- pageOutput.PageSize = inQuery.PageSize;
-
-
-
- pageOutput.CurrentPageData = emailList;
-
- sentFolder.Close();
}
catch (Exception ex)
{
- }
- finally
- {
- client.Disconnect(true);
+ Console.WriteLine($"处理邮件 {uid} 失败: {ex.Message}");
}
}
- return pageOutput;
- case EmailState.Error:
- var emailLogQueryable = _emailLogRepository
-
- .ProjectTo(_mapper.ConfigurationProvider);
- var pageList = await emailLogQueryable.ToPagedListAsync(inQuery);
-
- return pageList;
+ sentFolder.Close();
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+ client.Disconnect(true);
+ }
+ await _emailLogRepository.AddRangeAsync(emailList);
+ await _emailRecipientLogRepository.AddRangeAsync(EmailRecipientLogList);
+ await _emailLogRepository.SaveChangesAsync();
+ return ResponseOutput.Ok();
}
+ }
- return pageOutput;
-
-
-
-
-
+ // 取skip的值
+ public int CalcReverseSkip(int pageIndex, int pageSize, int totalCount)
+ {
+ int lastPageFullSkip = totalCount / pageSize * pageSize; // 最后一页“整页”起点
+ int skip = lastPageFullSkip - pageIndex * pageSize; // 倒着减
+ return Math.Max(skip, 0); // 防止负值
}
///
@@ -229,19 +451,19 @@ public class EmailLogService(IRepository _emailLogRepository,
emailView.SenderName = fromMailbox.Name ?? string.Empty;
}
- // 处理收件人
- emailView.ToRecipients = message.To.Mailboxes.Select(address => new EmaliSendInfo
- {
- Name = address.Name ?? string.Empty,
- Address = address.Address
- }).ToList();
+ //// 处理收件人
+ //emailView.ToRecipients = message.To.Mailboxes.Select(address => new EmaliSendInfo
+ //{
+ // Name = address.Name ?? string.Empty,
+ // Address = address.Address
+ //}).ToList();
- // 处理抄送人
- emailView.CcRecipients = message.Cc.Mailboxes.Select(address => new EmaliSendInfo
- {
- Name = address.Name ?? string.Empty,
- Address = address.Address
- }).ToList();
+ //// 处理抄送人
+ //emailView.CcRecipients = message.Cc.Mailboxes.Select(address => new EmaliSendInfo
+ //{
+ // Name = address.Name ?? string.Empty,
+ // Address = address.Address
+ //}).ToList();
//// 处理密送人
//emailView.BccRecipients = message.Bcc.Mailboxes.Select(address => new EmaliSendInfo
diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs
index 58959b362..1059c599a 100644
--- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs
@@ -12,8 +12,16 @@ namespace IRaCIS.Core.Application.Service
public CommonConfig()
{
// 在此处拷贝automapper 映射
+ CreateMap();
+ CreateMap();
+ CreateMap()
+ .ForMember(t => t.RecipientList, u => u.MapFrom(c => c.EmailRecipientLogList))
+ .ForMember(t => t.AttachmentList, u => u.MapFrom(c => c.AttachmentList));
+
+ CreateMap()
+ .ForMember(t => t.RecipientList, u => u.MapFrom(c => c.EmailRecipientLogList))
+ .ForMember(t => t.AttachmentList, u => u.MapFrom(c => c.AttachmentList));
- CreateMap();
CreateMap().ReverseMap();
CreateMap().ReverseMap();
diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
index 300cbbeee..21fcbd28f 100644
--- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
+++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
@@ -1965,6 +1965,7 @@ namespace IRaCIS.Core.Application.Image.QA
SubjectVisitId = dbSubjectVisit.Id,
ModuleName = $"G-{dbSubjectVisit.VisitName}",
ModuleType = ModuleTypeEnum.Global,
+ ReadModuleAddTypeEnum= dbSubjectVisit.PDState == PDStateEnum.PDProgress? ReadModuleAddType.PDConfirmation : ReadModuleAddType.FinalVisit,
IsUrgent = dbSubjectVisit.IsUrgent,
TrialId = dbSubjectVisit.TrialId,
SubjectId = dbSubjectVisit.SubjectId
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs
index dec3879f0..18ab8a417 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs
@@ -43,6 +43,87 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
+ public class GetReadModulePageListInDto : PageInput
+ {
+ public Guid TrialId { get; set; }
+
+ public Guid TrialReadingCriterionId { get; set; }
+
+ ///
+ /// 阅片期名称
+ ///
+ public string ModuleName { get; set; } = string.Empty;
+
+ public string SubjectCode { get; set; }
+
+ public string VisitName { get; set; }
+
+ public Guid? TrialSiteId { get; set; }
+
+
+ ///
+ /// 阅片配置的类型
+ ///
+ public ReadingSetType? ReadingSetType { get; set; }
+
+ public ReadModuleAddType? ReadModuleAddTypeEnum { get; set; }
+ }
+
+
+ public class GetReadModulePageListOutDto
+ {
+
+ public Guid Id { get; set; }
+
+ ///
+ /// 阅片期类型
+ ///
+ public ReadingSetType ReadingSetType { get; set; }
+
+ ///
+ /// 阅片期名称
+ ///
+ public string ModuleName { get; set; } = string.Empty;
+
+ ///
+ /// 中心编号
+ ///
+ public string SiteCode { get; set; }
+
+ ///
+ /// 受试者编号
+ ///
+
+ public string SubjectCode { get; set; }
+
+ ///
+ /// 访视名称
+ ///
+ public string VisitName { get; set; } = string.Empty;
+
+ ///
+ /// 最晚拍片日期
+ ///
+ public DateTime? LatestScanDate { get; set; }
+
+
+ ///
+ /// 来源
+ ///
+ public ReadModuleAddType ReadModuleAddTypeEnum { get; set; } = ReadModuleAddType.Normal;
+
+ ///
+ /// 是否生成任务
+ ///
+ public bool IsGenerateTask { get; set; }
+
+ ///
+ /// 生成任务时间
+ ///
+ public DateTime? GenerateTaskTime { get; set; }
+
+ }
+
public class GetSubjectReadVisitsOutDto
{
public Guid SubjectVisitId { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
index 549387b8a..7f26625ab 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
@@ -79,8 +79,73 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid ReadingPeriodSetId { get; set; }
}
+ public class IsChangeReadingPlanInDto
+ {
+
+ public Guid? Id { get; set; }
+
+ ///
+ /// 阅片范围
+ ///
+ public ReadingScopeEnum ReadingScope { get; set; }
+
+ ///
+ /// 中心ID
+ ///
+ public List SiteIds { get; set; } = new List();
+
+ ///
+ /// 项目ID
+ ///
+ public Guid TrialId { get; set; }
+
+ ///
+ /// 截止日期
+ ///
+ public DateTime? ExpirationDate { get; set; }
+
+ ///
+ /// 截止访视
+ ///
+ public decimal? ExpirationVisitNum { get; set; }
+
+ ///
+ /// 访视计划ID
+ ///
+ public Guid? VisitStageId { get; set; }
+
+ ///
+ /// 阅片期名称
+ ///
+ public string ReadingPeriodName { get; set; }
+
+ ///
+ /// 类型
+ ///
+ public ReadingSetType ReadingSetType { get; set; }
+
+ public Guid? TrialReadingCriterionId { get; set; }
+ }
+
+ public class AddReadingPlanAndGenerateReadModuleInDto
+ {
+ public Guid ReadingPeriodSetId { get; set; }
+
+ public List SubjectVisitIdList { get; set; } = new List();
+ }
+
+ public class SetBatchAddOrRemoveReadingPlanInDto
+ {
+ public List SubjectVisitIdList { get; set; } = new List();
+
+ public Guid Id { get; set; }
+ }
+
public class PreviewTheReadingListInDto : PageInput
{
+
+ public Guid? ReadingPeriodSetId { get; set; }
+
///
/// 阅片范围
///
@@ -123,7 +188,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid? TrialReadingCriterionId { get; set; }
+ ///
+ /// 中心Id
+ ///
+ public Guid? SiteId { get; set; }
+ ///
+ /// 受试者Code
+ ///
+ public string SubjectCode { get; set; }=string.Empty;
+
+ ///
+ /// 是否加入阅片计划
+ ///
+ public bool? IsJoin { get; set; }
+
+ ///
+ /// 是否生成阅片计划
+ ///
+ public bool? IsGenerate { get; set; }
}
@@ -185,6 +268,26 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public DateTime? EffectOfTime { get; set; }
+ ///
+ /// 是否加入阅片计划
+ ///
+ public bool? IsJoin { get; set; }
+
+ ///
+ /// 是否生成阅片计划
+ ///
+ public bool? IsGenerate { get; set; }
+
+ ///
+ /// 是否生成任务
+ ///
+ public bool? IsGenerateTask { get; set; }
+
+ ///
+ /// 生成时间
+ ///
+ public DateTime? GeneratedTime { get; set; }
+
}
public class ReadingPeriodSetView
@@ -313,6 +416,33 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public ReadingPeriodStatus IsTakeEffect { get; set; }
}
+ public class AddReadModuleInDto
+ {
+ public Guid TrialReadingCriterionId { get; set; }
+
+ public Guid ReadingPeriodSetId { get; set; }
+
+ public Guid TrialId { get; set; }
+
+ public string ReadingPeriodName { get; set; }
+
+ public ReadingSetType ReadingSetType { get; set; }
+
+ public List VisitInfoList { get; set; } = new List();
+
+
+ }
+
+ public class AddReadModuleVisitInfo
+ {
+ public Guid SubjectId { get; set; }
+
+ public Guid? ReadingPeriodPlanId { get; set; }
+ public bool IsUrgent { get; set; }
+ public Guid SubjectVisitId { get; set; }
+
+ }
+
public class ReadingPeriodSetQuery : PageInput
{
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs
index ad9d98931..9ddeaec57 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs
@@ -30,6 +30,11 @@ namespace IRaCIS.Core.Application.ViewModel
public class SetAutoCutNextTaskInDto
{
public bool AutoCutNextTask { get; set; }
+
+ ///
+ /// 是否双屏
+ ///
+ public bool IsDoubleScreen { get; set; } = false;
}
/// UserWLTemplateAddOrEdit 列表查询参数模型
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index 519ce2efd..54a51c7f9 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -3736,7 +3736,7 @@ namespace IRaCIS.Core.Application.Service
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
task.ReadingToolList = criterionInfo.ReadingToolList;
task.IsExistUnprocessedFeedback = await _userFeedBackRepository.AnyAsync(x => x.VisitTaskId == task.VisitTaskId && x.State == 0);
- task.IsViewStudyPart= visitTaskInfo.IsViewStudyPart;
+ task.IsViewStudyPart= visitTaskInfo.ReadingCategory==ReadingCategory.Judge|| visitTaskInfo.IsViewStudyPart;
// 添加默认答案
if (inDto.VisitTaskId == null && visitTaskInfo.ReadingTaskState != ReadingTaskState.HaveSigned)
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs
index 512e22015..a8de462dc 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs
@@ -826,6 +826,42 @@ namespace IRaCIS.Core.Application.Service
//}
+ ///
+ /// 获取读片模块分页列表 //加了标准参数
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> GetReadModulePageList(GetReadModulePageListInDto inDto)
+ {
+
+ var readModuleQueryable = _readModuleRepository
+ .Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
+ .WhereIf(inDto.ReadModuleAddTypeEnum != null, x => x.ReadModuleAddTypeEnum == inDto.ReadModuleAddTypeEnum)
+ .WhereIf(inDto.ReadingSetType != null, x => x.ReadingSetType == inDto.ReadingSetType)
+ .WhereIf(inDto.SubjectCode.IsNotNullOrEmpty(), x => x.Subject.Code.Contains(inDto.SubjectCode))
+ .WhereIf(inDto.VisitName.IsNotNullOrEmpty(), x => x.SubjectVisit.VisitName.Contains(inDto.VisitName))
+ .WhereIf(inDto.ModuleName.IsNotNullOrEmpty(), x => x.ModuleName.Contains(inDto.ModuleName))
+ .WhereIf(inDto.TrialSiteId != null, x => x.Subject.TrialSiteId == inDto.TrialSiteId)
+ .ProjectTo(_mapper.ConfigurationProvider);
+
+
+ var pageList = await readModuleQueryable.ToPagedListAsync(inDto);
+ var ids = pageList.CurrentPageData.Select(x => x.Id as Guid?).ToList();
+
+
+ var taskList=await _visitTaskRepository.Where(x => ids.Contains(x.SouceReadModuleId)).ToListAsync();
+
+ pageList.CurrentPageData.ForEach(x =>
+ {
+
+ x.IsGenerateTask= taskList.Any(t => t.SouceReadModuleId == x.Id);
+ x.GenerateTaskTime= taskList.Any(t => t.SouceReadModuleId == x.Id)? taskList.Where(t => t.SouceReadModuleId == x.Id).OrderByDescending(t => t.CreateTime).Select(t => t.CreateTime).FirstOrDefault():null;
+
+ });
+ return pageList;
+ }
+
///
/// 获取单条详情信息
@@ -962,6 +998,7 @@ namespace IRaCIS.Core.Application.Service
SubjectId = dto.SubjectId,
ModuleType = moduleType,
IsUrgent = visit.IsUrgent,
+ ReadModuleAddTypeEnum=ReadModuleAddType.Normal,
ModuleName = dto.Name,
SubjectVisitId = visit.Id,
ReadingSetType = dto.ReadingSetType,
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
index d8883cdc0..5e97d1003 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
@@ -1,11 +1,14 @@
-using IRaCIS.Core.Application.Contracts;
+using DocumentFormat.OpenXml.Drawing;
+using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
+using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
+using NPOI.Util;
namespace IRaCIS.Core.Application.Service
{
@@ -74,28 +77,75 @@ namespace IRaCIS.Core.Application.Service
else
{
var entity = (await _readingPeriodSetRepository.Where(t => t.Id == addOrEditReadingPeriodSet.Id, true).Include(t => t.ReadingPeriodSites).Include(x => x.ReadingPeriodPlanList).FirstOrDefaultAsync()).IfNullThrowException();
- _mapper.Map(addOrEditReadingPeriodSet, entity);
- entity.ReadingPeriodSites = addOrEditReadingPeriodSet.SiteIds.Select(x => new ReadingPeriodSite()
+ // 已生效的时候就不可能修改 只能是添加计划和生成模块
+ if (entity.IsTakeEffect == ReadingPeriodStatus.TakeEffect)
{
- ReadingPeriodSetId = entity.Id,
- TrialId = entity.TrialId,
- TrialSiteId = x,
- }).ToList();
-
- entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
+ await AddReadingPlanAndGenerateReadModule(new AddReadingPlanAndGenerateReadModuleInDto()
+ {
+ ReadingPeriodSetId = addOrEditReadingPeriodSet.Id.Value,
+ SubjectVisitIdList = addOrEditReadingPeriodSet.SubjectVisitIds
+ });
+ }
+ else
{
- ReadingPeriodSetId = entity.Id,
- SubjectVisitId = x,
- }).ToList();
+ _mapper.Map(addOrEditReadingPeriodSet, entity);
- var success = await _readingPeriodSetRepository.SaveChangesAsync();
+ entity.ReadingPeriodSites = addOrEditReadingPeriodSet.SiteIds.Select(x => new ReadingPeriodSite()
+ {
+ ReadingPeriodSetId = entity.Id,
+ TrialId = entity.TrialId,
+ TrialSiteId = x,
+ }).ToList();
+
+ // 修改了就是重新生成计划
+ if (await IsChangeReadingPlan(new IsChangeReadingPlanInDto()
+ {
+
+ Id = addOrEditReadingPeriodSet.Id,
+ ExpirationDate = addOrEditReadingPeriodSet.ExpirationDate,
+ ReadingScope = addOrEditReadingPeriodSet.ReadingScope.Value,
+ TrialId = addOrEditReadingPeriodSet.TrialId,
+ ExpirationVisitNum = addOrEditReadingPeriodSet.ExpirationVisitNum,
+ VisitStageId = addOrEditReadingPeriodSet.VisitStageId,
+ ReadingSetType = addOrEditReadingPeriodSet.ReadingSetType,
+ TrialReadingCriterionId = addOrEditReadingPeriodSet.TrialReadingCriterionId,
+ SiteIds = addOrEditReadingPeriodSet.SiteIds,
+ }))
+ {
+
+ entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
+ {
+ ReadingPeriodSetId = entity.Id,
+ SubjectVisitId = x,
+ }).ToList();
+ }
+ else
+ {
+ var existsVisitIds = await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == addOrEditReadingPeriodSet.Id).Select(x => x.SubjectVisitId).ToListAsync();
+
+ var needaddIds = addOrEditReadingPeriodSet.SubjectVisitIds.Where(x => !existsVisitIds.Contains(x)).ToList();
+
+ entity.ReadingPeriodPlanList.AddRange(needaddIds.Select(x => new ReadingPeriodPlan()
+ {
+ ReadingPeriodSetId = entity.Id,
+ SubjectVisitId = x,
+ }));
+ }
+
+
+
+ var success = await _readingPeriodSetRepository.SaveChangesAsync();
+ }
+
return ResponseOutput.Ok(entity.Id);
}
}
+
+
///
/// 删除
@@ -145,145 +195,26 @@ namespace IRaCIS.Core.Application.Service
- List readModules = new List();
- foreach (var item in plans)
+ await AddReadModule(new AddReadModuleInDto()
{
- readModules.Add(new ReadModule()
+ ReadingPeriodName = readingPeriodSet.ReadingPeriodName,
+ ReadingSetType = readingPeriodSet.ReadingSetType,
+ TrialId = readingPeriodSet.TrialId,
+ ReadingPeriodSetId= readingPeriodSet.Id,
+ TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId,
+ VisitInfoList = plans.Select(x => new AddReadModuleVisitInfo()
{
- Id = NewId.NextGuid(),
- SubjectId = item.SubjectVisit.SubjectId,
- ModuleType = item.ReadingPeriodSet.ReadingSetType == ReadingSetType.ImageReading ? ModuleTypeEnum.Global : ModuleTypeEnum.Oncology,
- IsUrgent = item.SubjectVisit.IsUrgent,
- ModuleName = item.ReadingPeriodSet.ReadingPeriodName,
- SubjectVisitId = item.SubjectVisitId,
- ReadingSetType = item.ReadingPeriodSet.ReadingSetType,
- ReadingPeriodSetId = item.ReadingPeriodSet.Id,
- ReadingStatus = ReadingStatusEnum.TaskAllocate,
- TrialId = readingPeriodSet.TrialId,
- //VisitNum = item.SubjectVisit.VisitNum,
+ SubjectId = x.SubjectVisit.SubjectId,
+ SubjectVisitId = x.SubjectVisitId,
+ ReadingPeriodPlanId=x.Id,
+ IsUrgent = false
+ }).ToList()
- //增加标准
- TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId
- });
- };
-
- await _readModuleRepository.AddRangeAsync(readModules);
-
- await _readModuleRepository.SaveChangesAsync();
-
- // 判断是否要添加肿瘤学或者全局阅片任务
- var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
- switch (readingPeriodSet.ReadingSetType)
- {
- case ReadingSetType.ImageReading:
- //增加标准
- var taskInfoList = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && subjectVisitIds.Contains(x.SourceSubjectVisitId ?? default(Guid)) &&
-
- x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId &&
- x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).ToListAsync();
-
- foreach (var item in taskInfoList)
- {
-
- var readModule = readModules.Where(x => x.SubjectVisitId == item.SourceSubjectVisitId).FirstOrDefault();
- if (readModule != null)
- {
- await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
- {
- OriginalVisitId = item.Id,
- ReadingCategory = GenerateTaskCategory.Global,
- TrialId = item.TrialId,
- ReadingGenerataTaskList = new List() {
- new ReadingGenerataTaskDTO()
- {
- IsUrgent = readModule.IsUrgent??false,
- SubjectId = readModule.SubjectId,
- ReadingName = readModule.ModuleName,
- ReadModuleId =readModule.Id,
- ReadingCategory = ReadingCategory.Global,
- }
- }
- });
- }
- }
-
- // 根据SourceSubjectVisitId 分组
- var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
- // 生成裁判任务 是否需要生成函数里面有逻辑判断
- foreach (var item in visitTaskid)
- {
- await _readingImageTaskService.TriggerJudgeQuestion(item);
- }
- break;
-
- case ReadingSetType.TumorReading:
+ });
- var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readingPeriodSet.TrialReadingCriterionId).Select(x => new
- {
- x.ReadingType,
-
- }).FirstNotNullAsync();
-
- //增加标准
- var globalModuleIds = await _readModuleRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && subjectVisitIds.Contains(x.SubjectVisitId) && x.ModuleType == ModuleTypeEnum.Global).Select(x => x.Id).ToListAsync();
-
- //增加标准
- var globalTaskInfo = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))
-
- && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).GroupBy(x => new { x.SouceReadModuleId }).Select(x =>
- new
- {
- SouceReadModuleId = x.Key.SouceReadModuleId,
- Count = x.ToList().Count,
- TaskId = x.Select(x => x.Id).FirstOrDefault(),
- ReadModuleId = x.Select(x => x.SouceReadModuleId).FirstOrDefault(),
- JudgeTaskId = x.Select(x => x.JudgeVisitTaskId).FirstOrDefault(),
- JudgeTaskResultId = x.Select(x => x.JudgeVisitTask.JudgeResultTaskId).FirstOrDefault(),
- }).ToListAsync();
-
- foreach (var item in globalTaskInfo)
- {
-
- if (item.Count == (int)criterionInfo.ReadingType)
- {
- //没有裁判 或者有裁判,并且裁判任务做完了
- if (item.JudgeTaskId == null || item.JudgeTaskResultId != null)
- {
- var readModule = readModules.Where(x => x.Id == item.ReadModuleId).FirstOrDefault();
-
- await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
- {
- OriginalVisitId = item.TaskId,
- ReadingCategory = GenerateTaskCategory.Oncology,
- TrialId = readingPeriodSet.TrialId,
- ReadingGenerataTaskList = new List() {
- new ReadingGenerataTaskDTO()
- {
- IsUrgent = readModule.IsUrgent ?? false,
- SubjectId = readModule.SubjectId,
-
- ReadingName = readModule.ModuleName,
- ReadModuleId =readModule.Id,
- ReadingCategory = ReadingCategory.Oncology,
- }
- }
- });
- }
-
- }
-
-
-
- }
-
- break;
- }
-
-
-
}
@@ -311,6 +242,11 @@ namespace IRaCIS.Core.Application.Service
IsDeleted = true
});
+
+ await _readingPeriodPlanRepository.UpdatePartialFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id, x => new ReadingPeriodPlan()
+ {
+ IsGenerate = false
+ });
}
var readQuery = await _readingPeriodSetRepository.UpdatePartialFromQueryAsync(indto.Id, x => new ReadingPeriodSet()
@@ -319,12 +255,168 @@ namespace IRaCIS.Core.Application.Service
EffectOfTime = indto.IsTakeEffect == ReadingPeriodStatus.TakeEffect ? DateTime.Now : null,
});
+ if (indto.IsTakeEffect == ReadingPeriodStatus.TakeEffect)
+ {
+ await _readingPeriodPlanRepository.UpdatePartialFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id, x => new ReadingPeriodPlan()
+ {
+ IsGenerate = true,
+ GeneratedTime = DateTime.Now
+ });
+ }
+
+
var result = await _readingPeriodSetRepository.SaveChangesAsync();
return ResponseOutput.Result(result);
}
+ ///
+ /// 生效或者新增访视的时候添加阅片期
+ ///
+ ///
+ ///
+ public async Task AddReadModule(AddReadModuleInDto inDto)
+ {
+ List readModules = new List();
+ foreach (var item in inDto.VisitInfoList)
+ {
+ readModules.Add(new ReadModule()
+ {
+ Id = NewId.NextGuid(),
+ SubjectId = item.SubjectId,
+ ModuleType = inDto.ReadingSetType == ReadingSetType.ImageReading ? ModuleTypeEnum.Global : ModuleTypeEnum.Oncology,
+ IsUrgent = item.IsUrgent,
+ ReadModuleAddTypeEnum = ReadModuleAddType.ReadingPlan,
+ ModuleName = inDto.ReadingPeriodName,
+ SubjectVisitId = item.SubjectVisitId,
+ ReadingSetType = inDto.ReadingSetType,
+ ReadingPeriodSetId = inDto.ReadingPeriodSetId,
+ ReadingPeriodPlanId= item.ReadingPeriodPlanId,
+ ReadingStatus = ReadingStatusEnum.TaskAllocate,
+ TrialId = inDto.TrialId,
+ //VisitNum = item.SubjectVisit.VisitNum,
+ //增加标准
+ TrialReadingCriterionId = inDto.TrialReadingCriterionId
+ });
+ }
+ ;
+
+ await _readModuleRepository.AddRangeAsync(readModules);
+
+ await _readModuleRepository.SaveChangesAsync();
+
+ // 判断是否要添加肿瘤学或者全局阅片任务
+ var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
+ switch (inDto.ReadingSetType)
+ {
+ case ReadingSetType.ImageReading:
+ //增加标准
+ var taskInfoList = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && subjectVisitIds.Contains(x.SourceSubjectVisitId ?? default(Guid)) &&
+
+ x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
+ x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).ToListAsync();
+
+ foreach (var item in taskInfoList)
+ {
+
+ var readModule = readModules.Where(x => x.SubjectVisitId == item.SourceSubjectVisitId).FirstOrDefault();
+ if (readModule != null)
+ {
+ await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
+ {
+ OriginalVisitId = item.Id,
+ ReadingCategory = GenerateTaskCategory.Global,
+ TrialId = item.TrialId,
+ ReadingGenerataTaskList = new List() {
+ new ReadingGenerataTaskDTO()
+ {
+ IsUrgent = readModule.IsUrgent??false,
+ SubjectId = readModule.SubjectId,
+ ReadingName = readModule.ModuleName,
+ ReadModuleId =readModule.Id,
+ ReadingCategory = ReadingCategory.Global,
+ }
+ }
+ });
+ }
+ }
+
+ // 根据SourceSubjectVisitId 分组
+ var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
+ // 生成裁判任务 是否需要生成函数里面有逻辑判断
+ foreach (var item in visitTaskid)
+ {
+ await _readingImageTaskService.TriggerJudgeQuestion(item);
+ }
+ break;
+
+ case ReadingSetType.TumorReading:
+
+
+
+
+ var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new
+ {
+ x.ReadingType,
+
+ }).FirstNotNullAsync();
+
+ //增加标准
+ var globalModuleIds = await _readModuleRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && subjectVisitIds.Contains(x.SubjectVisitId) && x.ModuleType == ModuleTypeEnum.Global).Select(x => x.Id).ToListAsync();
+
+ //增加标准
+ var globalTaskInfo = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))
+
+ && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).GroupBy(x => new { x.SouceReadModuleId }).Select(x =>
+ new
+ {
+ SouceReadModuleId = x.Key.SouceReadModuleId,
+ Count = x.ToList().Count,
+ TaskId = x.Select(x => x.Id).FirstOrDefault(),
+ ReadModuleId = x.Select(x => x.SouceReadModuleId).FirstOrDefault(),
+ JudgeTaskId = x.Select(x => x.JudgeVisitTaskId).FirstOrDefault(),
+ JudgeTaskResultId = x.Select(x => x.JudgeVisitTask.JudgeResultTaskId).FirstOrDefault(),
+ }).ToListAsync();
+
+ foreach (var item in globalTaskInfo)
+ {
+
+ if (item.Count == (int)criterionInfo.ReadingType)
+ {
+ //没有裁判 或者有裁判,并且裁判任务做完了
+ if (item.JudgeTaskId == null || item.JudgeTaskResultId != null)
+ {
+ var readModule = readModules.Where(x => x.Id == item.ReadModuleId).FirstOrDefault();
+
+ await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
+ {
+ OriginalVisitId = item.TaskId,
+ ReadingCategory = GenerateTaskCategory.Oncology,
+ TrialId = inDto.TrialId,
+ ReadingGenerataTaskList = new List() {
+ new ReadingGenerataTaskDTO()
+ {
+ IsUrgent = readModule.IsUrgent ?? false,
+ SubjectId = readModule.SubjectId,
+
+ ReadingName = readModule.ModuleName,
+ ReadModuleId =readModule.Id,
+ ReadingCategory = ReadingCategory.Oncology,
+ }
+ }
+ });
+ }
+
+ }
+
+
+
+ }
+
+ break;
+ }
+ }
#endregion
@@ -466,29 +558,198 @@ namespace IRaCIS.Core.Application.Service
return result;
}
+ ///
+ /// 判断是否修改了阅片期计划的参数
+ ///
+ ///
+ public async Task IsChangeReadingPlan(IsChangeReadingPlanInDto inDto)
+ {
+ if (inDto.Id == null)
+ {
+ return false;
+ }
+ else
+ {
+ var periodSet = await _readingPeriodSetRepository.Where(x => x.Id == inDto.Id).Include(x => x.ReadingPeriodSites).FirstNotNullAsync();
+ var notChange = inDto.ExpirationDate == periodSet.ExpirationDate &&
+ inDto.ReadingScope == periodSet.ReadingScope &&
+ inDto.TrialId == periodSet.TrialId &&
+ inDto.ExpirationDate == periodSet.ExpirationDate &&
+ inDto.ExpirationVisitNum == periodSet.ExpirationVisitNum &&
+ inDto.VisitStageId == inDto.VisitStageId &&
+ inDto.ReadingSetType == inDto.ReadingSetType &&
+ inDto.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
+ inDto.SiteIds.Count == periodSet.ReadingPeriodSites.Count(x => inDto.SiteIds.Contains(x.TrialSiteId));
+
+ return !notChange;
+
+
+
+ }
+ }
+
+ ///
+ /// 添加阅片计划并生成阅片期(在阅片期已经生效的情况下添加)
+ ///
+ ///
+ ///
+ public async Task AddReadingPlanAndGenerateReadModule(AddReadingPlanAndGenerateReadModuleInDto inDto)
+ {
+ var readingPeriodSet = await _readingPeriodSetRepository.Where(x => x.Id == inDto.ReadingPeriodSetId).FirstNotNullAsync();
+ List plans = inDto.SubjectVisitIdList.Select(x => new ReadingPeriodPlan()
+ {
+ Id = NewId.NextGuid(),
+ SubjectVisitId = x,
+ ReadingPeriodSetId = inDto.ReadingPeriodSetId,
+ IsGenerate=true,
+ GeneratedTime=DateTime.Now
+ }).ToList();
+
+ await _readingPeriodPlanRepository.AddRangeAsync(plans);
+
+ await _readingPeriodPlanRepository.SaveChangesAsync();
+
+
+
+ var subejctVisits = await _subjectVisitRepository.Where(x => inDto.SubjectVisitIdList.Contains(x.Id)).ToListAsync();
+
+ await AddReadModule(new AddReadModuleInDto()
+ {
+ ReadingPeriodName = readingPeriodSet.ReadingPeriodName,
+ ReadingSetType = readingPeriodSet.ReadingSetType,
+ TrialId = readingPeriodSet.TrialId,
+ ReadingPeriodSetId = readingPeriodSet.Id,
+ TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId,
+ VisitInfoList = plans.Select(x => new AddReadModuleVisitInfo()
+ {
+ SubjectId = subejctVisits.Where(y=>y.Id==x.SubjectVisitId).Select(x=>x.SubjectId).FirstOrDefault(),
+ SubjectVisitId = x.Id,
+ ReadingPeriodPlanId= x.Id,
+ IsUrgent = subejctVisits.Where(y => y.Id == x.SubjectVisitId).Select(x => x.IsUrgent).FirstOrDefault(),
+
+ }).ToList()
+
+ });
+
+ return ResponseOutput.Ok();
+ }
+
+ ///
+ /// 移除阅片计划
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task SetBatchRemoveReadingPlan(SetBatchAddOrRemoveReadingPlanInDto inDto)
+ {
+
+ var planSet = await _readingPeriodSetRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
+ List isGenerateTaskVisitIds = new List();
+ List readModules = new List();
+
+ readModules = await _readModuleRepository.Where(x => x.ReadingPeriodSetId == inDto.Id).ToListAsync();
+
+ var readModuleIds = readModules.Select(x => x.Id).ToList();
+
+ var souceReadModuleIds = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == planSet.TrialReadingCriterionId && readModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))).Select(x => x.SouceReadModuleId).ToListAsync();
+
+ isGenerateTaskVisitIds = await _readModuleRepository.Where(x => souceReadModuleIds.Contains(x.Id) && x.ReadingPeriodPlanId != null).Select(x => x.SubjectVisitId).ToListAsync();
+
+ inDto.SubjectVisitIdList= inDto.SubjectVisitIdList.Where(x => !isGenerateTaskVisitIds.Contains(x)).ToList();
+
+ var planIds= await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == inDto.Id && inDto.SubjectVisitIdList.Contains(x.SubjectVisitId)).Select(x=>x.Id).ToListAsync();
+
+
+ var deletePlasIds= planIds.Select(x=>(Guid?)x).ToList();
+
+ await _readModuleRepository.DeleteFromQueryAsync(x => deletePlasIds.Contains(x.ReadingPeriodPlanId));
+ await _readingPeriodPlanRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == inDto.Id && inDto.SubjectVisitIdList.Contains(x.SubjectVisitId));
+
+
+ await _readingPeriodPlanRepository.SaveChangesAsync();
+
+
+ return ResponseOutput.Ok(true);
+ }
+
///
/// 获取影像阅片的预览 // 需要清除之前已经选中的 (增加标准搜索,已修改)
///
///
[HttpPost]
- public async Task> GetPreviewTheReadingList(PreviewTheReadingListInDto inDto)
+ public async Task<(PageOutput,object)> GetPreviewTheReadingList(PreviewTheReadingListInDto inDto)
{
+
+ // 这里还需要获取到之前已经添加的
+ var isChangeReadingPlan = await IsChangeReadingPlan(new IsChangeReadingPlanInDto()
+ {
+ Id = inDto.ReadingPeriodSetId,
+ ExpirationDate = inDto.ExpirationDate,
+ ReadingScope = inDto.ReadingScope,
+ TrialId = inDto.TrialId,
+ ExpirationVisitNum = inDto.ExpirationVisitNum,
+ VisitStageId = inDto.VisitStageId,
+ ReadingSetType = inDto.ReadingSetType,
+ TrialReadingCriterionId = inDto.TrialReadingCriterionId,
+ SiteIds = inDto.SiteIds,
+ });
+
+ List isChooseVisitIds = new List();
+ List IsGenerateVisitIds = new List();
+ List chooseVisitVisitList = new List();
+ List isGenerateTaskVisitIds = new List();
+ List readModules = new List();
+ if (!isChangeReadingPlan)
+ {
+ if (inDto.ReadingPeriodSetId != null)
+ {
+ readModules = await _readModuleRepository.Where(x => x.ReadingPeriodSetId == inDto.ReadingPeriodSetId).ToListAsync();
+
+ var readModuleIds= readModules.Select(x => x.Id).ToList();
+
+ var souceReadModuleIds = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && readModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))).Select(x=>x.SouceReadModuleId).ToListAsync();
+
+ isGenerateTaskVisitIds = await _readModuleRepository.Where(x => souceReadModuleIds.Contains(x.Id)&&x.ReadingPeriodPlanId!=null).Select(x=>x.SubjectVisitId).ToListAsync();
+ }
+
+ chooseVisitVisitList = await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == inDto.ReadingPeriodSetId).ToListAsync();
+ isChooseVisitIds= chooseVisitVisitList.Select(x => x.SubjectVisitId).ToList();
+ IsGenerateVisitIds= chooseVisitVisitList.Where(x => x.IsGenerate).Select(x => x.SubjectVisitId).ToList();
+ }
+
+ var isTakeEffect = await _readingPeriodSetRepository.Where(x => x.Id == inDto.ReadingPeriodSetId).Select(x => x.IsTakeEffect).FirstOrDefaultAsync();
var readModulequery = _readModuleRepository.AsQueryable();
// 当前项目 最晚拍片日期不为null 中心筛选
var visitQuery = _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId && x.LatestScanDate != null && !x.IsLostVisit)
- .WhereIf(inDto.ReadingScope == ReadingScopeEnum.Site, x => inDto.SiteIds.Contains(x.TrialSiteId))
- .Where(x => !x.IsBaseLine);// 排除基线
+ .WhereIf(inDto.ReadingScope == ReadingScopeEnum.Site, x => inDto.SiteIds.Contains(x.TrialSiteId));
+ //.Where(x => !x.IsBaseLine);// 排除基线
+
+ var chooseVisitQuery = _subjectVisitRepository.Where(x => isChooseVisitIds.Contains(x.Id));
+
+
+ visitQuery= visitQuery.Union(chooseVisitQuery);
// 已经存在的访视 需要排除
var existsBubjectVisitsQuery = _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(x => x.SubjectVisitId);
- visitQuery = visitQuery.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
+ visitQuery = visitQuery
+
+ .Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
.WhereIf(inDto.ExpirationDate != null, x => x.LatestScanDate < inDto.ExpirationDate.Value.AddDays(1))
.WhereIf(inDto.ExpirationVisitNum != null, x => x.VisitNum == inDto.ExpirationVisitNum)
- .WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0);
+ .WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
+ .WhereIf(inDto.SiteId != null,x=> x.Subject.TrialSiteId==inDto.SiteId)
+ .WhereIf(inDto.SubjectCode.IsNotNullOrEmpty(), x =>x.Subject.Code.Contains(inDto.SubjectCode))
+ .WhereIf(inDto.IsJoin != null && inDto.IsJoin.Value, x => isChooseVisitIds.Contains(x.Id))
+ .WhereIf(inDto.IsGenerate != null && inDto.IsGenerate.Value, x => IsGenerateVisitIds.Contains(x.Id))
+ .WhereIf(inDto.IsJoin != null && !inDto.IsJoin.Value, x => !isChooseVisitIds.Contains(x.Id))
+ .WhereIf(inDto.IsGenerate != null && !inDto.IsGenerate.Value, x => !IsGenerateVisitIds.Contains(x.Id));
+
+ //.Where(x => isChooseVisitIds.Contains(x.Id));
+
var subjectIdlist = await visitQuery.OrderBy(x => x.SubjectId).Select(x => x.SubjectId).Distinct().Skip((inDto.PageIndex - 1) * inDto.PageSize).Take(inDto.PageSize).ToListAsync();
@@ -526,12 +787,18 @@ namespace IRaCIS.Core.Application.Service
SubjectCode = x.Subject.Code,
SubjectId = x.SubjectId,
SubjectVisitName = x.VisitName,
+ IsJoin= isChooseVisitIds.Contains(x.Id),
+ IsGenerate = IsGenerateVisitIds.Contains(x.Id),
+ IsGenerateTask = isGenerateTaskVisitIds.Contains(x.Id),
+ GeneratedTime = chooseVisitVisitList.Where(y=>y.SubjectVisitId==x.Id).Select(y=>y.GeneratedTime).FirstOrDefault(),
}).ToList(),
PageSize = inDto.PageSize,
PageIndex = inDto.PageIndex,
TotalCount = totalCount,
};
- return result;
+ return (result,new {
+ NeedReminder=inDto.ReadingPeriodSetId == null,
+ });
}
#endregion
diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs
index 6a43b2333..b3eebd05e 100644
--- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs
@@ -85,10 +85,22 @@ namespace IRaCIS.Core.Application.Service
public async Task
public string EmailSubject { get; set; } = string.Empty;
- ///
- /// 收件人
- ///
- public List ToRecipients { get; set; }
-
- ///
- /// 抄送人
- ///
- public List CcRecipients { get; set; }
-
- ///
- /// 附件
- ///
- public List Attachments { get; set; }
-
///
/// 日期
///
@@ -69,10 +66,7 @@ public class EmailLog : BaseFullAuditEntity
}
-public class EmaliSendInfo
-{
- public string Name { get; set; }
- public string Address { get; set; }
-}
+
+
diff --git a/IRaCIS.Core.Domain/Common/EmailRecipientLog.cs b/IRaCIS.Core.Domain/Common/EmailRecipientLog.cs
new file mode 100644
index 000000000..9f4f9b48a
--- /dev/null
+++ b/IRaCIS.Core.Domain/Common/EmailRecipientLog.cs
@@ -0,0 +1,40 @@
+using IRaCIS.Core.Domain.Share;
+
+namespace IRaCIS.Core.Domain.Models;
+
+[Comment("邮件收件人")]
+[Table("EmailRecipientLog")]
+public class EmailRecipientLog : BaseFullAuditEntity
+{
+ [JsonIgnore]
+ [ForeignKey("EmailLogId")]
+ public EmailLog EmailLog { get; set; }
+
+ ///
+ /// 邮件Id
+ ///
+ public Guid EmailLogId { get; set; }
+
+ ///
+ /// 收件人姓名
+ ///
+ public string RecipientName { get; set; }
+
+ ///
+ /// 收件人地址
+ ///
+ public string RecipientAddress { get; set; }
+
+ ///
+ /// 收件人类型
+ ///
+ public RecipientType RecipientTypeEnum { get; set; }
+
+ ///
+ /// 排序
+ ///
+ public int Sort { get; set; }
+
+}
+
+
diff --git a/IRaCIS.Core.Domain/Management/User.cs b/IRaCIS.Core.Domain/Management/User.cs
index 52d39c18e..a507eff9f 100644
--- a/IRaCIS.Core.Domain/Management/User.cs
+++ b/IRaCIS.Core.Domain/Management/User.cs
@@ -40,6 +40,11 @@ public class UserRole : BaseFullAuditEntity
[Comment("Զлһ")]
public bool AutoCutNextTask { get; set; }
+ ///
+ /// Ƿ˫
+ ///
+ public bool IsDoubleScreen { get; set; } = false;
+
[Comment("ҽ˺źֵ")]
diff --git a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadModule.cs b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadModule.cs
index c69c12028..dff226574 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadModule.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadModule.cs
@@ -54,6 +54,11 @@ public class ReadModule : BaseFullDeleteAuditEntity
[Comment("阅片计划ID")]
public Guid? ReadingPeriodSetId { get; set; }
+ ///
+ /// 阅片计划
+ ///
+ public Guid? ReadingPeriodPlanId { get; set; }
+
public Guid TrialId { get; set; }
public bool IsCRCConfirm { get; set; } = false;
@@ -72,5 +77,11 @@ public class ReadModule : BaseFullDeleteAuditEntity
[Comment("阅片配置的类型")]
public ReadingSetType ReadingSetType { get; set; }
+ ///
+ /// 添加方式
+ ///
+ public ReadModuleAddType ReadModuleAddTypeEnum { get; set; } = ReadModuleAddType.Normal;
+
+
public ReadingStatusEnum ReadingStatus { get; set; } = ReadingStatusEnum.TaskAllocate;
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
index a767552d6..5f250024c 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
@@ -19,4 +19,14 @@ public class ReadingPeriodPlan : BaseFullDeleteAuditEntity
[Comment("访视")]
public Guid SubjectVisitId { get; set; }
+
+ ///
+ /// 是否生成
+ ///
+ public bool IsGenerate { get; set; } = false;
+
+ ///
+ /// 生效时间
+ ///
+ public DateTime? GeneratedTime { get; set; }
}
diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
index b09391eae..a74c75f8b 100644
--- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
+++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
@@ -95,20 +95,6 @@ public class IRaCISDBContext : DbContext
});
});
- modelBuilder.Entity(entity =>
- {
- entity.OwnsMany(x => x.ToRecipients, ownedNavigationBuilder =>
- {
- ownedNavigationBuilder.ToJson();
- });
-
- entity.OwnsMany(x => x.CcRecipients, ownedNavigationBuilder =>
- {
- ownedNavigationBuilder.ToJson();
- });
- });
-
-
#region pgsql codefirst 配置 暂时屏蔽
//if (base.Database.IsNpgsql())
//{
@@ -570,6 +556,7 @@ public class IRaCISDBContext : DbContext
#region 未分类
public virtual DbSet EmailLog { get; set; }
+ public virtual DbSet EmailRecipientLog { get; set; }
public virtual DbSet ShortcutKey { get; set; }
diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs
index 5be1469b6..c577ba2dd 100644
--- a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs
+++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs
@@ -88,7 +88,7 @@ public class AuditEntityInterceptor(IUserInfo _userInfo,
//}
// 检查属性是否为string类型,并且值为null
- foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && t.CurrentValue == null))
+ foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && !t.Metadata.IsNullable && t.CurrentValue == null))
{
property.CurrentValue = string.Empty;
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20251031101502_ReadModuleAddTypeEnum.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20251031101502_ReadModuleAddTypeEnum.Designer.cs
new file mode 100644
index 000000000..87ad3b92d
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20251031101502_ReadModuleAddTypeEnum.Designer.cs
@@ -0,0 +1,20967 @@
+//
+using System;
+using IRaCIS.Core.Infra.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IRaCIS.Core.Infra.EFCore.Migrations
+{
+ [DbContext(typeof(IRaCISDBContext))]
+ [Migration("20251031101502_ReadModuleAddTypeEnum")]
+ partial class ReadModuleAddTypeEnum
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.19")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.Attachment", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("编码");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DoctorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsAuthorizedView")
+ .HasColumnType("bit");
+
+ b.Property("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("DoctorId");
+
+ b.ToTable("Attachment", t =>
+ {
+ t.HasComment("医生 - 简历|证书 文档表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentTypeEnum")
+ .HasColumnType("int");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileFormat")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FilePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileSize")
+ .HasPrecision(18, 2)
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsAuthorization")
+ .HasColumnType("bit");
+
+ b.Property("MainFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("MainFileId");
+
+ b.ToTable("AuditDocument", t =>
+ {
+ t.HasComment("稽查文档管理");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocumentClosure", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AncestorId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("祖先");
+
+ b.Property("Depth")
+ .HasColumnType("int");
+
+ b.Property("DescendantId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("后代");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AncestorId");
+
+ b.HasIndex("DescendantId");
+
+ b.ToTable("AuditDocumentClosure");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditContent")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AuditState")
+ .HasColumnType("int")
+ .HasComment("稽查状态");
+
+ b.Property("AuditTime")
+ .HasColumnType("date")
+ .HasComment("稽查日期");
+
+ b.Property("AuditType")
+ .HasColumnType("int")
+ .HasComment("稽查形式");
+
+ b.Property("BeginTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("EndTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsViewTrainingRecord")
+ .HasColumnType("bit");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditRecord");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordIdentityUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IdentityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditRecordId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("IdentityUserId");
+
+ b.ToTable("AuditRecordIdentityUser");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordPermission", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditDocumentId");
+
+ b.HasIndex("AuditRecordId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditRecordPermission");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CROCode")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CROName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CRONameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsTrialLevel")
+ .HasColumnType("bit")
+ .HasComment("是否是项目级别");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CROCompany", t =>
+ {
+ t.HasComment("机构 - CRO");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CheckChallengeDialog", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCRCNeedReply")
+ .HasColumnType("bit")
+ .HasComment("CRC是否需要回复 前端使用");
+
+ b.Property("ParamInfo")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("核查的检查信息Json");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TalkContent")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserTypeEnum")
+ .HasColumnType("int")
+ .HasComment("核查过程中的操作用户类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SubjectVisitId");
+
+ b.ToTable("CheckChallengeDialog", t =>
+ {
+ t.HasComment("一致性核查 - 对话记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowIndex")
+ .HasColumnType("int");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalAnswerRowInfo", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题行记录");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataSystemSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetEnum")
+ .HasColumnType("int")
+ .HasComment("枚举(字典里面取的)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsEnable")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalDataSystemSet", t =>
+ {
+ t.HasComment("系统 - 临床数据配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int")
+ .HasComment("临床级别");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsConfirm")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("SystemClinicalDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SystemClinicalDataSetId");
+
+ b.HasIndex("TrialId");
+
+ b.ToTable("ClinicalDataTrialSet", t =>
+ {
+ t.HasComment("项目 - 临床数据适应标准配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalForm", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CheckDate")
+ .HasColumnType("datetime2")
+ .HasComment("检查日期");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PicturePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("截图地址");
+
+ b.Property("ReadingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalDataTrialSetId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("ReadingId");
+
+ b.HasIndex("SubjectId");
+
+ b.ToTable("ClinicalForm", t =>
+ {
+ t.HasComment("受试者 - 临床表单");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalFormId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalQuestionAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalTableAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("答案");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("答案行的Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TableQuestionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("RowId");
+
+ b.ToTable("ClinicalTableAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessScenarioEnum")
+ .HasColumnType("int")
+ .HasComment("业务场景");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionTypeEnum")
+ .HasColumnType("int")
+ .HasComment("系统标准枚举");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileTypeEnum")
+ .HasColumnType("int")
+ .HasComment("类型-上传|导出|邮件附件");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CommonDocument", t =>
+ {
+ t.HasComment("数据上传 | 数据导出 | 邮件附件 文件记录表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsSystemCriterion")
+ .HasColumnType("bit");
+
+ b.Property("LesionType")
+ .HasColumnType("int")
+ .HasComment("病灶类型");
+
+ b.Property("OrganType")
+ .HasColumnType("int")
+ .HasComment("器官类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("CriterionId");
+
+ b.ToTable("CriterionNidusSystem", t =>
+ {
+ t.HasComment("系统标准 - 病灶器官表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusTrial", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LesionType")
+ .HasColumnType("int");
+
+ b.Property("OrganType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CriterionNidusTrial", t =>
+ {
+ t.HasComment("项目标准 - 病灶器官表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DataInspection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BatchId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("批次Id");
+
+ b.Property("ChildrenTypeId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("子类");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateUserName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("创建人姓名");
+
+ b.Property("CreateUserRealName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DoctorUserId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("阅片医生");
+
+ b.Property("EntityName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("被稽查实体名");
+
+ b.Property("GeneralId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("要稽查对象Id");
+
+ b.Property("IP")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Identification")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("标识");
+
+ b.Property("IsFrontAdd")
+ .HasColumnType("bit")
+ .HasComment("是否是前端添加");
+
+ b.Property("IsSign")
+ .HasColumnType("bit");
+
+ b.Property("JsonDetail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastJsonDetail")
+ .HasColumnType("nvarchar(max)")
+ .HasComment("上一条json");
+
+ b.Property("ModuleTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("被稽查对象外键1");
+
+ b.Property("ObjectRelationParentId2")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId3")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OptTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("父ID");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("角色名称");
+
+ b.Property("SignId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property