合并
continuous-integration/drone/push Build is failing Details

Uat_IRC_Net8
he 2025-05-15 09:14:10 +08:00
commit c347d08e2b
260 changed files with 125377 additions and 1298770 deletions

View File

@ -7,28 +7,28 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.5" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.405" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.36" />
<PackageReference Include="DistributedLock.Core" Version="1.0.7" />
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.5" />
<PackageReference Include="fo-dicom" Version="5.1.3" />
<PackageReference Include="fo-dicom.Codecs" Version="5.15.1" />
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.3" />
<PackageReference Include="AWSSDK.S3" Version="3.7.416.8" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.401.81" />
<PackageReference Include="DistributedLock.Core" Version="1.0.8" />
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.6" />
<PackageReference Include="fo-dicom" Version="5.2.1" />
<PackageReference Include="fo-dicom.Codecs" Version="5.16.1" />
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Minio" Version="6.0.3" />
<PackageReference Include="Minio" Version="6.0.4" />
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.2" />
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.2" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
</ItemGroup>
<ItemGroup>

View File

@ -20,6 +20,8 @@ namespace IRaCIS.Core.API.HostService;
public class HangfireHostService(IRecurringMessageScheduler _recurringMessageScheduler,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IMediator _mediator,
ILogger<HangfireHostService> _logger) : IHostedService
{
@ -55,6 +57,20 @@ public class HangfireHostService(IRecurringMessageScheduler _recurringMessageSch
}
// 系统邮件定时任务
var systemTaskInfoList = await _emailNoticeConfigrepository.Where(t => t.EmailCron != string.Empty && t.IsAutoSend)
.Select(t => new { t.Id, t.Code, t.EmailCron, t.BusinessScenarioEnum, })
.ToListAsync();
foreach (var task in systemTaskInfoList)
{
//利用主键作为任务Id
var jobId = $"{task.Id}_({task.BusinessScenarioEnum})";
HangfireJobHelper.AddOrUpdateSystemCronJob(jobId, task.BusinessScenarioEnum, task.EmailCron);
}
//await _recurringMessageScheduler.ScheduleRecurringPublish(new QCImageQuestionSchedule() { CronExpression = "0/3 * * * * ? " }, new MasstransiTestCommand { value = "message at " + DateTime.Now.ToString() });

View File

@ -69,24 +69,23 @@
<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ConfigMapFileProvider" Version="2.0.1" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.18" />
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
<PackageReference Include="Hangfire.InMemory" Version="1.0.0" />
<PackageReference Include="Hangfire.SqlServer" Version="1.8.14" />
<PackageReference Include="Invio.Extensions.Authentication.JwtBearer" Version="2.0.1" />
<PackageReference Include="LogDashboard" Version="1.4.8" />
<PackageReference Include="Hangfire.SqlServer" Version="1.8.18" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.Email" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.1" />
</ItemGroup>
<ItemGroup>
@ -114,6 +113,12 @@
</Content>
</ItemGroup>
<ItemGroup>
<None Update="Resources\GeoLite2-City.mmdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties properties_4launchsettings_1json__JsonSchema="" />

View File

@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.Service.BusinessFilter;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Infrastructure.Extention;
using LogDashboard;
using MassTransit;
using MassTransit.NewIdProviders;
using Microsoft.AspNetCore.Builder;
@ -136,7 +135,7 @@ builder.Services.AddFusionCache();
builder.Services.AddhangfireSetup(_configuration);
//Serilog 日志可视化 LogDashboard日志
builder.Services.AddLogDashboardSetup();
//builder.Services.AddLogDashboardSetup();
//Dicom影像渲染图片 跨平台
builder.Services.AddDicomSetup();
@ -221,7 +220,7 @@ app.UseResponseCompression();
app.UseStaticFiles();
//LogDashboard
app.UseLogDashboard("/LogDashboard");
//app.UseLogDashboard("/LogDashboard");
//hangfire
app.UseHangfireConfig(env);

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 MiB

View File

@ -1,15 +1,15 @@
using LogDashboard;
using LogDashboard.Authorization;
//using LogDashboard;
//using LogDashboard.Authorization;
namespace IRaCIS.Core.API.Filter
{
//namespace IRaCIS.Core.API.Filter
//{
public class LogDashBoardAuthFilter : ILogDashboardAuthorizationFilter
{
//在此可以利用 本系统的UerTypeEnum 判断
public bool Authorization(LogDashboardContext context)
{
return context.HttpContext.User.Identity.IsAuthenticated;
}
}
}
// public class LogDashBoardAuthFilter : ILogDashboardAuthorizationFilter
// {
// //在此可以利用 本系统的UerTypeEnum 判断
// public bool Authorization(LogDashboardContext context)
// {
// return context.HttpContext.User.Identity.IsAuthenticated;
// }
// }
//}

View File

@ -1,25 +1,25 @@

using LogDashboard;
using Microsoft.Extensions.DependencyInjection;
//using LogDashboard;
//using Microsoft.Extensions.DependencyInjection;
namespace IRaCIS.Core.API
{
public static class LogDashboardSetup
{
public static void AddLogDashboardSetup(this IServiceCollection services)
{
//IIS 配置虚拟路径部署会出现IIS静态文件404
services.AddLogDashboard(opt =>
{
//opt.PathMatch = "/api/LogDashboard";
opt.PathMatch = "/LogDashboard";
//namespace IRaCIS.Core.API
//{
// public static class LogDashboardSetup
// {
// public static void AddLogDashboardSetup(this IServiceCollection services)
// {
// //IIS 配置虚拟路径部署会出现IIS静态文件404
// services.AddLogDashboard(opt =>
// {
// //opt.PathMatch = "/api/LogDashboard";
// opt.PathMatch = "/LogDashboard";
//opt.AddAuthorizationFilter(new LogDashboardBasicAuthFilter("admin", "zhizhun2018"));
// //opt.AddAuthorizationFilter(new LogDashboardBasicAuthFilter("admin", "zhizhun2018"));
//opt.AddAuthorizationFilter(new LogDashBoardAuthFilter());
// //opt.AddAuthorizationFilter(new LogDashBoardAuthFilter());
});
// });
}
}
}
// }
// }
//}

View File

@ -16,30 +16,30 @@ namespace IRaCIS.Core.API;
public enum SwaggerVersion
{
[Description("文件记录")]
[Description("文件记录(FileRecord)")]
FileRecord = -1,
[Description("医生模块")]
[Description("医生模块(Reviewer)")]
Reviewer = 1,
[Description("项目模块")]
[Description("项目模块(Trial)")]
Trial = 2,
[Description("入组模块")]
[Description("入组模块(Enroll)")]
Enroll = 3,
[Description("工作量模块")]
[Description("工作量模块(Workload)")]
Workload = 4,
[Description("通用信息获取")]
[Description("通用信息获取(Common)")]
Common = 5,
[Description("机构信息模块")]
[Description("机构信息模块(Institution)")]
Institution = 6,
[Description("统计模块")]
[Description("统计模块(DashboardStatistics)")]
DashboardStatistics = 7,
[Description("财务模块")]
[Description("财务模块(Financial)")]
Financial = 8,
[Description("管理模块")]
[Description("管理模块(Management)")]
Management =9,
[Description("影像模块")]
[Description("影像模块(Image)")]
Image =10,
[Description("读片模块")]
[Description("读片模块(Reading)")]
Reading =11
};

View File

@ -52,7 +52,10 @@
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 2
},
"SystemEmailSendConfig": {
"Port": 465,

View File

@ -51,7 +51,9 @@
"ReadingRestTimeMin": 10,
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 2
},
"SystemEmailSendConfig": {

View File

@ -69,6 +69,8 @@
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 2,
"OpenTrialRelationDelete": true,

View File

@ -54,7 +54,8 @@
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 1,
"OpenTrialRelationDelete": false

View File

@ -64,7 +64,8 @@
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 1,
"OpenLoginMFA": true
},

View File

@ -63,7 +63,9 @@
"ReadingRestTimeMin": 10,
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 1
},
"SystemEmailSendConfig": {

View File

@ -70,7 +70,9 @@
"ReadingRestTimeMin": 10,
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90
"ChangePassWordDays": 90,
// 1 Elevate 2 Extensive
"TemplateType": 2
},
"SystemEmailSendConfig": {

View File

@ -34,6 +34,8 @@ public class ServiceVerifyConfigOption
[Description("修改密码的天数")]
public int ChangePassWordDays { get; set; }
public SysTemplateType TemplateType { get; set; }
public string ThirdPdfUrl { get; set; }
}

View File

@ -11,6 +11,12 @@ public static class SendEmailHelper
public static async Task SendEmailAsync(MimeMessage messageToSend, SystemEmailSendConfig _systemEmailConfig, EventHandler<MessageSentEventArgs>? messageSentSuccess = null)
{
//没有收件人 那么不发送
if (messageToSend.To.Count == 0)
{
return;
}
try
{
using (var smtp = new MailKit.Net.Smtp.SmtpClient())

View File

@ -20,12 +20,12 @@ namespace IRaCIS.Core.Application.Helper
//添加 或者更新定时任务 Id 要唯一标识一个定义任务
public static void AddOrUpdateCronJob<T>(string jobId, Expression<Action<T>> methodCall, string cron, string queueName = "default")
{
RecurringJob.AddOrUpdate<T>(jobId, queueName, methodCall, cron);
RecurringJob.AddOrUpdate<T>(jobId, queueName, methodCall, cron, new RecurringJobOptions() { TimeZone = TimeZoneInfo.Local });
}
public static void AddOrUpdateInitCronJob<T>(string jobId, Expression<Action<T>> methodCall, string cron)
{
RecurringJob.AddOrUpdate<T>(jobId, "sys_init", methodCall, cron);
RecurringJob.AddOrUpdate<T>(jobId, "sys_init", methodCall, cron, new RecurringJobOptions() { TimeZone = TimeZoneInfo.Local });
}
public static void RemoveCronJob(string jobId)
@ -73,17 +73,30 @@ namespace IRaCIS.Core.Application.Helper
case EmailBusinessScenario.QCToCRCImageQuestion:
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new QCImageQuestionRecurringEvent() { TrialId = trialId }, default), emailCron);
break;
//加急阅片 10分钟
//加急阅片 10分钟
case EmailBusinessScenario.ExpeditedReading:
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new UrgentIRUnReadTaskRecurringEvent() { TrialId = trialId }, default), emailCron);
break;
default:
break;
}
}
public static void AddOrUpdateSystemCronJob(string jobId, EmailBusinessScenario businessScenario, string emailCron)
{
switch (businessScenario)
{
case EmailBusinessScenario.GeneralTraining_ExpirationNotification:
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new SystemDocumentErverDayEvent() { }, default), emailCron);
break;
default:
break;
}
}
}
}

View File

@ -0,0 +1,42 @@
using IRaCIS.Core.Domain.Models;
using MaxMind.GeoIP2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Helper
{
public static class IPCityHelper
{
public static string GetCityResponse(string ip)
{
var path = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "GeoLite2-City.mmdb");
try
{
using (var reader = new DatabaseReader(path))
{
var city = reader.City(ip);
//Console.WriteLine(city.Country.IsoCode); // 'US' 'CN'
//Console.WriteLine(city.Country.Name); // 'United States' 'China'
////Console.WriteLine(city.Country.Names["zh-CN"]); // '美国'
//Console.WriteLine(city.MostSpecificSubdivision.Name); // 'Minnesota' 'Hubei'
//Console.WriteLine(city.City.Name); // 'Minneapolis' 'WUHan'
return $"{city.Country.Name} | {city.MostSpecificSubdivision.Name} | {city.City.Name}";
}
}
catch (Exception ex)
{
return $"UN | UN | {ip}";
}
}
}
}

View File

@ -33,37 +33,38 @@
<ItemGroup>
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.36" />
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.5" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.401.81" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.405" />
<PackageReference Include="DocX" Version="3.0.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.416.8" />
<PackageReference Include="DocX" Version="4.0.25105.5786" />
<PackageReference Include="FreeSpire.Doc" Version="12.2.0" />
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
<PackageReference Include="Hangfire.Core" Version="1.8.18" />
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
<PackageReference Include="ExcelDataReader.DataSet" Version="3.7.0" />
<PackageReference Include="DistributedLock.Redis" Version="1.0.3" />
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.5" />
<PackageReference Include="fo-dicom" Version="5.1.3" />
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.3" />
<PackageReference Include="fo-dicom.Codecs" Version="5.15.1" />
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.6" />
<PackageReference Include="fo-dicom" Version="5.2.1" />
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.2.1" />
<PackageReference Include="fo-dicom.Codecs" Version="5.16.1" />
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="MailKit" Version="4.11.0" />
<PackageReference Include="Masa.Contrib.Service.MinimalAPIs" Version="1.0.0" />
<PackageReference Include="MaxMind.GeoIP2" Version="5.2.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="MimeKit" Version="4.7.1" />
<PackageReference Include="MiniExcel" Version="1.34.2" />
<PackageReference Include="Minio" Version="6.0.3" />
<PackageReference Include="MiniWord" Version="0.8.0" />
<PackageReference Include="MimeKit" Version="4.11.0" />
<PackageReference Include="MiniExcel" Version="1.40.0" />
<PackageReference Include="Minio" Version="6.0.4" />
<PackageReference Include="MiniWord" Version="0.9.2" />
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
<PackageReference Include="NPOI" Version="2.7.1" />
<PackageReference Include="NPOI" Version="2.7.3" />
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.2" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="ZiggyCreatures.FusionCache" Version="1.4.0" />
<PackageReference Include="ZiggyCreatures.FusionCache" Version="2.1.0" />
</ItemGroup>
<ItemGroup>

View File

@ -736,6 +736,10 @@
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetSysDocumentConfirmList_Export(IRaCIS.Core.Application.Contracts.SystemDocQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Application.Interfaces.IDictionaryService)">
getSysDocumentConfirmList 系统文档培训查询
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.PMTrainingRecordList_Export(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument})">
<summary>
getDocumentConfirmList 培训记录导出--new
@ -1383,6 +1387,107 @@
<param name="inDto"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Service.AuditDocumentService">
<summary>
稽查文档
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.AuditDocument},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<summary>
稽查文档
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetAuditDocumentList(IRaCIS.Core.Application.ViewModel.AuditDocumentQuery)">
<summary>
获取稽查文档
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.UpdateAuditDocument(IRaCIS.Core.Application.ViewModel.AuditDocumentUpdateDto)">
<summary>
修改稽查文档
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.AddFolder(IRaCIS.Core.Application.ViewModel.AuditDocumentAddOrEdit)">
<summary>
新增文件夹
</summary>
<param name="inDto"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.AddAuditDocument(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.AuditDocumentAddOrEdit})">
<summary>
新增稽查文档
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.AddOrUpdateAuditDocument(IRaCIS.Core.Application.ViewModel.AuditDocumentAddOrEdit)">
<summary>
通用方法
</summary>
<param name="inDto"></param>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetBreadcrumbData(IRaCIS.Core.Application.ViewModel.GetBreadcrumbDataInDto)">
<summary>
获取面包屑导航
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetAuditDocumentData(IRaCIS.Core.Application.ViewModel.GetAuditDocumentDataInDto)">
<summary>
获取文件树形结构 (传Id 根节点就是自己)
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.DeleteAuditDocument(IRaCIS.Core.Application.ViewModel.DeleteAuditDocumentInDto)">
<summary>
删除稽查文档
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.MovieFileOrFolder(IRaCIS.Core.Application.ViewModel.MovieFileOrFolderInDto)">
<summary>
移动文件或者文件夹 到其他文件夹
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.CopyFileOrFolder(IRaCIS.Core.Application.ViewModel.MovieFileOrFolderInDto)">
<summary>
复制文件或者文件夹
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetHistoricalVersion(IRaCIS.Core.Application.ViewModel.GetHistoricalVersionInDto)">
<summary>
获取历史版本
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.SetCurrentVersion(IRaCIS.Core.Application.ViewModel.SetCurrentVersionInDto)">
<summary>
把历史版本设置为当前版本
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.SetIsAuthorization(IRaCIS.Core.Application.ViewModel.SetIsAuthorizationInDto)">
<summary>
设置是否授权
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Service.SysFileTypeService">
<summary>
系统文件类型
@ -1499,7 +1604,7 @@
<param name="_userInfo"></param>
<param name="_localizer"></param>
</member>
<member name="M:IRaCIS.Core.Application.Service.TrialFileTypeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFileType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SysFileType},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<member name="M:IRaCIS.Core.Application.Service.TrialFileTypeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFileType},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SysFileType},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<summary>
项目文件类型
</summary>
@ -2552,6 +2657,13 @@
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.Service.UserService.SetIsIgnoreUncommonly(IRaCIS.Core.Application.ViewModel.SetIsIgnoreUncommonlyInDto)">
<summary>
设置是否忽略异地登录
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.UserService.GetUserLoginRoleList(IRaCIS.Application.Contracts.IRCLoginDto,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
账号验证,获取账号角色信息 获取临时token
@ -4453,6 +4565,291 @@
<param name="digitPlaces"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
<summary>
获取阅片的计算数据
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="F:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.sODData">
<summary>
获取Sod的值
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
<summary>
删除病灶获取起始病灶序号RECIST1Point1 固定是1
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
<summary>
获取阅片报告
</summary>
<param name="indto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.TestCalculate(System.Guid,IRaCIS.Core.Domain.Share.QuestionType)">
<summary>
测试计算
</summary>
<param name="visitTaskId"></param>
<param name="type"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
<summary>
计算任务
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetReportVerify(IRaCIS.Core.Application.Service.Reading.Dto.GetReportVerifyInDto)">
<summary>
获取报告验证的信息(这里每个标准可能不一样 返回用object)
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.ReadingCalculate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.Collections.Generic.List{IRaCIS.Core.Domain.Share.QuestionType})">
<summary>
自动计算
</summary>
<param name="inDto"></param>
<param name="calculateType"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetReportTumor(System.Guid)">
<summary>
获取报告整体整体评估
</summary>
<param name="visitTaskId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetReportIsExistDisease(System.Guid)">
<summary>
获取报告是否存在疾病
</summary>
<param name="visitTaskId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
<summary>
验证访视提交
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
<summary>
将上一次的访视病灶添加到这一次
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetSODData(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取SOD
</summary>
<remarks>
靶病灶径线之和SOD
非淋巴结的长径 和淋巴结的短径
</remarks>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetSumOfDiameter(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
非淋巴结靶病灶长径之和
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetSODChange(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
与基线SOD相比变化量mm
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetSODPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
与基线访视相比SOD变化百分比
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
与整个访视期间SOD最低点相比增加的值mm
</summary>
<param name="inDto"></param>
<remarks>
要更新之前的
</remarks>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
与整个访视期间SOD最低点相比增加的百分比
</summary>
<param name="inDto"></param>
<remarks>
要更新之前的
</remarks>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowVisit(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
整个访视期间SOD最低点访视名称
</summary>
<param name="inDto"></param>
<remarks>
要更新之前的
</remarks>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetIsLymphTarget(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
是否存在非淋巴结靶病灶
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetIsAddFive(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
是否存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetIsAddFiveRowIndexs(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上的病灶
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetNETarget(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
被评估为NE的单个靶病灶
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetTumor(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
整体肿瘤评估
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.TestOncology">
<summary>
测试肿瘤学评估
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.CalculationGetImgOncology(System.String,System.String,System.String)">
<summary>
计算整体肿瘤评估 【测试】
</summary>
<param name="targetLesion">靶病灶</param>
<param name="noTargetLesion"> 非靶病灶</param>
<param name="newLesions">新病灶</param>
<remarks>
靶病灶 非靶病灶 存在新病灶 整体肿瘤评估
1. CR CR 否 CR
2. CR ND 否 CR
3. ND CR 否 CR
4. CR NN/NE 否/疑似/NE PR
5. CR CR/ND 疑似/NE PR
6. PR CR/ND/NN/NE 否/疑似/NE PR
7. ND CR 疑似/NE PR
8. SD CR/ND/NN/NE 否/疑似/NE SD
9. ND NN 否/疑似/NE NN
10.NE CR/ND/NN/NE 否/疑似/NE NE
11.ND NE 否/疑似/NE NE
12.ND ND NE NE
13.ND ND 否/疑似 ND
14.PD CR/NN/PD/ND/NE 是/否/疑似/NE PD
15.CR/PR/SD/PD/ND/NE PD 是/否/疑似/NE PD
16.CR/PR/SD/PD/ND/NE CR/NN/PD/ND/NE 是 PD
</remarks>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetIsExistDisease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
是否存在疾病
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.ChangeAllLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
<summary>
修改与整个访视期间SOD最低点相比增加的值mm
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.ChangeAllLowVisitName(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
<summary>
修改最低方式点名称
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.ChangeAllVisitTaskAnswer(System.Collections.Generic.List{System.Guid},System.Guid,System.String)">
<summary>
修改所有访视任务的答案
</summary>
<param name="visitTaskGuids"></param>
<param name="questionId"></param>
<param name="answer"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetBaseLineSOD(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取基线SOD
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowSODVisit(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取最低方式
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetVisitTaskAnswerList(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取访视任务信息
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLastVisitTaskId(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取上一个访视任务Id
</summary>
<returns></returns>
</member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)" -->
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetNoTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取非靶病灶评估
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetNewLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
<summary>
获取新病灶评估
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
<summary>
获取阅片的计算数据
@ -8462,6 +8859,11 @@
eCRF报告是否显示在图像页面
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetReadingTaskDto.ReadingVersionEnum">
<summary>
阅片版本
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetReadingTaskDto.IsReadingTaskViewInOrder">
<summary>
任务展示访视 读片任务显示是否顺序
@ -10118,6 +10520,11 @@
修约小数点
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionTrialInDto.ReadingVersionEnum">
<summary>
阅片版本
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
<summary>
标准分组
@ -12064,7 +12471,7 @@
阅片问题.标准
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingQuestionService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataSystemSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemCriterionDictionaryCode},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingSystemCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TumorAssessment_RECIST1Point1},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.PreviousPDF},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<member name="M:IRaCIS.Core.Application.Service.ReadingQuestionService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataSystemSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CriterionNidusSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemCriterionDictionaryCode},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingSystemCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TumorAssessment_RECIST1Point1},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.PreviousPDF},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<summary>
阅片问题.标准
</summary>
@ -12346,7 +12753,7 @@
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserLog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserFeedBack},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserLog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserFeedBack},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganTrialInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
<summary>
IR影像阅片
</summary>
@ -13533,6 +13940,12 @@
<param name="_readingClinicalDataReposiotry"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TestService.BackImageResize(System.Guid,System.Guid)">
<summary>
后端处理某个中心缩略图有问题 先下载,生成缩略图上传,然后更新数据库
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TestService.DealTialFileSie(IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalDataPDF})">
<summary>
非dicom 临床数据
@ -13674,6 +14087,26 @@
接口请求参考文档https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(IRaCIS.Core.Domain.Models.EmailNoticeConfig,MimeKit.MimeMessage,System.Func{System.ValueTuple{System.String,System.String},System.ValueTuple{System.String,System.String}})">
<summary>
系统默认邮件 + 项目默认邮件 (不用添加到项目邮件配置中,才发送)
</summary>
<param name="configInfo"></param>
<param name="messageToSend"></param>
<param name="emailFunc"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig,MimeKit.MimeMessage,System.Func{System.ValueTuple{System.String,System.String},System.ValueTuple{System.String,System.String}})">
<summary>
项目手动邮件 (需要添加到项目邮件配置中,才发送)
</summary>
<param name="configInfo"></param>
<param name="messageToSend"></param>
<param name="emailFunc"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.TranslationDictionary(IRaCIS.Core.Application.MassTransit.Consumer.TranslationDictionaryDto)">
<summary>
翻译字典
@ -13741,12 +14174,62 @@
构造函数注入
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer">
<summary>
影像重传和阅片人筛选相关邮件发送
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
影像重传和阅片人筛选相关邮件发送
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.DirectApplyReupdloadEvent})">
<summary>
处理直接申请流程的重传事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.CheckReuploadEvent})">
<summary>
处理一致性核查申请重传事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.QCChanllengeReuploadEvent})">
<summary>
处理质疑CRC申请重传事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.HaveReadVisitTaskReReading})">
<summary>
处理已阅任务重阅申请事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.SendImageReuploadEmail(IRaCIS.Core.Application.MassTransit.Consumer.Dto.SendImageReuploadEmailInDto)">
<summary>
发送影像重传相关邮件的通用方法
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.ReviewerPMApplyEvent})">
<summary>
处理PM申请阅片人筛选事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain._DomainEvent.ReviewerSPMApprovedEvent})">
<summary>
处理SPM审批阅片人筛选事件
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.SendReviewerSelectionEmail(IRaCIS.Core.Domain.Models.EmailNoticeConfig,System.Guid,System.Collections.Generic.List{System.Guid})">
<summary>
发送阅片人筛选相关邮件的通用方法
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer">
<summary>
加急的医学反馈任务 通知MIM
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
加急的医学反馈任务 通知MIM
</summary>
@ -13764,7 +14247,7 @@
MIM 回复医学返回通知IR
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMIMRepliedMedicalReviewConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMIMRepliedMedicalReviewConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
MIM 回复医学返回通知IR
</summary>
@ -13781,19 +14264,19 @@
加急阅片 IR 申请重阅 或者PM 申请重阅
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentIRApplyedReReadingConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentIRApplyedReReadingConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
加急阅片 IR 申请重阅 或者PM 申请重阅
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.UserSiteSurveySubmitedEventConsumer">
<summary>
用户提交 发送邮件 通知SPM 或者PM
用户提交 发送邮件 通知SPM 或者PM 项目默认邮件,不用添加到项目中,直接发送的
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UserSiteSurveySubmitedEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
用户提交 发送邮件 通知SPM 或者PM
用户提交 发送邮件 通知SPM 或者PM 项目默认邮件,不用添加到项目中,直接发送的
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.SiteSurveySPMSubmitedEventConsumer">
@ -13821,7 +14304,7 @@
CRC 提交了 通知QC进行质控 Code005006
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCSubmitedAndQCToAuditEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCSubmitedAndQCToAuditEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
CRC 提交了 通知QC进行质控 Code005006
</summary>
@ -13831,7 +14314,7 @@
CRC 回复质控质疑 通知QC Code012013
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCRepliedQCChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCRepliedQCChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
CRC 回复质控质疑 通知QC Code012013
</summary>
@ -13841,7 +14324,7 @@
QC回复 质控质疑通知CRC (014015)
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.QCRepliedQCChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.QCRepliedQCChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
QC回复 质控质疑通知CRC (014015)
</summary>
@ -13851,19 +14334,19 @@
CRC 回复一致性核查质疑 通知PM (019,020)
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCRepliedCheckChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CRCRepliedCheckChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
CRC 回复一致性核查质疑 通知PM (019,020)
</summary>
</member>
<!-- Badly formed XML comment ignored for member "T:IRaCIS.Core.Application.MassTransit.Consumer.PMRepliedCheckChallengeEventConsumer" -->
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.MassTransit.Consumer.PMRepliedCheckChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CheckChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})" -->
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.MassTransit.Consumer.PMRepliedCheckChallengeEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CheckChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})" -->
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.CheckStateChangedToAuditEventConsumer">
<summary>
通知PM 进行一致性核查 (018,030)
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CheckStateChangedToAuditEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CheckStateChangedToAuditEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
通知PM 进行一致性核查 (018,030)
</summary>
@ -13873,7 +14356,7 @@
QC 领取了质控任务 (007008)
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.QCClaimTaskEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.QCClaimTaskEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallenge},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.QCChallengeDialog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
QC 领取了质控任务 (007008)
</summary>
@ -13939,6 +14422,11 @@
影像质控
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.SystemDocumentErverDayEvent">
<summary>
定时提醒
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.QCImageQuestionRecurringSchedule">
<summary>
QC 影像质疑待处理
@ -13959,11 +14447,31 @@
10分钟检测通知IR 已通知的进行标注,下次不会再通知
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Recurring.UrgentIRUnReadTaskRecurringEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Recurring.UrgentIRUnReadTaskRecurringEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
10分钟检测通知IR 已通知的进行标注,下次不会再通知
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Recurring.SystemDocumentErverDayEventConsumer">
<summary>
定时过期提醒
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Recurring.SystemDocumentErverDayEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
定时过期提醒
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Recurring.SystemDocumentPublishEventConsumer">
<summary>
生效通知
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Recurring.SystemDocumentPublishEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
生效通知
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.TaskAllocationRuleView">
<summary> TaskAllocationRuleView 列表视图模型 </summary>
</member>
@ -14318,6 +14826,11 @@
<member name="T:IRaCIS.Core.Application.ViewModel.PublishLogAddOrEdit">
<summary> PublishLogAddOrEdit 列表查询参数模型</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.SysFileTypeAddOrEdit.SysTemplateTypeEnum">
<summary>
文档类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.SysFileTypeAddOrEdit.ShowOrder">
<summary>
显示顺序
@ -15424,6 +15937,26 @@
<member name="T:IRaCIS.Core.Application.Contracts.SystemDocumentQuery">
<summary>SystemDocumentQuery 列表查询参数模型</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocQuery.IsDeleted">
<summary>
课时状态
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocQuery.UserName">
<summary>
用户名
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocQuery.StartConfirmTime">
<summary>
开始时间
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocQuery.EndConfirmTime">
<summary>
结束时间
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery.IsDeleted">
<summary>
课时状态
@ -15447,6 +15980,21 @@
<member name="T:IRaCIS.Core.Application.Contracts.SystemDocumentAddOrEdit">
<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocumentAddOrEdit.CurrentStaffTrainDays">
<summary>
现有员工培训天数
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocumentAddOrEdit.NewStaffTrainDays">
<summary>
新员工培训天数
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.SystemDocumentAddOrEdit.IsPublish">
<summary>
是否发布
</summary>
</member>
<member name="T:IRaCIS.Core.Application.Contracts.TrialDocumentUserConfirmView">
<summary> TrialDocumentUserConfirmView 列表视图模型 </summary>
</member>
@ -16167,6 +16715,11 @@
流程配置是否确认
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.GetTrialReadingInfoOutDto.ReadingToolList">
<summary>
阅片工具
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.GetTrialReadingInfoOutDto.TrialId">
<summary>
项目ID
@ -16558,11 +17111,32 @@
SystemDocumentService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},MassTransit.Mediator.IScopedMediator,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocumentAttachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},Microsoft.Extensions.DependencyInjection.IServiceScopeFactory,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<summary>
SystemDocumentService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetSystemDocumentAttachmentList(IRaCIS.Core.Application.Contracts.SystemDocumentAttachmentQuery)">
<summary>
获取系统文档附件
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.AddOrUpdateSystemDocumentAttachment(IRaCIS.Core.Application.Contracts.SystemDocumentAttachmentAddOrEdit)">
<summary>
新增或编辑系统文档附件
</summary>
<param name="addOrEditSystemDocumentAttachment"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.DeleteSystemDocumentAttachment(System.Guid)">
<summary>
删除系统文档附件
</summary>
<param name="systemDocumentAttachmentId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetSystemDocumentListAsync(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
<summary>
管理端列表
@ -16570,6 +17144,18 @@
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.PublishSystemDocument(IRaCIS.Core.Application.Contracts.PublishSystemDocumentInDto)">
<summary>
发布系统文档
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.OutLineSystemDocument(IRaCIS.Core.Application.Contracts.PublishSystemDocumentInDto)">
<summary>
下线系统文档
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.getWaitSignSysDocList(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
<summary>
获取需要签署的系统文档列表
@ -16581,7 +17167,7 @@
TrialDocumentService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.ISystemDocumentService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.ISystemDocumentService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<summary>
TrialDocumentService
</summary>
@ -16614,6 +17200,12 @@
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetSysDocSignUserList">
<summary>
获取系统签署文档签署人下拉框
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialUserSelect(System.Guid)">
<summary>
项目下面的参与用户下拉
@ -16966,6 +17558,23 @@
<param name="qaDialogCommand"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.RequestImageBack(System.Guid)">
<summary>
CRC IQC 申请影像回退
</summary>
<param name="subjectVisitId"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.AuditImageBack(System.Guid,System.Boolean)">
<summary>
PM 审核CRC IQC 申请影像回退
</summary>
<param name="iamgeBackRecordId"></param>
<param name="isAgree"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.AddCheckChallengeReply(IRaCIS.Core.Application.Contracts.DTO.CheckChallengeDialogCommand)">
<summary>
一致性核查 质疑的添加/回复

View File

@ -14,19 +14,20 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
public static class CommonEmailHelper
{
public static async Task<EmailNoticeConfig> GetEmailSubejctAndHtmlInfoAndBuildAsync(IRepository<EmailNoticeConfig> _emailNoticeConfigrepository, EmailBusinessScenario scenario, MimeMessage messageToSend,
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
/// <summary>
/// 系统默认邮件 + 项目默认邮件 (不用添加到项目邮件配置中,才发送)
/// </summary>
/// <param name="configInfo"></param>
/// <param name="messageToSend"></param>
/// <param name="emailFunc"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public static async Task<EmailNoticeConfig> GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailNoticeConfig configInfo, MimeMessage messageToSend,
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var configInfo = await _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario).FirstOrDefaultAsync();
if (configInfo == null)
{
throw new BusinessValidationFailedException("系统未找到当前场景邮件配置信息,请联系运维人员核查");
}
var (topicStr, htmlBodyStr) = isEn_US ? (configInfo.EmailTopic, configInfo.EmailHtmlContent) : (configInfo.EmailTopicCN, configInfo.EmailHtmlContentCN);
try
@ -36,8 +37,9 @@ public static class CommonEmailHelper
}
catch (Exception ex)
{
//"邮件模板内容有误,填充内容出现问题,请联系运维人员核查"
throw new BusinessValidationFailedException("邮件模板内容有误,填充内容出现问题,请联系运维人员核查");
throw new BusinessValidationFailedException(I18n.T("CommonEmail_ConfigError"));
}
@ -52,6 +54,49 @@ public static class CommonEmailHelper
return configInfo;
}
/// <summary>
/// 项目手动邮件 (需要添加到项目邮件配置中,才发送)
/// </summary>
/// <param name="configInfo"></param>
/// <param name="messageToSend"></param>
/// <param name="emailFunc"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public static async Task<TrialEmailNoticeConfig> GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(TrialEmailNoticeConfig configInfo, MimeMessage messageToSend,
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var (topicStr, htmlBodyStr) = isEn_US ? (configInfo.EmailTopic, configInfo.EmailHtmlContent) : (configInfo.EmailTopicCN, configInfo.EmailHtmlContentCN);
try
{
//每个场景修改主题 和body的逻辑不一样
(topicStr, htmlBodyStr) = emailFunc((topicStr, htmlBodyStr));
}
catch (Exception ex)
{
//"邮件模板内容有误,填充内容出现问题,请联系运维人员核查"
throw new BusinessValidationFailedException(I18n.T("CommonEmail_ConfigError"));
}
messageToSend.Subject = topicStr;
var builder = new BodyBuilder();
builder.HtmlBody = htmlBodyStr;
messageToSend.Body = builder.ToMessageBody();
return configInfo;
}
public static string ReplaceCompanyName(SystemEmailSendConfig _systemEmailConfig, string needDealtxt)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
@ -74,12 +119,13 @@ public static class CommonEmailHelper
var enumValueList = inDto.DictionaryList.Select(x => x.EnumValue).ToList();
var dicList =await inDto.DictionaryRepository.Where(x => dictionaryCodelist.Contains(x.Parent.Code) && enumValueList.Contains(x.Code)).Select(x=>new DictionaryData() {
DictionaryCode=x.Parent.Code,
EnumValue=x.Code,
Value=x.Value,
ValueCN=x.ValueCN
var dicList = await inDto.DictionaryRepository.Where(x => dictionaryCodelist.Contains(x.Parent.Code) && enumValueList.Contains(x.Code)).Select(x => new DictionaryData()
{
DictionaryCode = x.Parent.Code,
EnumValue = x.Code,
Value = x.Value,
ValueCN = x.ValueCN
}).ToListAsync();
@ -88,7 +134,7 @@ public static class CommonEmailHelper
inDto.DictionaryList.ForEach(x =>
{
var dic = dicList.Where(y => y.EnumValue == x.EnumValue && y.DictionaryCode == x.DictionaryCode).FirstOrDefault();
var dic = dicList.Where(y => y.EnumValue == x.EnumValue && y.DictionaryCode.Equals(x.DictionaryCode,StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
result.Add(dic == null ? string.Empty : (inDto.IsEn_US ? dic.Value : dic.ValueCN));
});

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.MassTransit.Consumer.Dto
{
public class SendImageReuploadEmailInDto
{
public EmailNoticeConfig EmailNoticeConfig { get; set; }
public EmailBusinessScenario Scenario { get; set; }
public SubjectVisit SubjectVisit { get; set; }
public Guid TrialId { get; set; }
public List<UserTypeEnum> UserTypes { get; set; } = null;
public ImageBackStateEnum ImageBackStateEnum { get; set; } = ImageBackStateEnum.None;
public RequestBackStateEnum RequestBackStateEnum { get; set; } = RequestBackStateEnum.NotRequest;
public ReReadingApplyState ReReadingApplyState { get; set; } = ReReadingApplyState.Default;
}
}

View File

@ -0,0 +1,522 @@
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Application.MassTransit.Consumer.Dto;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain;
using IRaCIS.Core.Domain._DomainEvent;
using IRaCIS.Core.Domain.BaseModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common;
using MassTransit;
using MassTransit.Mediator;
using MassTransit.Scheduling;
using Medallion.Threading;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Options;
using MimeKit;
using Newtonsoft.Json;
using Panda.DynamicWebApi.Attributes;
using RestSharp;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.MassTransit.Consumer;
/// <summary>
/// 影像重传和阅片人筛选相关邮件发送
/// </summary>
public class ImageConsumer(
IRepository<UserRole> _userRoleRepository,
IRepository<TrialUserRole> _trialUseRoleRepository,
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<Trial> _trialRepository,
IRepository<Enroll> _enrollRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<ReadModule> _readModuleRepository,
IRepository<EmailNoticeUserType> _emailNoticeUserTypeRepository,
IRepository<TrialSite> _trialSiteRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) :
IConsumer<DirectApplyReupdloadEvent>,
IConsumer<CheckReuploadEvent>,
IConsumer<QCChanllengeReuploadEvent>,
IConsumer<HaveReadVisitTaskReReading>,
IConsumer<ReviewerPMApplyEvent>,
IConsumer<ReviewerSPMApprovedEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
/// <summary>
/// 处理直接申请流程的重传事件
/// </summary>
public async Task Consume(ConsumeContext<DirectApplyReupdloadEvent> context)
{
Console.WriteLine("发送【影像重传-直接申请流程】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialId = subjectVisit.TrialId;
List<UserTypeEnum> userTypes = null;
// 根据申请角色和状态确定邮件场景
EmailBusinessScenario scenario;
if (context.Message.ImageBackState == ImageBackStateEnum.None)
{
switch (context.Message.ApplyUserRole)
{
case ImageBackApplyEnum.IQCRequestBack:
scenario = EmailBusinessScenario.ImageQC_IQCApplyRe_Uploading; // 64
break;
case ImageBackApplyEnum.CRCRequestBack:
scenario = EmailBusinessScenario.ImageUploadCRCApplyRe_Uploading; // 65
break;
default:
scenario = EmailBusinessScenario.ImageQC_IQCApplyRe_Uploading; // 64
break;
}
}
else
{
scenario = EmailBusinessScenario.ImageReUpload_PMApprovalRe_Uploading; // 66
if (context.Message.ApplyUserRole == ImageBackApplyEnum.IQCRequestBack)
{
userTypes = new List<UserTypeEnum>() { UserTypeEnum.IQC, UserTypeEnum.ClinicalResearchCoordinator };
}
else if (context.Message.ApplyUserRole == ImageBackApplyEnum.CRCRequestBack)
{
userTypes = new List<UserTypeEnum>() { UserTypeEnum.ClinicalResearchCoordinator };
}
}
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
var inDto = new SendImageReuploadEmailInDto
{
EmailNoticeConfig = emailConfig,
Scenario = scenario,
SubjectVisit = subjectVisit,
TrialId = trialId,
UserTypes = userTypes,
ImageBackStateEnum = context.Message.ImageBackState
};
await SendImageReuploadEmail(inDto);
}
}
/// <summary>
/// 处理一致性核查申请重传事件
/// </summary>
public async Task Consume(ConsumeContext<CheckReuploadEvent> context)
{
Console.WriteLine("发送【一致性核查-影像重传】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialId = subjectVisit.TrialId;
// 根据状态确定邮件场景
EmailBusinessScenario scenario;
switch (context.Message.RequestBackState)
{
case RequestBackStateEnum.CRC_RequestBack:
scenario = EmailBusinessScenario.DataReconciliation_CRCApplyRe_Uploading; // 62
break;
case RequestBackStateEnum.PM_AgressBack:
case RequestBackStateEnum.PM_NotAgree:
scenario = EmailBusinessScenario.DataReconciliation_PMApprovalRe_Uploading; // 63
break;
default:
return; // 其他状态不发送邮件
}
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
var inDto = new SendImageReuploadEmailInDto
{
EmailNoticeConfig = emailConfig,
Scenario = scenario,
SubjectVisit = subjectVisit,
TrialId = trialId,
RequestBackStateEnum = context.Message.RequestBackState,
};
await SendImageReuploadEmail(inDto);
}
}
/// <summary>
/// 处理质疑CRC申请重传事件
/// </summary>
public async Task Consume(ConsumeContext<QCChanllengeReuploadEvent> context)
{
Console.WriteLine("发送【影像质疑-影像重传】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialId = subjectVisit.TrialId;
// 根据状态确定邮件场景
EmailBusinessScenario scenario;
switch (context.Message.ReuploadEnum)
{
case QCChanllengeReuploadEnum.CRCRequestReupload:
scenario = EmailBusinessScenario.ImageQueryCRCApplyRe_Uploading; // 60
break;
case QCChanllengeReuploadEnum.QCAgreeUpload:
scenario = EmailBusinessScenario.ImageQuery_IQCApprovalRe_Uploading; // 61
break;
default:
return; // 其他状态不发送邮件
}
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
var inDto = new SendImageReuploadEmailInDto
{
EmailNoticeConfig = emailConfig,
Scenario = scenario,
SubjectVisit = subjectVisit,
TrialId = trialId
};
await SendImageReuploadEmail(inDto);
}
}
/// <summary>
/// 处理已阅任务重阅申请事件
/// </summary>
public async Task Consume(ConsumeContext<HaveReadVisitTaskReReading> context)
{
Console.WriteLine("发送【重阅-影像重传】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var visitTaskId = context.Message.VisitTaskId;
// 获取VisitTask关联的SubjectVisit
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
var subjectVisit = new SubjectVisit() { };
if (visitTask.SourceSubjectVisitId != null)
{
subjectVisit = visitTask.SourceSubjectVisit;
}
else if (visitTask.SouceReadModuleId != null)
{
var readModule = await _readModuleRepository.Where(x => x.Id == visitTask.SouceReadModuleId).Include(x => x.SubjectVisit).FirstOrDefaultAsync();
subjectVisit = readModule.SubjectVisit;
}
var trialId = subjectVisit.TrialId;
// 根据状态确定邮件场景
EmailBusinessScenario scenario;
switch (context.Message.ReReadingApplyState)
{
case ReReadingApplyState.TrialGroupHaveApplyed:
scenario = EmailBusinessScenario.ReadTracking_PMApplyRe_Reading; // 67
break;
case ReReadingApplyState.Agree:
case ReReadingApplyState.Reject:
scenario = EmailBusinessScenario.Re_ReadApproval_SPMCPMApprovalRe_Reading; // 68
break;
default:
return; // 其他状态不发送邮件
}
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
var inDto = new SendImageReuploadEmailInDto
{
EmailNoticeConfig = emailConfig,
Scenario = scenario,
SubjectVisit = subjectVisit,
TrialId = trialId,
ReReadingApplyState= context.Message.ReReadingApplyState,
};
await SendImageReuploadEmail(inDto);
}
}
/// <summary>
/// 发送影像重传相关邮件的通用方法
/// </summary>
private async Task SendImageReuploadEmail(SendImageReuploadEmailInDto inDto)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
inDto.SubjectVisit = await _subjectVisitRepository.Where(x => x.Id == inDto.SubjectVisit.Id).Include(x => x.Subject).FirstNotNullAsync();
// 获取项目信息
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == inDto.TrialId);
// 根据不同场景获取不同角色的用户
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == inDto.TrialId && !x.TrialUser.IsDeleted).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
// 根据场景确定收件人
List<UserRole> toUserList = new List<UserRole>();
List<UserRole> ccUserList = new List<UserRole>();
var emailNoticeUserList = await _emailNoticeUserTypeRepository.Where(x => x.EmailNoticeConfigId == inDto.EmailNoticeConfig.Id).ToListAsync();
var userTypeEnum = emailNoticeUserList.Select(x => x.UserType).ToList();
if (inDto.UserTypes != null)
{
userTypeEnum = inDto.UserTypes;
}
var crcUserList = new List<UserRole>() { };
if (userTypeEnum.Contains(UserTypeEnum.ClinicalResearchCoordinator))
{
crcUserList = await _trialSiteRepository.Where(x => x.Id == inDto.SubjectVisit.TrialSiteId).SelectMany(x => x.CRCUserList.Select(y => y.UserRole)).ToListAsync();
}
if (inDto.UserTypes == null)
{
var toList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.To && x.UserType != UserTypeEnum.ClinicalResearchCoordinator).Select(x => x.UserType).ToList();
toUserList = trialUser.Where(x => toList.Contains(x.UserTypeEnum)).ToList();
if (emailNoticeUserList.Any(x => x.EmailUserType == EmailUserType.To && x.UserType == UserTypeEnum.ClinicalResearchCoordinator))
{
toUserList.AddRange(crcUserList);
}
}
else
{
var toList = inDto.UserTypes.Where(x => x != UserTypeEnum.ClinicalResearchCoordinator).ToList();
toUserList = trialUser.Where(x => toList.Contains(x.UserTypeEnum)).ToList();
if (inDto.UserTypes.Any(x => x == UserTypeEnum.ClinicalResearchCoordinator))
{
toUserList.AddRange(crcUserList);
}
}
var ccList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.Copy && x.UserType != UserTypeEnum.ClinicalResearchCoordinator).Select(x => x.UserType).ToList();
ccUserList = trialUser.Where(x => ccList.Contains(x.UserTypeEnum)).ToList();
if (emailNoticeUserList.Any(x => x.EmailUserType == EmailUserType.Copy && x.UserType == UserTypeEnum.ClinicalResearchCoordinator))
{
ccUserList.AddRange(crcUserList);
}
// 如果没有收件人,则不发送邮件
if (toUserList.Count == 0)
{
return;
}
List<DictionaryDto> dictionaryDtos = new List<DictionaryDto>() {
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=inDto.SubjectVisit.IsUrgent.ToString().ToLower(), }, //是否加急
};
switch (inDto.Scenario)
{
case EmailBusinessScenario.Re_ReadApproval_SPMCPMApprovalRe_Reading:
dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "ReReadingApplyState", EnumValue = inDto.ReReadingApplyState.GetEnumInt(), });
break;
case EmailBusinessScenario.DataReconciliation_PMApprovalRe_Uploading:
dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "RequestBackState", EnumValue = inDto.RequestBackStateEnum.GetEnumInt(), });
break;
default:
dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "ImageBackStateEnum", EnumValue = inDto.ImageBackStateEnum.GetEnumInt(), });//审批结果
break;
}
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = dictionaryDtos
});
foreach (var userinfo in toUserList)
{
var messageToSend = new MimeMessage();
// 发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
// 添加抄送
foreach (var ccUser in ccUserList)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, ccUser.EMail));
}
// 格式化邮件内容
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = inDto.SubjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, inDto.SubjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
inDto.SubjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 是否加急 {4}
dictionValue[1], // 审批结果 {5}
_systemEmailConfig.SiteUrl // 链接 {6}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(inDto.EmailNoticeConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
/// <summary>
/// 处理PM申请阅片人筛选事件
/// </summary>
public async Task Consume(ConsumeContext<ReviewerPMApplyEvent> context)
{
Console.WriteLine("发送【阅片人筛选-PM申请审批】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
// 获取项目信息
var enrollIdList = context.Message.EnrollIdList;
if (enrollIdList == null || !enrollIdList.Any())
{
return;
}
// 获取第一个Enroll的TrialId
var enrollId = enrollIdList.First();
var enroll = await _enrollRepository.Where(x => x.Id == enrollId).FirstNotNullAsync();
var trialId = enroll.TrialId;
// 设置邮件场景
var scenario = EmailBusinessScenario.ReviewerSelection_PMApplyApproving; // 69
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
await SendReviewerSelectionEmail(emailConfig, trialId, enrollIdList);
}
}
/// <summary>
/// 处理SPM审批阅片人筛选事件
/// </summary>
public async Task Consume(ConsumeContext<ReviewerSPMApprovedEvent> context)
{
Console.WriteLine("发送【阅片人筛选-SPM审批】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
// 获取项目信息
var enrollIdList = context.Message.EnrollIdList;
if (enrollIdList == null || !enrollIdList.Any())
{
return;
}
// 获取第一个Enroll的TrialId
var enrollId = enrollIdList.First();
var enroll = await _enrollRepository.Where(x => x.Id == enrollId).FirstNotNullAsync();
var trialId = enroll.TrialId;
// 设置邮件场景
var scenario = EmailBusinessScenario.ReviewerSelection_SPMCPMApproval; // 70
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
if (emailConfig != null)
{
await SendReviewerSelectionEmail(emailConfig, trialId, enrollIdList);
}
}
/// <summary>
/// 发送阅片人筛选相关邮件的通用方法
/// </summary>
private async Task SendReviewerSelectionEmail(EmailNoticeConfig emailNoticeConfig, Guid trialId, List<Guid> enrollIdList)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
// 获取项目信息
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
// 根据不同场景获取不同角色的用户
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == trialId && !x.TrialUser.IsDeleted).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
// 根据场景确定收件人
List<UserRole> toUserList = new List<UserRole>();
List<UserRole> ccUserList = new List<UserRole>();
var emailNoticeUserList = await _emailNoticeUserTypeRepository.Where(x => x.EmailNoticeConfigId == emailNoticeConfig.Id).ToListAsync();
var toList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.To).Select(x => x.UserType).ToList();
toUserList = trialUser.Where(x => toList.Contains(x.UserTypeEnum)).ToList();
var ccList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.Copy && x.UserType != UserTypeEnum.ClinicalResearchCoordinator).Select(x => x.UserType).ToList();
ccUserList = trialUser.Where(x => ccList.Contains(x.UserTypeEnum)).ToList();
// 如果没有收件人,则不发送邮件
if (toUserList.Count == 0)
{
return;
}
foreach (var userinfo in toUserList)
{
var messageToSend = new MimeMessage();
// 发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
// 添加抄送
foreach (var ccUser in ccUserList)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, ccUser.EMail));
}
// 格式化邮件内容
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
"", // 受试者 {2} - 阅片人筛选不涉及受试者
"", // 访视 {3} - 阅片人筛选不涉及访视
"", // 是否加急 {4}
"", // 预留 {5}
_systemEmailConfig.SiteUrl // 链接 {6}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailNoticeConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}

View File

@ -29,7 +29,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig
) : IConsumer<UrgentMedicalReviewAddedEvent>
{
@ -48,52 +48,62 @@ public class UrgentMedicalReviewAddedEventConsumer(
var medicalReviewId = context.Message.MedicalReviewId;
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x=>x.MedicalManagerUser).FirstOrDefaultAsync();
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x => x.MedicalManagerUser).FirstOrDefaultAsync();
if (medicalReview.MedicalManagerUserId == null)
{
Console.WriteLine("MIMId为空 ID"+ medicalReviewId);
Console.WriteLine("MIMId为空 ID" + medicalReviewId);
return;
}
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x=>x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
var trialId = medicalReview.TrialId;
var scenario = context.Message.IsPD ? EmailBusinessScenario.PDVerification_MedicalQC : EmailBusinessScenario.EligibilityVerification_MedicalQC;
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
DictionaryList = new List<DictionaryDto>()
{
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }
}
}) ;
});
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
@ -107,7 +117,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
subjectName, // 受试者 {3}
taskInfo.TaskBlindName, // 访视 {4}
dictionValue[0], // 任务类型 {5}
//dictionValue[1], // 阅片人是否同意 {6}
//dictionValue[1], // 阅片人是否同意 {6}
dictionValue[2], // 审核状态 {6}
dictionValue[3], // 是否加急 {7}
_systemEmailConfig.SiteUrl // 链接 {8}
@ -116,13 +126,12 @@ public class UrgentMedicalReviewAddedEventConsumer(
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
context.Message.IsPD ? EmailBusinessScenario.PDVerification_MedicalQC : EmailBusinessScenario.EligibilityVerification_MedicalQC,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
@ -135,7 +144,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentIRRepliedMedicalReview>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -151,79 +160,85 @@ public class UrgentIRRepliedMedicalReviewConsumer(
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x => x.MedicalManagerUser).FirstOrDefaultAsync();
if (medicalReview.MedicalManagerUserId == null)
{
Console.WriteLine("MIMId为空 ID" + medicalReviewId);
return;
}
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
var trialId = medicalReview.TrialId;
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
var scenario = context.Message.IsPD ? EmailBusinessScenario.PDVerification_ExpeditedMedicalQCResponse : EmailBusinessScenario.EligibilityVerification_ExpeditedMedicalQCResponse;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
DictionaryList = new List<DictionaryDto>()
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }
}
});
});
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
criterion.CriterionName, // 阅片标准 {2}
subjectCode, // 受试者 {3}
taskInfo.TaskBlindName, // 访视 {4}
dictionValue[0], // 任务类型 {5}
dictionValue[1], // 阅片人是否同意 {6}
dictionValue[2], // 审核状态 {7}
dictionValue[3], // 是否加急 {8}
_systemEmailConfig.SiteUrl // 链接 {9}
);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
criterion.CriterionName, // 阅片标准 {2}
subjectCode, // 受试者 {3}
taskInfo.TaskBlindName, // 访视 {4}
dictionValue[0], // 任务类型 {5}
dictionValue[1], // 阅片人是否同意 {6}
dictionValue[2], // 审核状态 {7}
dictionValue[3], // 是否加急 {8}
_systemEmailConfig.SiteUrl // 链接 {9}
);
return (topicStr, htmlBodyStr);
};
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
context.Message.IsPD ? EmailBusinessScenario.PDVerification_ExpeditedMedicalQCResponse : EmailBusinessScenario.EligibilityVerification_ExpeditedMedicalQCResponse,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
@ -238,7 +253,7 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentMIMRepliedMedicalReview>
{
@ -254,91 +269,93 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
Console.WriteLine("发送(022) 【加急医学反馈】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var medicalReviewId = context.Message.MedicalReviewId;
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x => x.MedicalManagerUser).FirstOrDefaultAsync();
if (medicalReview.MedicalManagerUserId == null)
{
Console.WriteLine("MIMId为空 ID" + medicalReviewId);
return;
}
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
var userinfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
var trialId = medicalReview.TrialId;
var scenario = EmailBusinessScenario.ExpeditedMedicalQCToIR;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
var userinfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
DictionaryList = new List<DictionaryDto>()
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
new DictionaryDto (){DictionaryCode= "IsPass",EnumValue=medicalReview.IsHaveQuestion.ToString().ToLower(), },// 审核结论
new DictionaryDto (){DictionaryCode= "AuditAdvice",EnumValue=medicalReview.AuditAdviceEnum.GetEnumInt(), },// 审核建议
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }, //是否加急
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }, //是否加急
}
});
});
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
taskInfo.TaskBlindName, // 访视 {3}
criterion.CriterionName, // 阅片标准 {4}
dictionValue[0], // 任务类型 {5}
dictionValue[1], // 审核结论 {6}
dictionValue[2], // 医学审核建议 {7}
dictionValue[3], // 是否加急 {8}
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
taskInfo.TaskBlindName, // 访视 {3}
criterion.CriterionName, // 阅片标准 {4}
dictionValue[0], // 任务类型 {5}
dictionValue[1], // 审核结论 {6}
dictionValue[2], // 医学审核建议 {7}
dictionValue[3], // 是否加急 {8}
_systemEmailConfig.SiteUrl // 链接 {9}
);
_systemEmailConfig.SiteUrl // 链接 {9}
);
return (topicStr, htmlBodyStr);
};
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
EmailBusinessScenario.ExpeditedMedicalQCToIR,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -354,7 +371,7 @@ public class UrgentIRApplyedReReadingConsumer(
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentApplyedReReading>
{
@ -367,82 +384,90 @@ public class UrgentIRApplyedReReadingConsumer(
var visitTaskId = context.Message.VisitTaskId;
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == taskInfo.TrialReadingCriterionId);
var doctorInfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
var trialId=taskInfo.TrialId;
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == taskInfo.TrialId).Include(x => x.UserRole).Select(x=>x.UserRole).ToListAsync();
var scenario = context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed ? EmailBusinessScenario.ReReadFromPMApproval : EmailBusinessScenario.ReReadFromIRApproval;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ProjectManager||x.UserTypeEnum==UserTypeEnum.APM).ToList();
if (context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (trialEmailConfig != null)
{
userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.CPM || x.UserTypeEnum == UserTypeEnum.SPM).ToList();
}
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == taskInfo.TrialReadingCriterionId);
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
var doctorInfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == taskInfo.TrialId && x.TrialUser.IsDeleted==false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == taskInfo.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.ProjectManager || x.UserTypeEnum == UserTypeEnum.APM).ToList();
if (context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
{
userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.CPM || x.UserTypeEnum == UserTypeEnum.SPM).ToList();
}
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == taskInfo.TrialId);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), }, //任务类型
new DictionaryDto (){DictionaryCode= "RequestReReadingResult",EnumValue="0", }, //审批结果 都是待审批
}
});
});
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
taskInfo.TaskBlindName, // 访视 {3}
dictionValue[0], // 任务类型 {4}
doctorInfo.FullName, // 阅片人 {5}
criterion.CriterionName, // 阅片标准 {6}
dictionValue[1], // 审批结果 {7}
_systemEmailConfig.SiteUrl // 链接 {8}
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
taskInfo.TaskBlindName, // 访视 {3}
dictionValue[0], // 任务类型 {4}
doctorInfo.FullName, // 阅片人 {5}
criterion.CriterionName, // 阅片标准 {6}
dictionValue[1], // 审批结果 {7}
_systemEmailConfig.SiteUrl // 链接 {8}
);
);
return (topicStr, htmlBodyStr);
};
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed? EmailBusinessScenario.ReReadFromPMApproval: EmailBusinessScenario.ReReadFromIRApproval,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
}

View File

@ -25,7 +25,7 @@ using System.Threading.Tasks;
namespace IRaCIS.Core.Application.MassTransit.Consumer;
/// <summary>
/// 用户提交 发送邮件 通知SPM 或者PM
/// 用户提交 发送邮件 通知SPM 或者PM 项目默认邮件,不用添加到项目中,直接发送的
/// </summary>
public class UserSiteSurveySubmitedEventConsumer(
IRepository<Trial> _trialRepository,
@ -47,75 +47,83 @@ public class UserSiteSurveySubmitedEventConsumer(
var trialId = siteSurveyInfo.TrialId;
var trialUserList = await _trialUserRoleRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
.Select(t => new { t.UserRole.FullName, t.UserRole.IdentityUser.EMail, t.UserRole.UserTypeEnum }).ToListAsync();
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
var messageToSend = new MimeMessage();
var toUserName = string.Empty;
//有SPM
if (sPMOrCPMList.Count > 0)
{
foreach (var user in sPMOrCPMList)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', sPMOrCPMList.Select(t => t.FullName));
foreach (var user in pmAndAPMList)
{
messageToSend.Cc.Add(new MailboxAddress(user.FullName, user.EMail));
}
}
else
{
foreach (var user in pmAndAPMList)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', pmAndAPMList.Select(t => t.FullName));
}
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
siteInfo.TrialSiteCode,
siteInfo.TrialSiteAliasName,
siteSurveyInfo.UserName,
siteSurveyInfo.Email,
siteSurveyInfo.Phone,
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
var scenario = _trialSiteSurveyRepository.Where(t => t.Id != trialSiteSurveyId && t.TrialId == siteSurveyInfo.TrialId && t.TrialSiteId == siteSurveyInfo.TrialSiteId).IgnoreQueryFilters().Any() ?
EmailBusinessScenario.Approval_UpdateSiteSurvey : EmailBusinessScenario.Approval_SubmitSiteSurvey;
EmailBusinessScenario.Approval_UpdateSiteSurvey : EmailBusinessScenario.Approval_SubmitSiteSurvey;
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (emailConfig != null)
{
var trialUserList = await _trialUserRoleRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId && t.TrialUser.IsDeleted == false)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
.Select(t => new { t.UserRole.FullName, t.UserRole.IdentityUser.EMail, t.UserRole.UserTypeEnum }).ToListAsync();
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
var messageToSend = new MimeMessage();
var toUserName = string.Empty;
//有SPM
if (sPMOrCPMList.Count > 0)
{
foreach (var user in sPMOrCPMList)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', sPMOrCPMList.Select(t => t.FullName));
foreach (var user in pmAndAPMList)
{
messageToSend.Cc.Add(new MailboxAddress(user.FullName, user.EMail));
}
}
else
{
foreach (var user in pmAndAPMList)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', pmAndAPMList.Select(t => t.FullName));
}
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
siteInfo.TrialSiteCode,
siteInfo.TrialSiteAliasName,
siteSurveyInfo.UserName,
siteSurveyInfo.Email,
siteSurveyInfo.Phone,
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -143,55 +151,65 @@ public class SiteSurveySPMSubmitedEventConsumer(
var trialId = siteSurveyInfo.TrialId;
var messageToSend = new MimeMessage();
var scenario = EmailBusinessScenario.Approval_SubmitSiteSurvey;
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
var toUserName = string.Empty;
foreach (var item in pmAndAPMList)
if (emailConfig != null)
{
messageToSend.To.Add(new MailboxAddress(item.FullName, item.EMail));
var messageToSend = new MimeMessage();
toUserName = string.Join('、', pmAndAPMList.Select(t => t.FullName));
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
var toUserName = string.Empty;
foreach (var item in pmAndAPMList)
{
messageToSend.To.Add(new MailboxAddress(item.FullName, item.EMail));
toUserName = string.Join('、', pmAndAPMList.Select(t => t.FullName));
}
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
siteInfo.TrialSiteCode, //中心编号
siteInfo.TrialSiteAliasName,//中心名称
siteSurveyInfo.UserName, //联系人
siteSurveyInfo.Email, //联系邮箱
siteSurveyInfo.Phone, //联系电话
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
siteInfo.TrialSiteCode,
siteInfo.TrialSiteAliasName,
siteSurveyInfo.UserName,
siteSurveyInfo.Email,
siteSurveyInfo.Phone,
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.Approval_SubmitSiteSurvey, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
@ -204,7 +222,7 @@ public class SiteSurverRejectedEventConsumer(
IRepository<Trial> _trialRepository,
IRepository<TrialSite> _trialSiteRepository,
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig
) : IConsumer<SiteSurverRejectedEvent>
{
@ -216,83 +234,95 @@ public class SiteSurverRejectedEventConsumer(
var trialSiteSurveyId = context.Message.TrialSiteSurveyId;
var siteSurveyInfo = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).FirstOrDefault().IfNullThrowException();
var siteSurveyInfo = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId ,ignoreQueryFilters:true).FirstOrDefault().IfNullThrowException();
var trialId = siteSurveyInfo.TrialId;
var messageToSend = new MimeMessage();
var scenario = EmailBusinessScenario.SiteSurveyReject;
var toUserName = siteSurveyInfo.UserName;
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (context.Message.IsHaveSPMOrCPM)
if (emailConfig != null)
{
//PM 驳回到SPM
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
var messageToSend = new MimeMessage();
var toUserName = siteSurveyInfo.UserName;
if (context.Message.IsHaveSPMOrCPM)
{
//var user = await _userRoleRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
//name = user.FullName;
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
foreach (var user in sPMOrCPMList)
//PM 驳回到SPM
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
//var user = await _userRoleRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
//name = user.FullName;
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
foreach (var user in sPMOrCPMList)
{
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', sPMOrCPMList.Select(t => t.FullName));
}
//SPM 驳回到CRC
else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
{
messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
}
toUserName = string.Join('、', sPMOrCPMList.Select(t => t.FullName));
}
//SPM 驳回到CRC
else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
else
{
messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
//没有SPM PM驳回到CRC
messageToSend.To.Add(new MailboxAddress(String.Empty, siteSurveyInfo.Email));
}
}
else
{
//没有SPM PM驳回到CRC
messageToSend.To.Add(new MailboxAddress(String.Empty, siteSurveyInfo.Email));
}
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
trialInfo.TrialCode,
trialInfo.ResearchProgramNo,
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, companyName,trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
toUserName,
trialInfo.TrialCode,
trialInfo.ResearchProgramNo,
trialInfo.ExperimentName,
siteInfo.TrialSiteCode,
siteInfo.TrialSiteAliasName,
siteSurveyInfo.LatestBackReason,
_systemEmailConfig.SiteUrl,
(siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
);
return (topicStr, htmlBodyStr);
};
siteInfo.TrialSiteCode, //中心编号
siteInfo.TrialSiteAliasName,//中心名称
siteSurveyInfo.LatestBackReason, //驳回原因
_systemEmailConfig.SiteUrl, //链接
(siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.SiteSurveyReject, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}

View File

@ -24,13 +24,13 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
/// </summary>
public class CRCSubmitedAndQCToAuditEventConsumer(
IRepository<UserRole> _userRoleRepository,
IRepository<TrialUserRole> _trialUseRoleRepository,
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<TrialUserRole> _trialUseRoleRepository,
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<Trial> _trialRepository,
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CRCSubmitedAndQCToAuditEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -41,46 +41,55 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstOrDefaultAsync();
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var trialId = subjectVisit.TrialId;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var auditStateCode = "AuditStatePE";
if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
auditStateCode = "AuditStateRC";
}
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
var pmandAPm = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var auditStateCode = "AuditStatePE";
if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
auditStateCode = "AuditStateRC";
}
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
}
});
});
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
foreach (var userinfo in userinfoList)
{
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
}
var userNames = userinfoList.Select(x => x.FullName).ToList();
@ -111,14 +120,11 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim,
messageToSend, emailConfigFunc);
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -134,7 +140,7 @@ public class CRCRepliedQCChallengeEventConsumer(
IRepository<QCChallenge> _qCChallengeRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CRCRepliedQCChallengeEvent>
{
@ -148,74 +154,75 @@ public class CRCRepliedQCChallengeEventConsumer(
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).Include(x => x.CurrentActionUser).FirstNotNullAsync();
var trialId = subjectVisit.TrialId;
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId).Include(x => x.QCChallenge).FirstNotNullAsync();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderQCQuery : EmailBusinessScenario.EligibilityVerification_Pending;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var userinfo = subjectVisit.CurrentActionUser;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
foreach (var pm in pmandAPm)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId).Include(x => x.QCChallenge).FirstNotNullAsync();
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
var pmandAPm = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var userinfo = subjectVisit.CurrentActionUser;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
foreach (var pm in pmandAPm)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=qCChallengeDialog.QCChallenge.IsClosed.ToString().ToLower(), }, //是否关闭
}
});
});
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 是否关闭 {4}
qCChallengeDialog.TalkContent, // 质疑内容{5}
_systemEmailConfig.SiteUrl // 链接 {6}
);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 是否关闭 {4}
qCChallengeDialog.TalkContent, // 质疑内容{5}
_systemEmailConfig.SiteUrl // 链接 {6}
);
return (topicStr, htmlBodyStr);
};
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderQCQuery : EmailBusinessScenario.EligibilityVerification_Pending,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -231,7 +238,7 @@ public class QCRepliedQCChallengeEventConsumer(
IRepository<QCChallenge> _qCChallengeRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<QCRepliedQCChallengeEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -240,90 +247,100 @@ public class QCRepliedQCChallengeEventConsumer(
Console.WriteLine("发送(014015) 【 QC回复 质控质疑通知CRC】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
string talkContent = string.Empty;
var isclose = false;
if (context.Message.QCChallengeDialogId != null)
{
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId.Value).Include(x => x.QCChallenge).FirstNotNullAsync();
talkContent = qCChallengeDialog.TalkContent;
isclose = qCChallengeDialog.QCChallenge.IsClosed;
}
else if(context.Message.QCChallengeId != null)
{
var qCChallenge = await _qCChallengeRepository.Where(x => x.Id == context.Message.QCChallengeId.Value).FirstNotNullAsync();
talkContent = qCChallenge.Content;
isclose = qCChallenge.IsClosed;
}
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var trialId = subjectVisit.TrialId;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_ImageQuery : EmailBusinessScenario.EligibilityVerification_ImageQuery;
var craInfo = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.CRA).FirstOrDefault();
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
string talkContent = string.Empty;
var isclose = false;
if (context.Message.QCChallengeDialogId != null)
{
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId.Value).Include(x => x.QCChallenge).FirstNotNullAsync();
talkContent = qCChallengeDialog.TalkContent;
isclose = qCChallengeDialog.QCChallenge.IsClosed;
}
else if (context.Message.QCChallengeId != null)
{
var qCChallenge = await _qCChallengeRepository.Where(x => x.Id == context.Message.QCChallengeId.Value).FirstNotNullAsync();
talkContent = qCChallenge.Content;
isclose = qCChallenge.IsClosed;
}
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
var craInfo = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.CRA).FirstOrDefault();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=isclose.ToString().ToLower(), }, //是否关闭
}
});
});
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
if (craInfo != null)
foreach (var userinfo in userinfoList)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, craInfo.EMail));
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
if (craInfo != null)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, craInfo.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 质疑是否关闭 {4}
talkContent, // 质疑内容 {5}
_systemEmailConfig.SiteUrl // 链接 {65}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 质疑是否关闭 {4}
talkContent, // 质疑内容 {5}
_systemEmailConfig.SiteUrl // 链接 {65}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
context.Message.IsPd ? EmailBusinessScenario.PDVerification_ImageQuery : EmailBusinessScenario.EligibilityVerification_ImageQuery,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -340,7 +357,7 @@ public class CRCRepliedCheckChallengeEventConsumer(
IRepository<QCChallenge> _qCChallengeRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CRCRepliedCheckChallengeEvent>
{
@ -350,70 +367,80 @@ public class CRCRepliedCheckChallengeEventConsumer(
Console.WriteLine("发送(019,020) 【 CRC 回复一致性核查质疑 通知PM】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var trialId = subjectVisit.TrialId;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDRForPMOrAPM : EmailBusinessScenario.EligibilityVerification_UnderDRForPMOrAPM;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //审核状态
}
});
});
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
foreach (var userinfo in userinfoList)
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 核查状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDRForPMOrAPM : EmailBusinessScenario.EligibilityVerification_UnderDRForPMOrAPM,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 核查状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
}
@ -432,7 +459,7 @@ public class PMRepliedCheckChallengeEventConsumer(
IRepository<CheckChallengeDialog> _checkChallengeDialogRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<PMRepliedCheckChallengeEvent>
{
@ -441,80 +468,89 @@ public class PMRepliedCheckChallengeEventConsumer(
{
Console.WriteLine("发送(016017) 【 PM 一致性核查 通知CRC】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var checkChallengeDialog = await _checkChallengeDialogRepository.Where(x => x.Id == context.Message.CheckChallengeDialogId).FirstNotNullAsync();
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.NoneDicomStudyList).Include(x => x.StudyList).Include(x => x.Subject).FirstNotNullAsync();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var trialId = subjectVisit.TrialId;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
var craInfo = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.CRA).FirstOrDefault();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDR : EmailBusinessScenario.EligibilityVerification_UnderDR;
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
List<string> modalities = new List<string>();
modalities =subjectVisit.NoneDicomStudyList.Select(t => t.Modality)
.Union(subjectVisit.StudyList.Select(k => k.ModalityForEdit)).ToList();
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var checkChallengeDialog = await _checkChallengeDialogRepository.Where(x => x.Id == context.Message.CheckChallengeDialogId).FirstNotNullAsync();
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
var craInfo = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.CRA).FirstOrDefault();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
List<string> modalities = new List<string>();
modalities = subjectVisit.NoneDicomStudyList.Select(t => t.Modality)
.Union(subjectVisit.StudyList.Select(k => k.ModalityForEdit)).ToList();
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //核查状态
}
});
});
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
if (craInfo != null)
foreach (var userinfo in userinfoList)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, craInfo.EMail));
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
if (craInfo != null)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, craInfo.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
string.Join(',', modalities), // 检查类型 {4}
dictionValue[0], // 核查状态 {5}
checkChallengeDialog.TalkContent,// 质疑内容{6}
_systemEmailConfig.SiteUrl // 链接 {7}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
string.Join(',', modalities), // 检查类型 {4}
dictionValue[0], // 核查状态 {5}
checkChallengeDialog.TalkContent,// 质疑内容{6}
_systemEmailConfig.SiteUrl // 链接 {7}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDR : EmailBusinessScenario.EligibilityVerification_UnderDR,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
@ -531,7 +567,7 @@ public class CheckStateChangedToAuditEventConsumer(
IRepository<QCChallenge> _qCChallengeRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CheckStateChangedToAuditEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -540,70 +576,80 @@ public class CheckStateChangedToAuditEventConsumer(
Console.WriteLine("发送(018,030) 【通知PM 进行一致性核查】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var trialId = subjectVisit.TrialId;
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_DR : EmailBusinessScenario.EligibilityVerification_DR;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var userinfoList = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //审核状态
}
});
});
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
foreach (var userinfo in userinfoList)
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 姓名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 核查状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
context.Message.IsPd ? EmailBusinessScenario.PDVerification_DR : EmailBusinessScenario.EligibilityVerification_DR,
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 姓名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 核查状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}
}
@ -619,7 +665,7 @@ public class QCClaimTaskEventConsumer(
IRepository<QCChallenge> _qCChallengeRepository,
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<QCClaimTaskEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -628,87 +674,90 @@ public class QCClaimTaskEventConsumer(
Console.WriteLine("发送(Code007008) 【QC 领取了质控任务】邮件!!!");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).Include(x => x.CurrentActionUser).FirstNotNullAsync();
var trialId = subjectVisit.TrialId;
var subjectVisitList = await _subjectVisitRepository.Where(x => x.CurrentActionUserId == context.Message.CurrentActionUserId && x.TrialId == subjectVisit.TrialId).Include(x => x.Subject).ToListAsync();
var scenario = context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQC : EmailBusinessScenario.EligibilityVerification_PendingImageQC;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var userinfo = subjectVisit.CurrentActionUser;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
foreach (var pm in pmandAPm)
if (trialEmailConfig != null)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var auditStateCode = "AuditStatePE";
if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
auditStateCode = "AuditStateRC";
}
var subjectVisitList = await _subjectVisitRepository.Where(x => x.CurrentActionUserId == context.Message.CurrentActionUserId && x.TrialId == subjectVisit.TrialId).Include(x => x.Subject).ToListAsync();
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var trialUserList = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.TrialUser.IsDeleted == false).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
var pmandAPm = trialUserList.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var userinfo = subjectVisit.CurrentActionUser;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
foreach (var pm in pmandAPm)
{
messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail));
}
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
var auditStateCode = "AuditStatePE";
if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
auditStateCode = "AuditStateRC";
}
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
}
});
});
var subjectcodes = subjectVisitList.Select(x => x.Subject.Code).Distinct().ToList();
var visitnames = subjectVisitList.Select(x => x.VisitName).Distinct().ToList();
var subjectcodes = subjectVisitList.Select(x => x.Subject.Code).Distinct().ToList();
var visitnames = subjectVisitList.Select(x => x.VisitName).Distinct().ToList();
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
string.Join(',', subjectcodes), // 受试者 {2}
string.Join(',', visitnames), // 访视 {3}
dictionValue[0], // 审核状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
string.Join(',', subjectcodes), // 受试者 {2}
string.Join(',', visitnames), // 访视 {3}
dictionValue[0], // 审核状态 {4}
return (topicStr, htmlBodyStr);
};
_systemEmailConfig.SiteUrl // 链接 {5}
);
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
return (topicStr, htmlBodyStr);
};
context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQC : EmailBusinessScenario.EligibilityVerification_PendingImageQC,
messageToSend, emailConfigFunc);
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}

View File

@ -1,4 +1,5 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
@ -27,7 +28,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
IRepository<VisitTask> _visitTaskRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<TrialUserRole> _trialUserRoleRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentIRUnReadTaskRecurringEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@ -35,144 +36,151 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
public async Task Consume(ConsumeContext<UrgentIRUnReadTaskRecurringEvent> context)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var trialId = context.Message.TrialId;
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
var scenario = EmailBusinessScenario.ExpeditedReading;
var trialEmailConfig = _trialEmailNoticeConfigrepository.Where(t => t.TrialId == trialId && t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (trialEmailConfig != null)
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue="true" }
}
});
});
//找到该项目所有的IR 并且有加急 和Pd 未读的任务
//找到该项目所有的IR 并且有加急 和Pd 未读的任务
Expression<Func<VisitTask, bool>> comonTaskFilter = t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskAllocationState == TaskAllocationState.Allocated;
Expression<Func<VisitTask, bool>> comonTaskFilter = t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskAllocationState == TaskAllocationState.Allocated;
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.JoinTime != null).Select(t => new
{
t.UserId,
t.UserRole.FullName,
t.UserRole.IdentityUser.EMail,
t.UserRole.IdentityUser.UserName,
t.Trial.TrialCode,
t.Trial.ResearchProgramNo
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
});
foreach (var trialUser in trialUserList)
{
var userId = trialUser.UserId;
var doctorCriterionList = await _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.TrialId == trialId && t.Trial.TrialUserRoleList.Any(t => t.UserId == userId))
.Select(c => new
{
TrialReadingCriterionId = c.Id,
CriterionName = c.CriterionName,
UnReadList = c.VisitTaskList.Where(t => t.ExpetidEmailNoticeTime == null) //没有被通知
.Where(t => t.DoctorUserId == userId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
.Where(t => t.SourceSubjectVisit.PDState == PDStateEnum.PDProgress || t.SourceSubjectVisit.IsEnrollmentConfirm ||
t.ReadModule.SubjectVisit.PDState == PDStateEnum.PDProgress || t.ReadModule.SubjectVisit.IsEnrollmentConfirm)
.Select(c => new
{
SubejctCode = c.IsAnalysisCreate ? c.BlindSubjectCode : c.Subject.Code,
c.TaskBlindName,
c.TaskName,
VisitTaskId = c.Id
}).ToList()
}).ToListAsync();
var toTalUnreadCount = doctorCriterionList.SelectMany(t => t.UnReadList).Count();
if (toTalUnreadCount > 0)
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.JoinTime != null).Select(t => new
{
var messageToSend = new MimeMessage();
t.UserId,
t.UserRole.FullName,
t.UserRole.IdentityUser.EMail,
t.UserRole.IdentityUser.UserName,
t.Trial.TrialCode,
t.Trial.ResearchProgramNo
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
});
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(trialUser.FullName, trialUser.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
foreach (var trialUser in trialUserList)
{
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
var userId = trialUser.UserId;
var doctorCriterionList = await _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.TrialId == trialId && t.Trial.TrialUserRoleList.Any(t => t.UserId == userId))
.Select(c => new
{
TrialReadingCriterionId = c.Id,
CriterionName = c.CriterionName,
UnReadList = c.VisitTaskList.Where(t => t.ExpetidEmailNoticeTime == null) //没有被通知
.Where(t => t.DoctorUserId == userId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
.Where(t => t.SourceSubjectVisit.PDState == PDStateEnum.PDProgress || t.SourceSubjectVisit.IsEnrollmentConfirm ||
t.ReadModule.SubjectVisit.PDState == PDStateEnum.PDProgress || t.ReadModule.SubjectVisit.IsEnrollmentConfirm)
.Select(c => new
{
SubejctCode = c.IsAnalysisCreate ? c.BlindSubjectCode : c.Subject.Code,
c.TaskBlindName,
c.TaskName,
VisitTaskId = c.Id
}).ToList()
}).ToListAsync();
var toTalUnreadCount = doctorCriterionList.SelectMany(t => t.UnReadList).Count();
if (toTalUnreadCount > 0)
{
var topicStr = string.Format(input.topicStr, trialUser.ResearchProgramNo);
var messageToSend = new MimeMessage();
var template = input.htmlBodyStr;
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(trialUser.FullName, trialUser.EMail));
//正则提取循环的部分 {%for%}(.*?){%end for%}
string pattern = @"{%for%}(.*?){%end for%}";
var match = Regex.Match(template, pattern, RegexOptions.Singleline);
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
string criteriaTemplate = match.Groups[1].Value; // 提取循环模板
// 构建循环内容
string criteriaDetails = "";
foreach (var criteria in doctorCriterionList)
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
if (criteria.UnReadList.Count() > 0)
var topicStr = string.Format(input.topicStr, trialUser.ResearchProgramNo);
var template = input.htmlBodyStr;
//正则提取循环的部分 {%for%}(.*?){%end for%}
string pattern = @"{%for%}(.*?){%end for%}";
var match = Regex.Match(template, pattern, RegexOptions.Singleline);
string criteriaTemplate = match.Groups[1].Value; // 提取循环模板
// 构建循环内容
string criteriaDetails = "";
foreach (var criteria in doctorCriterionList)
{
criteriaDetails += string.Format(criteriaTemplate, criteria.CriterionName, criteria.UnReadList.Select(t => t.SubejctCode).Distinct().Count(), criteria.UnReadList.Count());
if (criteria.UnReadList.Count() > 0)
{
criteriaDetails += string.Format(criteriaTemplate, criteria.CriterionName, criteria.UnReadList.Select(t => t.SubejctCode).Distinct().Count(), criteria.UnReadList.Count());
}
}
}
// 用循环内容替换原始模板中的循环部分
string emailContent = template.Replace(criteriaTemplate, criteriaDetails).Replace("{%for%}", "").Replace("{%end for%}", "");
// 用循环内容替换原始模板中的循环部分
string emailContent = template.Replace(criteriaTemplate, criteriaDetails).Replace("{%for%}", "").Replace("{%end for%}", "");
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, emailContent),
trialUser.FullName,
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, emailContent),
trialUser.FullName,
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
toTalUnreadCount,
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
toTalUnreadCount,
trialUser.ResearchProgramNo,
dictionValue[0],
_systemEmailConfig.SiteUrl
);
trialUser.ResearchProgramNo,
dictionValue[0],
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.ExpeditedReading, messageToSend, emailConfigFunc);
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
//处理标记已通知的任务
//处理标记已通知的任务
var visitTaskIdList = doctorCriterionList.Where(t => t.UnReadList.Count() > 0).SelectMany(t => t.UnReadList.Select(u => u.VisitTaskId)).ToList();
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdList.Contains(t.Id), u => new VisitTask() { ExpetidEmailNoticeTime = DateTime.Now });
}
var visitTaskIdList = doctorCriterionList.Where(t => t.UnReadList.Count() > 0).SelectMany(t => t.UnReadList.Select(u => u.VisitTaskId)).ToList();
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdList.Contains(t.Id), u => new VisitTask() { ExpetidEmailNoticeTime = DateTime.Now });
}
}
}
}
}

View File

@ -37,4 +37,18 @@ public class UrgentIRUnReadTaskRecurringEvent : DomainEvent
public Guid TrialId { get; set; }
}
/// <summary>
/// 定时提醒
/// </summary>
public class SystemDocumentErverDayEvent : DomainEvent
{
}
public class SystemDocumentPublishEvent : DomainEvent
{
public List<Guid> Ids { get; set; }
}

View File

@ -0,0 +1,237 @@
using DocumentFormat.OpenXml;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Consumer;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Models;
using MassTransit;
using Microsoft.Extensions.Options;
using MimeKit;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reactive.Joins;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.MassTransit.Recurring
{
/// <summary>
/// 定时过期提醒
/// </summary>
public class SystemDocumentErverDayEventConsumer(
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<SystemDocument> _systemDocumentRepository,
IRepository<IdentityUser> _identityUserRepository,
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<TrialUserRole> _trialUserRoleRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<SystemDocumentErverDayEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
public async Task Consume(ConsumeContext<SystemDocumentErverDayEvent> context)
{
DateTime now = DateTime.Now;
Console.WriteLine("发送定时过期提醒");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
join confirmc in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirmc.ConfirmUserId, confirmc.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
select new UnionDocumentWithConfirmInfoView()
{
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
Name = sysDoc.Name,
Path = sysDoc.Path,
FileTypeId = sysDoc.FileTypeId,
UpdateTime = sysDoc.UpdateTime,
ConfirmUserId = identityUser.Id,
ConfirmTime = confirm.ConfirmTime,
UserCreateTime = identityUser.CreateTime,
CurrentStaffTrainDays = sysDoc.CurrentStaffTrainDays,
NewStaffTrainDays = sysDoc.NewStaffTrainDays,
RealName = identityUser.FullName,
UserName = identityUser.UserName,
IsNeedSendEmial = identityUser.IsZhiZhun || (!identityUser.IsZhiZhun && sysDoc.DocUserSignType == DocUserSignType.InnerAndOuter),
FullFilePath = sysDoc.Path
};
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted == false && t.ConfirmTime == null)
.ToListAsync();
datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
.Where(x => x.IsNeedSendEmial).ToList();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
Console.WriteLine("发送定时过期提醒:人员数量" + userinfoList.Count);
int index = 1;
foreach (var userinfo in userinfoList)
{
try
{
Console.WriteLine($"{index}发送定时过期提醒,邮箱:{userinfo.EMail},姓名{userinfo.UserName}");
index++;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, companyName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.UserName // 用户名 {0}
);
return (topicStr, htmlBodyStr);
};
var scenario = EmailBusinessScenario.GeneralTraining_ExpirationNotification;
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (emailConfig != null)
{
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
catch (Exception)
{
}
}
}
}
/// <summary>
/// 生效通知
/// </summary>
public class SystemDocumentPublishEventConsumer(
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
IRepository<VisitTask> _visitTaskRepository,
IRepository<SystemDocument> _systemDocumentRepository,
IRepository<IdentityUser> _identityUserRepository,
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<TrialUserRole> _trialUserRoleRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<SystemDocumentPublishEvent>
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
public async Task Consume(ConsumeContext<SystemDocumentPublishEvent> context)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
select new UnionDocumentWithConfirmInfoView()
{
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
Name = sysDoc.Name,
Path = sysDoc.Path,
FileTypeId = sysDoc.FileTypeId,
UpdateTime = sysDoc.UpdateTime,
ConfirmUserId = identityUser.Id,
RealName = identityUser.FullName,
UserName = identityUser.UserName,
IsNeedSendEmial = identityUser.IsZhiZhun || (!identityUser.IsZhiZhun && sysDoc.DocUserSignType == DocUserSignType.InnerAndOuter),
FullFilePath = sysDoc.Path
};
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(x => x.IsNeedSendEmial).ToListAsync();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
int index = 1;
foreach (var userinfo in userinfoList)
{
string msg = $"{index}生效通知,邮箱:{userinfo.EMail},姓名{userinfo.UserName},";
index++;
try
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var topicStr = string.Format(input.topicStr, companyName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.UserName // 用户名 {0}
);
return (topicStr, htmlBodyStr);
};
var scenario = EmailBusinessScenario.GeneralTraining_EffectiveNotification;
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (emailConfig != null)
{
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
msg += "发送成功";
}
}
catch (Exception)
{
msg += "发送失败";
}
Console.WriteLine(msg);
}
}
}
}

View File

@ -2203,6 +2203,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
{
item.Id = Guid.Empty;
item.VisitTaskId = newTask.Id;
item.MeasureData = item.MeasureData.Replace(origenalTask.Id.ToString(), newTask.Id.ToString());
}
_ = _readingCustomTagRepository.AddRangeAsync(readingCustomTagList).Result;
@ -2216,6 +2217,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
{
item.Id = Guid.Empty;
item.VisitTaskId = newTask.Id;
}
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskQuestionAnswerList).Result;
@ -2227,6 +2229,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
item.Id = Guid.Empty;
item.FristAddTaskId = item.VisitTaskId == item.FristAddTaskId ? newTask.Id : item.FristAddTaskId;
item.VisitTaskId = newTask.Id;
item.MeasureData = item.MeasureData.Replace(origenalTask.Id.ToString(), newTask.Id.ToString());
}
@ -2253,6 +2257,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
//默认值是当前任务添加的
item.FristAddTaskId = originalVisitTaskId == originalFristAddTaskId ? newTask.Id : item.FristAddTaskId;
item.MeasureData = item.MeasureData.Replace(origenalTask.Id.ToString(), newTask.Id.ToString());
foreach (var item2 in item.LesionAnswerList)
{

View File

@ -96,6 +96,8 @@ namespace IRaCIS.Core.Application.ViewModel
public int State { get; set; }
public Guid? PublishLogId { get; set; }
public List<BatchAddInternationalizationDto> AddList { get; set; }
}

View File

@ -4,8 +4,10 @@
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions;
using System.Text.RegularExpressions;
namespace IRaCIS.Core.Application.Contracts
@ -44,12 +46,20 @@ namespace IRaCIS.Core.Application.Contracts
{
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
{
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum== addOrEditEmailNoticeConfig.CriterionTypeEnum,
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum == addOrEditEmailNoticeConfig.CriterionTypeEnum,
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
};
var verifyExp2 = new EntityVerifyExp<EmailNoticeConfig>()
{
VerifyExp = t => t.Code == addOrEditEmailNoticeConfig.Code && t.IsDistinguishCriteria == addOrEditEmailNoticeConfig.IsDistinguishCriteria && t.SystemLevel == addOrEditEmailNoticeConfig.SystemLevel,
VerifyMsg = _localizer["EmailNoticeConfig_RepeatCode"]
};
// 匹配所有占位符的正则表达式,允许包含空格的占位符
var regex = new Regex(@"\{\s*\d+\s*\}");
@ -61,10 +71,14 @@ namespace IRaCIS.Core.Application.Contracts
}
var entity = new EmailNoticeConfig() { };
if (addOrEditEmailNoticeConfig.Id == null)
{
var entity = _mapper.Map<EmailNoticeConfig>(addOrEditEmailNoticeConfig);
entity = _mapper.Map<EmailNoticeConfig>(addOrEditEmailNoticeConfig);
foreach (var item in addOrEditEmailNoticeConfig.ToUserTypeList)
@ -80,9 +94,9 @@ namespace IRaCIS.Core.Application.Contracts
}
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1);
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1, verifyExp2);
return ResponseOutput.Ok(entity.Id.ToString());
}
else
{
@ -103,14 +117,32 @@ namespace IRaCIS.Core.Application.Contracts
}
var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1);
entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1, verifyExp2);
return ResponseOutput.Ok(entity.Id.ToString());
}
if (entity.EmailCron != string.Empty)
{
var jobId = $"{entity.Id}_({entity.BusinessScenarioEnum})";
//有的job 可能编辑控制直接不发,需要移除已存在的
HangfireJobHelper.RemoveCronJob(jobId);
if (entity.IsAutoSend && entity.IsEnable)
{
HangfireJobHelper.AddOrUpdateSystemCronJob(jobId, entity.BusinessScenarioEnum, entity.EmailCron);
}
}
return ResponseOutput.Ok(entity.Id.ToString());
}

View File

@ -350,6 +350,114 @@ namespace IRaCIS.Core.Application.Service.Common
#region 导表查询
///getSysDocumentConfirmList 系统文档培训查询
///
[HttpPost]
public async Task<IActionResult> GetSysDocumentConfirmList_Export(SystemDocQuery inQuery,
[FromServices] IRepository<SystemDocument> _systemDocumentRepository,
[FromServices] IRepository<IdentityUser> _identityUserRepository,
[FromServices] IDictionaryService _dictionaryService)
{
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
select new TrainingRecordExportDTO()
{
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
Name = sysDoc.Name,
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
FileTypeId = sysDoc.FileTypeId,
//IsConfirmed = confirm.ConfirmTime != null,
ConfirmUserId = identityUser.Id,
ConfirmTime = confirm.ConfirmTime,
RealName = identityUser.FullName,
UserName = identityUser.UserName,
//UpdateTime = sysDoc.UpdateTime,
//SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
//UserTypeId = trialUser.UserRole.UserTypeId,
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
//Path = sysDoc.Path,
//FullFilePath = sysDoc.Path
};
var unionQuery = systemDocQuery.IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
.WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value)
.WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value)
.WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime)
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted);
var list = await unionQuery.SortToListAsync(inQuery);
#region 处理文档 需要签署的角色类型 和每个人的角色信息
var trialDocIdList = list.Where(t => t.IsSystemDoc == false).Select(t => t.Id).ToList();
var sysDocIdList = list.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
var identityUserIdList = list.Select(t => t.ConfirmUserId).Distinct().ToList();
var sysDocUserTypeList = _systemDocNeedConfirmedUserTypeRepository.Where(t => sysDocIdList.Contains(t.SystemDocumentId)).Select(t => new { t.SystemDocumentId, t.UserTypeRole.UserTypeShortName }).ToList();
var identityUserUserTypeList = _identityUserRepository.Where(t => identityUserIdList.Contains(t.Id)).IgnoreQueryFilters().Select(t => new { IdentityUserId = t.Id, UserTypeList = t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Select(c => c.UserTypeRole.UserTypeShortName).ToList() });
//Concat 不能用导航属性
var sysids = list.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
//var sysDataList = await _systemDocumentRepository.Where(x => sysids.Contains(x.Id)).Include(x => x.SystemDocumentAttachmentList).ToListAsync();
foreach (var item in list)
{
//if (sysDataList.Any(y => y.Id == item.Id))
//{
// item.AttachmentCount = sysDataList.Where(y => y.Id == item.Id).Select(x => x.SystemDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault();
//}
if (item.IsSystemDoc)
{
item.DocNeedSignUserTypeList = sysDocUserTypeList.Where(t => t.SystemDocumentId == item.Id).Select(t => t.UserTypeShortName).ToList();
}
item.IdentityUserTypeList = identityUserUserTypeList.Where(t => t.IdentityUserId == item.ConfirmUserId).SelectMany(c => c.UserTypeList).ToList();
}
#endregion
var exportInfo = new ExcelExportInfo();
exportInfo.List = list;
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
return await ExcelExportHelper.DataExportAsync(StaticData.Export.CommonTrainingRecordList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrainingRecordExportDTO));
}
/// <summary>
/// getDocumentConfirmList 培训记录导出--new
/// </summary>
@ -1550,8 +1658,8 @@ namespace IRaCIS.Core.Application.Service.Common
{
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
//.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
//.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
//.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)

View File

@ -143,6 +143,7 @@ namespace IRaCIS.Core.Application.Service
mapItem.InternationalizationType = batchAdd.InternationalizationType;
mapItem.State = batchAdd.State;
mapItem.PublishLogId = batchAdd.PublishLogId;
var verifyExp1 = new EntityVerifyExp<Internationalization>()
{

View File

@ -1,4 +1,5 @@
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
using DocumentFormat.OpenXml.Spreadsheet;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Helper;
@ -231,9 +232,9 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<(DoctorSummarize,bool)> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
public async Task<(DoctorSummarize, bool)> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
{
if (inDto.TrialId != null&&inDto.Id==null)
if (inDto.TrialId != null && inDto.Id == null)
{
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
if (systemCount == 0)
@ -242,7 +243,7 @@ namespace IRaCIS.Core.Application.Service
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
inDto.IndicationEn = dictionery.Value;
inDto.Indication = dictionery.ValueCN;
var system= inDto.Clone();
var system = inDto.Clone();
system.TrialId = null;
system.IsMain = true;
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
@ -255,7 +256,7 @@ namespace IRaCIS.Core.Application.Service
if (systemCount == 0)
{
inDto.IsMain = true;
}
if (inDto.Indication.IsNullOrEmpty() && inDto.IndicationEn.IsNullOrEmpty())
{
@ -263,19 +264,19 @@ namespace IRaCIS.Core.Application.Service
inDto.IndicationEn = "Default";
}
var exists = await _doctorSummarizeRepository
.Where(x=> x.IndicationEn!=string.Empty && x.Indication!=string.Empty)
.Where( x => x.IndicationEn == inDto.IndicationEn|| x.Indication == inDto.Indication)
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null&&x.Id!=inDto.Id);
.Where(x => x.IndicationEn != string.Empty && x.Indication != string.Empty)
.Where(x => x.IndicationEn == inDto.IndicationEn || x.Indication == inDto.Indication)
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null && x.Id != inDto.Id);
if (exists)
{
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
}
}
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType != SaveSummarizeInfo.SaveSelf)
{
switch (inDto.SaveSummarizeInfoType)
{
@ -313,16 +314,16 @@ namespace IRaCIS.Core.Application.Service
if (inDto.TrialId == null && inDto.IsMain)
{
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
x => new DoctorSummarize()
{
IsMain = false
});
{
IsMain = false
});
}
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
return (entity,true);
return (entity, true);
}
/// <summary>
@ -333,7 +334,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<bool> DeleteSummarizeInfo(DeleteSummarizeInfoInDto inDto)
{
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x=>x.Id==inDto.Id);
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x => x.Id == inDto.Id);
return await _doctorSummarizeRepository.SaveChangesAsync();
}
@ -345,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
{
if (inDto.TrialId != null)
{
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
@ -357,8 +358,9 @@ namespace IRaCIS.Core.Application.Service
}
var result = await _doctorSummarizeRepository.Where(t => t.DoctorId == inDto.DoctorId && t.TrialId == inDto.TrialId)
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
return new UpdateGneralSituationDto() {
SummarizeList= result
return new UpdateGneralSituationDto()
{
SummarizeList = result
};
}
@ -378,30 +380,36 @@ namespace IRaCIS.Core.Application.Service
messageToSend.To.Add(new MailboxAddress(String.Empty, item));
}
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
;
var topicStr = string.Format(input.topicStr,string.Empty);
;
var topicStr = string.Format(input.topicStr, string.Empty);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
_systemEmailConfig.SiteUrl.Replace("login",string.Empty)+inDto.Url
_systemEmailConfig.SiteUrl.Replace("login", string.Empty) + inDto.Url
);
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
EmailBusinessScenario.Reviewer_CV_Collection,
var scenario = EmailBusinessScenario.Reviewer_CV_Collection;
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
if (emailConfig != null)
{
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
return true;
}
@ -491,7 +499,7 @@ namespace IRaCIS.Core.Application.Service
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == doctorId)
.ProjectTo<DoctorBasicInfoDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
doctorBasicInfo.IsHaveAccount =await _userRoleRepository.AnyAsync(x => x.DoctorId == doctorId);
doctorBasicInfo.IsHaveAccount = await _userRoleRepository.AnyAsync(x => x.DoctorId == doctorId);
return doctorBasicInfo;

View File

@ -0,0 +1,585 @@
//--------------------------------------------------------------------
// 此代码由liquid模板自动生成 byzhouhang 20240909
// 生成时间 2025-03-27 06:13:33Z
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure.Extention;
using System.Threading.Tasks;
using IRaCIS.Core.Infra.EFCore;
using AutoMapper.Execution;
using System.Linq;
using IRaCIS.Core.Infrastructure;
using DocumentFormat.OpenXml.Office2010.Excel;
using MassTransit;
using NPOI.POIFS.Properties;
using Org.BouncyCastle.Crypto;
using Microsoft.AspNetCore.Http;
namespace IRaCIS.Core.Application.Service;
/// <summary>
/// 稽查文档
/// </summary>
/// <returns></returns>
[ApiExplorerSettings(GroupName = "FileRecord")]
public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService
{
/// <summary>
/// 获取稽查文档
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<AuditDocumentView>> GetAuditDocumentList(AuditDocumentQuery inQuery)
{
var auditDocumentQueryable = _auditDocumentRepository
.ProjectTo<AuditDocumentView>(_mapper.ConfigurationProvider);
var pageList = await auditDocumentQueryable.ToPagedListAsync(inQuery);
return pageList;
}
/// <summary>
/// 修改稽查文档
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> UpdateAuditDocument(AuditDocumentUpdateDto inDto)
{
AuditDocumentAddOrEdit addOrEdit = _mapper.Map<AuditDocumentAddOrEdit>(inDto);
addOrEdit.IsUpdate = true;
var result= await AddOrUpdateAuditDocument(addOrEdit);
return ResponseOutput.Ok(result.Id);
}
/// <summary>
/// 新增文件夹
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
[HttpPost]
public async Task<IResponseOutput> AddFolder(AuditDocumentAddOrEdit inDto)
{
if (await _auditDocumentRepository.AnyAsync(x => x.Name == inDto.Name && x.AuditDocumentTypeEnum == inDto.AuditDocumentTypeEnum && x.ParentId == inDto.ParentId))
{
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotAddFolder"]);
}
List<AuditDocumentAddOrEdit> auditDocumentAddOrEdits = new List<AuditDocumentAddOrEdit>();
auditDocumentAddOrEdits.Add(inDto);
var result= await AddAuditDocument(auditDocumentAddOrEdits);
return ResponseOutput.Ok(result);
}
/// <summary>
/// 新增稽查文档
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> AddAuditDocument(List<AuditDocumentAddOrEdit> inDto)
{
List<Guid> resultData = new List<Guid>();
inDto.ForEach(x => x.IsUpdate = false);
await addData(inDto);
async Task addData(List<AuditDocumentAddOrEdit> data)
{
foreach(var item in data)
{
var result= await AddOrUpdateAuditDocument(item);
resultData.Add(result.Id);
item.Children.ForEach(x => {
x.ParentId = result.Id;
x.IsUpdate = false;
});
if (item.Children.Count() > 0)
{
await addData(item.Children);
}
}
}
return ResponseOutput.Ok(resultData);
}
/// <summary>
/// 通用方法
/// </summary>
/// <param name="inDto"></param>
private async Task<AuditDocument> AddOrUpdateAuditDocument(AuditDocumentAddOrEdit inDto)
{
var alikeData = await _auditDocumentRepository.Where(x =>x.Id!=inDto.Id&& x.ParentId == inDto.ParentId&&x.Name==inDto.Name&&x.AuditDocumentTypeEnum==inDto.AuditDocumentTypeEnum).FirstOrDefaultAsync();
if (alikeData != null)
{
if (inDto.AuditDocumentTypeEnum == AuditDocumentType.Folder)
{
if (inDto.IsUpdate)
{
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotAddFolder"]);
}
else
{
return alikeData;
}
}
else
{
var entityData = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true);
var historicalVersionIds = await _auditDocumentRepository.Where(x => x.MainFileId == alikeData.Id).OrderBy(x => x.Version).Select(x => x.Id).ToListAsync();
historicalVersionIds.Add(alikeData.Id);
int num = 1;
foreach (var item in historicalVersionIds)
{
await _auditDocumentRepository.UpdatePartialFromQueryAsync(item, x => new AuditDocument()
{
MainFileId = entityData.Id,
ParentId = null,
Version = num,
AuditDocumentTypeEnum = AuditDocumentType.HistoricalVersion
},true);
num++;
}
return entityData;
}
}
var entity = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true);
return entity;
}
/// <summary>
/// 获取面包屑导航
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<AuditDocumentUpdateDto>> GetBreadcrumbData(GetBreadcrumbDataInDto inDto)
{
List<AuditDocumentUpdateDto> result=new List<AuditDocumentUpdateDto>();
await findParent(result, inDto.Id);
async Task findParent(List<AuditDocumentUpdateDto> datas, Guid id)
{
var data= await _auditDocumentRepository.Where(x => x.Id == id).ProjectTo<AuditDocumentUpdateDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
datas.Add(data);
if (data.ParentId != null)
{
await findParent(datas, data.ParentId.Value);
}
}
result.Reverse();
return result;
}
/// <summary>
/// 获取文件树形结构 (传Id 根节点就是自己)
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<AuditDocumentData>> GetAuditDocumentData(GetAuditDocumentDataInDto inDto)
{
var defalutSortArray = new string[] { nameof(AuditDocumentData.AuditDocumentTypeEnum), nameof(AuditDocumentData.Name) };
if (inDto.SortField.IsNotNullOrEmpty())
{
defalutSortArray = new string[] { nameof(AuditDocumentData.AuditDocumentTypeEnum), inDto.SortField + (inDto.Asc ? " asc" : " desc") };
inDto.SortField = string.Empty;
}
// 新取出来排序 然后再找子项
var data= (await _auditDocumentRepository
.Where(x=>x.AuditDocumentTypeEnum!=AuditDocumentType.HistoricalVersion)
.WhereIf(inDto.IsAuthorization!=null,x=>x.IsAuthorization==inDto.IsAuthorization)
.ProjectTo<AuditDocumentData>(_mapper.ConfigurationProvider).ToPagedListAsync(new PageInput() {
PageIndex=1,
PageSize=999999,
}, defalutSortArray) ).CurrentPageData.ToList();
if (inDto.Name.IsNotNullOrEmpty())
{
List<Guid> findIds = new List<Guid>();
var findData = data.Where(x => x.Name.Contains(inDto.Name)).Select(x => x.Id.Value).ToList();
GetParentId(findIds, findData, data);
findIds.AddRange(findData);
data = data.Where(x => findIds.Distinct().Contains(x.Id.Value)).ToList();
}
var query = data
.WhereIf(inDto.SelfId != null, x => inDto.SelfId == x.Id)
.WhereIf(inDto.Id != null, x => inDto.Id == x.ParentId)
.WhereIf(inDto.Id == null&& inDto.SelfId == null, x => x.ParentId == null);
PageOutput<AuditDocumentData> result = new PageOutput<AuditDocumentData>()
{
PageIndex = inDto.PageIndex,
PageSize = inDto.PageSize,
TotalCount = query.Count(),
};
var root = query
.Skip(inDto.PageSize * (inDto.PageIndex - 1)).Take(inDto.PageSize).ToList();
var historicalVersionList = await _auditDocumentRepository
.Where(x => x.AuditDocumentTypeEnum == AuditDocumentType.HistoricalVersion).ProjectTo<AuditDocumentData>(_mapper.ConfigurationProvider).ToListAsync();
foreach (var item in root)
{
GetChildren(item, data, historicalVersionList);
}
result.CurrentPageData = root;
return result;
}
private void GetParentId(List<Guid> parentIds, List<Guid> ids, List<AuditDocumentData> dataList)
{
var parentid = dataList.Where(x => ids.Contains(x.Id.Value) && x.ParentId != null).Select(x => x.ParentId.Value).ToList();
if (parentid.Count() > 0)
{
parentIds.AddRange(parentid);
GetParentId(parentIds, parentid, dataList);
}
}
private void GetChildren(AuditDocumentData item, List<AuditDocumentData> dataList, List<AuditDocumentData> historyList)
{
item.Children = dataList.Where(x => x.ParentId == item.Id).ToList();
item.HistoricalVersionsCount= historyList.Where(x => x.MainFileId == item.Id).Count();
foreach (var x in item.Children)
{
GetChildren(x, dataList, historyList);
}
}
/// <summary>
/// 删除稽查文档
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> DeleteAuditDocument(DeleteAuditDocumentInDto inDto)
{
var data = await _auditDocumentRepository.Select(x => new DeleteAudit (){
Id=x.Id,
ParentId= x.ParentId,
MainFileId= x.MainFileId
}).ToListAsync();
List<Guid> DeleteId= inDto.Ids;
finId(inDto.Ids, data);
void finId(List<Guid> deletids, List<DeleteAudit> deletes)
{
DeleteId.AddRange(deletids);
var temp = deletes.Where(x =>(x.ParentId!=null&& deletids.Contains(x.ParentId.Value))||(x.MainFileId!=null&& deletids.Contains(x.MainFileId.Value))).Select(x => x.Id).ToList();
if (temp.Count() > 0)
{
finId(temp, deletes);
}
}
DeleteId = DeleteId.Distinct().ToList();
var mainFileId=await _auditDocumentRepository.Where(x => DeleteId.Contains(x.Id)&&x.MainFileId!=null).Select(x => x.MainFileId).Distinct().ToListAsync();
var success = await _auditDocumentRepository.DeleteFromQueryAsync(t => DeleteId.Distinct().Contains(t.Id), true);
foreach (var item in mainFileId)
{
var historicalVersionList = await _auditDocumentRepository.Where(x => x.MainFileId == item).OrderBy(x=>x.Version).ToListAsync();
var num = 1;
foreach (var historical in historicalVersionList)
{
await _auditDocumentRepository.UpdatePartialFromQueryAsync(historical.Id, x => new AuditDocument()
{
Version = num,
}, true);
num++;
}
}
return ResponseOutput.Ok();
}
/// <summary>
/// 移动文件或者文件夹 到其他文件夹
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> MovieFileOrFolder(MovieFileOrFolderInDto inDto)
{
var data = await _auditDocumentRepository.Select(x => new DeleteAudit()
{
Id = x.Id,
ParentId = x.ParentId,
AuditDocumentTypeEnum = x.AuditDocumentTypeEnum,
MainFileId = x.MainFileId
}).ToListAsync();
foreach (var id in inDto.Ids)
{
var file = data.Where(x => x.Id == id).FirstOrDefault();
if (file.AuditDocumentTypeEnum == AuditDocumentType.Folder)
{
if (finChild(new List<Guid> { id }, inDto.ParentId, data))
{
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotMove"]);
}
}
}
bool finChild(List<Guid> ids, Guid ChildId, List<DeleteAudit> data)
{
var child = data.Where(x => x.ParentId != null && ids.Contains(x.ParentId.Value)).ToList();
if (child.Count() == 0)
{
return false;
}
else if (child.Any(x => x.Id == ChildId))
{
return true;
}
else
{
var newids = child.Select(x => x.Id).ToList();
return finChild(newids, ChildId, data);
}
}
foreach (var id in inDto.Ids)
{
await _auditDocumentRepository.UpdatePartialFromQueryAsync(id, x => new AuditDocument()
{
ParentId = inDto.ParentId
});
await _auditDocumentRepository.SaveChangesAsync();
}
return ResponseOutput.Ok();
}
/// <summary>
/// 复制文件或者文件夹
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> CopyFileOrFolder(MovieFileOrFolderInDto inDto)
{
foreach (var item in inDto.Ids)
{
var data = (await GetAuditDocumentData(new GetAuditDocumentDataInDto()
{
SelfId =item,
PageIndex=1,
PageSize= 1000
})).CurrentPageData;
List<AuditDocumentAddOrEdit> auditDocumentAddOrEdits = _mapper.Map<List<AuditDocumentAddOrEdit>>(data);
auditDocumentAddOrEdits.ForEach(x => {
x.IsUpdate = false;
x.Id = null;
x.ParentId = inDto.ParentId;
});
await addData(auditDocumentAddOrEdits);
}
async Task addData(List<AuditDocumentAddOrEdit> data)
{
foreach (var item in data)
{
item.Id = null;
var result = await AddOrUpdateAuditDocument(item);
item.Children.ForEach(x => {
x.ParentId = result.Id;
x.IsUpdate = false;
x.Id = null;
});
if (item.Children.Count() > 0)
{
await addData(item.Children);
}
}
}
return ResponseOutput.Ok();
}
/// <summary>
/// 获取历史版本
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<HistoricalVersionDto>> GetHistoricalVersion(GetHistoricalVersionInDto inDto)
{
List< HistoricalVersionDto > result=new List<HistoricalVersionDto>();
result = await _auditDocumentRepository.Where(x => x.MainFileId == inDto.Id).ProjectTo<HistoricalVersionDto>(_mapper.ConfigurationProvider).OrderByDescending(x => x.Version).ToListAsync();
var currentData = await _auditDocumentRepository.Where(x => x.Id == inDto.Id).ProjectTo<HistoricalVersionDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
currentData.IsCurrentVersion = true;
result.Insert(0, currentData);
return result;
}
/// <summary>
/// 把历史版本设置为当前版本
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetCurrentVersion(SetCurrentVersionInDto inDto)
{
var file = await _auditDocumentRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
if (file.AuditDocumentTypeEnum != AuditDocumentType.HistoricalVersion)
{
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotSetCurrentVersion"]);
}
var mainFile = await _auditDocumentRepository.Where(x => x.Id == file.MainFileId).FirstNotNullAsync();
var historicalVersionIds= await _auditDocumentRepository.Where(x => x.MainFileId == mainFile.Id&&x.Id!=inDto.Id).OrderBy(x=>x.Version).Select(x=>x.Id).ToListAsync();
historicalVersionIds.Add(mainFile.Id);
await _auditDocumentRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new AuditDocument() {
MainFileId=null,
ParentId= mainFile.ParentId,
AuditDocumentTypeEnum=AuditDocumentType.File,
});
int num = 1;
foreach (var item in historicalVersionIds)
{
await _auditDocumentRepository.UpdatePartialFromQueryAsync(item, x => new AuditDocument()
{
MainFileId = inDto.Id,
ParentId = null,
Version=num,
AuditDocumentTypeEnum= AuditDocumentType.HistoricalVersion
});
num++;
}
await _auditDocumentRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
/// <summary>
/// 设置是否授权
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetIsAuthorization(SetIsAuthorizationInDto inDto)
{
var data = await _auditDocumentRepository.Select(x => new DeleteAudit()
{
Id = x.Id,
ParentId = x.ParentId,
MainFileId = x.MainFileId
}).ToListAsync();
List<Guid> allid = new List<Guid>();
findChild(allid, inDto.Ids, data);
if (inDto.IsAuthorization)
{
findParent(allid, inDto.Ids, data);
}
allid= allid.Distinct().ToList();
await _auditDocumentRepository.UpdatePartialFromQueryAsync(t => allid.Contains(t.Id), x => new AuditDocument() {
IsAuthorization = inDto.IsAuthorization
});
await _auditDocumentRepository.SaveChangesAsync();
return ResponseOutput.Ok();
void findParent(List<Guid> allId, List<Guid> current, List<DeleteAudit> data)
{
allId.AddRange(current);
var parent = data.Where(x => current.Contains(x.Id)).Select(x => x.ParentId).Where(x=>x!=null).Select(x=>(Guid)x).ToList();
if (parent.Count() > 0)
{
findParent(allId, parent, data);
}
}
void findChild(List<Guid> allId,List<Guid> current, List<DeleteAudit> data)
{
allId.AddRange(current);
var child = data.Where(x =>(x.ParentId!=null&& current.Contains(x.ParentId.Value))||(x.MainFileId!=null&&current.Contains(x.MainFileId.Value))).Select(x => x.Id).ToList();
if (child.Count() > 0)
{
findChild(allId, child, data);
}
}
}
}

View File

@ -0,0 +1,167 @@
//--------------------------------------------------------------------
// 此代码由liquid模板自动生成 byzhouhang 20240909
// 生成时间 2025-03-27 06:13:37Z
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.ViewModel;
public class DeleteAudit
{
public Guid Id { get; set; }
public AuditDocumentType AuditDocumentTypeEnum { get; set; }
public Guid? ParentId { get; set; }
public Guid? MainFileId { get; set; }
}
public class DeleteAuditDocumentInDto
{
public List<Guid> Ids { get; set; }
}
public class GetAuditDocumentDataInDto:PageInput
{
public Guid? Id { get; set; }
public Guid? SelfId { get; set; }
public bool? IsAuthorization { get; set; }
public string Name { get; set; } = string.Empty;
}
public class GetAuditDocumentDataOutDto
{
public List<AuditDocumentData> Data { get; set; } = new List<AuditDocumentData> { };
}
public class AuditDocumentData : AuditDocumentUpdateDto
{
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
public Guid? MainFileId { get; set; }
public int? Version { get; set; }
public int HistoricalVersionsCount { get; set; }
public List<AuditDocumentData> Children { get; set; }=new List<AuditDocumentData> (){ };
}
public class AuditDocumentView : AuditDocumentAddOrEdit
{
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
}
public class SetIsAuthorizationInDto
{
public List<Guid> Ids { get; set; }
public bool IsAuthorization { get; set; }
}
public class SetCurrentVersionInDto
{
public Guid Id { get; set; }
}
public class GetHistoricalVersionInDto
{
public Guid Id { get; set; }
}
public class GetHistoricalVersionOutDto
{
public AuditDocumentData CurrentData { get; set; }
public List<AuditDocumentData> HistoricalVersionList { get; set; } = new List<AuditDocumentData> { };
}
public class MovieFileOrFolderInDto
{
public List<Guid> Ids { get; set; }
public Guid ParentId { get; set; }
}
public class HistoricalVersionDto: AuditDocumentUpdateDto
{
public bool IsCurrentVersion { get; set; } = false;
public int? Version { get; set; }
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
}
public class AuditDocumentUpdateDto
{
public Guid? Id { get; set; }
public AuditDocumentType AuditDocumentTypeEnum { get; set; }
public string? FileFormat { get; set; }
public string? FilePath { get; set; }
public decimal? FileSize { get; set; }
public bool IsAuthorization { get; set; }
// public Guid? MainFileId { get; set; }
public string Name { get; set; }
public Guid? ParentId { get; set; }
}
public class GetBreadcrumbDataInDto
{
public Guid Id { get; set; }
}
public class AuditDocumentAddOrEdit: AuditDocumentUpdateDto
{
public List<AuditDocumentAddOrEdit> Children { get; set; }=new List<AuditDocumentAddOrEdit>() { };
public bool IsUpdate { get; set; } = true;
}
public class AuditDocumentQuery:PageInput
{
public AuditDocumentType? AuditDocumentTypeEnum { get; set; }
public string? FileFormat { get; set; }
public string? FilePath { get; set; }
public decimal? FileSize { get; set; }
public bool? IsAuthorization { get; set; }
public Guid? MainFileId { get; set; }
public string? Name { get; set; }
public Guid? ParentId { get; set; }
}

View File

@ -25,6 +25,11 @@ public class SysFileTypeAddOrEdit
public ArchiveType ArchiveTypeEnum { get; set; }
/// <summary>
/// 文档类型
/// </summary>
public SysTemplateType SysTemplateTypeEnum { get; set; }
public bool IsConfirmRecord { get; set; }
public bool IsEnable { get; set; }
@ -45,6 +50,8 @@ public class SysFileTypeQuery : PageInput
{
public ArchiveType? ArchiveTypeEnum { get; set; }
public SysTemplateType? SysTemplateTypeEnum { get; set; }
public bool? IsConfirmRecord { get; set; }
public bool? IsEnable { get; set; }

View File

@ -8,6 +8,51 @@ using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.Contracts
{
public class SystemDocumentAttachmentView : SystemDocumentAttachmentAddOrEdit
{
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
}
public class SystemDocumentAttachmentAddOrEdit
{
public Guid? Id { get; set; }
public string FileFormat { get; set; }
public string Name { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
public decimal? FileSize { get; set; }
public bool OffLine { get; set; }
public Guid SystemDocumentId { get; set; }
}
public class SystemDocumentAttachmentQuery : PageInput
{
public string? FileFormat { get; set; }
public string? FileName { get; set; }
public string? FilePath { get; set; }
public decimal? FileSize { get; set; }
public bool? OffLine { get; set; }
public Guid? SystemDocumentId { get; set; }
}
/// <summary> SystemDocumentView 列表视图模型 </summary>
public class SystemDocumentView : SystemDocumentAddOrEdit
{
@ -17,6 +62,8 @@ namespace IRaCIS.Core.Application.Contracts
public string FileType { get; set; } = string.Empty;
public int AttachmentCount { get; set; }
public List<NeedConfirmedUserTypeView> NeedConfirmedUserTypeList { get; set; } = new List<NeedConfirmedUserTypeView>();
}
@ -46,6 +93,10 @@ namespace IRaCIS.Core.Application.Contracts
public class UnionDocumentWithConfirmInfoView : UnionDocumentView
{
public bool IsNeedSendEmial { get; set; }
public DateTime UserCreateTime { get; set; }
public DateTime? ConfirmTime { get; set; }
@ -58,6 +109,28 @@ namespace IRaCIS.Core.Application.Contracts
public string RealName { get; set; } = string.Empty;
public int AttachmentCount { get; set; }
public DateTime? SuggestFinishTime
{
get
{
if (this.CreateTime > this.UserCreateTime && this.CurrentStaffTrainDays != null)
{
return DateTime.Parse(this.CreateTime.AddDays(this.CurrentStaffTrainDays.Value).ToString("yyyy-MM-dd")+" 22:00:00");
}
if (this.CreateTime < this.UserCreateTime && this.NewStaffTrainDays != null)
{
return DateTime.Parse(this.UserCreateTime.AddDays(this.NewStaffTrainDays.Value).ToString("yyyy-MM-dd") + " 22:00:00");
}
return null;
}
}
public string DocTypeCode { get; set; }
public List<string> UserConfirmedUserTypeList => (DocNeedSignUserTypeList != null && IdentityUserTypeList != null) ? IdentityUserTypeList.Intersect(DocNeedSignUserTypeList).ToList() : new List<string>();
@ -119,6 +192,15 @@ namespace IRaCIS.Core.Application.Contracts
public bool IsSigned { get; set; }
public Guid? UserTypeId { get; set; }
public DocUserSignType? DocUserSignType { get; set; }
public DateTime? BeginCreateTime { get; set; }
public DateTime? EndCreateTime { get; set; }
}
public class GetNextUnSignDocumentInDto
@ -170,6 +252,47 @@ namespace IRaCIS.Core.Application.Contracts
public string SignText { get; set; } = string.Empty;
}
public class SystemDocQuery : PageInput
{
public Guid? FileTypeId { get; set; }
public string Name { get; set; } = string.Empty;
public bool? IsSign { get; set; }
public Guid? UserTypeId { get; set; }
public Guid? UserId { get; set; }
public bool? IsConfirmed { get; set; }
/// <summary>
/// 课时状态
/// </summary>
public bool? IsDeleted { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public DateTime? StartConfirmTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndConfirmTime { get; set; }
public DateTime? BeginCreateTime { get; set; }
public DateTime? EndCreateTime { get; set; }
}
public class DocumentTrialUnionQuery : TrialUserDocUnionQuery
{
@ -197,6 +320,10 @@ namespace IRaCIS.Core.Application.Contracts
/// 结束时间
/// </summary>
public DateTime? EndConfirmTime { get; set; }
public DateTime? BeginCreateTime { get; set; }
public DateTime? EndCreateTime { get; set; }
}
///<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
@ -213,6 +340,29 @@ namespace IRaCIS.Core.Application.Contracts
public DocUserSignType DocUserSignType { get; set; }
/// <summary>
/// 现有员工培训天数
/// </summary>
public int? CurrentStaffTrainDays { get; set; }
/// <summary>
/// 新员工培训天数
/// </summary>
public int? NewStaffTrainDays { get; set; }
/// <summary>
/// 是否发布
/// </summary>
public bool IsPublish { get; set; } = false;
}
public class PublishSystemDocumentInDto
{
public List<Guid> Ids { get; set; }
}
public class AddOrEditSystemDocument : SystemDocumentAddOrEdit

View File

@ -27,6 +27,13 @@ namespace IRaCIS.Core.Application.Contracts
Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument);
Task<PageOutput<SystemDocumentAttachmentView>> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery);
Task<IResponseOutput> AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment);
Task<IResponseOutput> DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId);
}

View File

@ -33,6 +33,7 @@ public class SysFileTypeService(IRepository<SysFileType> _sysFileTypeRepository,
var sysFileTypeQueryable = _sysFileTypeRepository
.WhereIf(inQuery.ArchiveTypeEnum != null, t => t.ArchiveTypeEnum == inQuery.ArchiveTypeEnum)
.WhereIf(inQuery.SysTemplateTypeEnum != null, t => t.SysTemplateTypeEnum == inQuery.SysTemplateTypeEnum)
.WhereIf(inQuery.IsConfirmRecord != null, t => t.IsConfirmRecord == inQuery.IsConfirmRecord)
.WhereIf(inQuery.SubIdentificationEnum != null, t => t.SubIdentificationEnum == inQuery.SubIdentificationEnum)
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)

View File

@ -5,8 +5,13 @@
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain;
using Microsoft.AspNetCore.Mvc;
using UserRole = IRaCIS.Core.Domain.Models.UserRole;
using IRaCIS.Core.Application.MassTransit.Consumer;
using MassTransit.Mediator;
using Microsoft.Extensions.DependencyInjection;
namespace IRaCIS.Core.Application.Services
{
@ -16,12 +21,62 @@ namespace IRaCIS.Core.Application.Services
[ApiExplorerSettings(GroupName = "Trial")]
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
IRepository<UserRole> _userRoleRepository,
IScopedMediator _mediatorScoped,
IRepository<SystemDocumentAttachment> _systemDocumentAttachmentRepository,
IRepository<IdentityUser> _identityUserRepository,
IServiceScopeFactory serviceScopeFactory,
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
{
/// <summary>
/// 获取系统文档附件
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<SystemDocumentAttachmentView>> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery)
{
var systemDocumentAttachmentQueryable = _systemDocumentAttachmentRepository
.WhereIf(inQuery.SystemDocumentId != null, t => t.SystemDocumentId == inQuery.SystemDocumentId)
.WhereIf(inQuery.OffLine != null, t => t.OffLine == inQuery.OffLine)
.WhereIf(inQuery.FileName != null, t => t.FileName == inQuery.FileName)
.WhereIf(inQuery.FileFormat != null, t => t.FileFormat == inQuery.FileFormat)
.ProjectTo<SystemDocumentAttachmentView>(_mapper.ConfigurationProvider);
var pageList = await systemDocumentAttachmentQueryable.ToPagedListAsync(inQuery);
return pageList;
}
/// <summary>
/// 新增或编辑系统文档附件
/// </summary>
/// <param name="addOrEditSystemDocumentAttachment"></param>
/// <returns></returns>
public async Task<IResponseOutput> AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment)
{
var entity = await _systemDocumentAttachmentRepository.InsertOrUpdateAsync(addOrEditSystemDocumentAttachment, true);
return ResponseOutput.Ok(entity.Id.ToString());
}
/// <summary>
/// 删除系统文档附件
/// </summary>
/// <param name="systemDocumentAttachmentId"></param>
/// <returns></returns>
[HttpDelete("{systemDocumentAttachmentId:guid}")]
public async Task<IResponseOutput> DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId)
{
var success = await _systemDocumentAttachmentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentAttachmentId, true);
return ResponseOutput.Ok();
}
/// <summary>
@ -35,7 +90,11 @@ namespace IRaCIS.Core.Application.Services
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(inQuery.DocUserSignType != null, t => t.DocUserSignType == inQuery.DocUserSignType)
.WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime)
.WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.UserRoleId });
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
@ -104,6 +163,51 @@ namespace IRaCIS.Core.Application.Services
}
/// <summary>
/// 发布系统文档
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> PublishSystemDocument(PublishSystemDocumentInDto inDto)
{
await _systemDocumentRepository.BatchUpdateNoTrackingAsync(x => inDto.Ids.Contains(x.Id), x => new SystemDocument()
{
IsPublish = true,
IsDeleted = false,
});
Console.WriteLine("开始 发布系统文档");
Task.Run(async () =>
{
// 创建独立作用域
using (var scope = serviceScopeFactory.CreateScope())
{
// 从新作用域解析服务
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
await mediator.Publish(new SystemDocumentPublishEvent { Ids = inDto.Ids });
}
});
return ResponseOutput.Result(true);
}
/// <summary>
/// 下线系统文档
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> OutLineSystemDocument(PublishSystemDocumentInDto inDto)
{
await _systemDocumentRepository.UpdatePartialFromQueryAsync(x => inDto.Ids.Contains(x.Id), x => new SystemDocument()
{
IsDeleted = true,
});
var result = await _systemDocumentRepository.SaveChangesAsync();
return ResponseOutput.Result(result);
}
[HttpDelete("{systemDocumentId:guid}")]
public async Task<IResponseOutput> AbandonSystemDocumentAsync(Guid systemDocumentId)
{
@ -160,9 +264,12 @@ namespace IRaCIS.Core.Application.Services
select new UnionDocumentWithConfirmInfoView()
{
AttachmentCount=sysDoc.SystemDocumentAttachmentList.Where(z=>!z.OffLine).Count(),
IsSystemDoc = true,
CurrentStaffTrainDays=sysDoc.CurrentStaffTrainDays,
NewStaffTrainDays = sysDoc.NewStaffTrainDays,
Id = sysDoc.Id,
UserCreateTime= user.CreateTime,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
@ -178,18 +285,18 @@ namespace IRaCIS.Core.Application.Services
RealName = user.FullName,
UserName = user.UserName,
DocTypeCode=sysDoc.FileType.Code
DocTypeCode = sysDoc.FileType.Code
//UserTypeId = user.UserTypeId,
//UserTypeShortName = user.UserTypeRole.UserTypeShortName
};
var list = await query
//过滤掉删除的,并且没有签名的
var list = await query
//过滤掉删除的,并且没有签名的
.Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
.ToPagedListAsync(inQuery,nameof(UnionDocumentWithConfirmInfoView.DocTypeCode));
.ToPagedListAsync(inQuery, nameof(UnionDocumentWithConfirmInfoView.DocTypeCode));
return list;

View File

@ -8,6 +8,7 @@ using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions;
@ -29,6 +30,7 @@ namespace IRaCIS.Core.Application.Services
IRepository<SystemDocument> _systemDocumentRepository,
IRepository<TrialIdentityUser> _trialIdentityUserRepository,
IRepository<TrialUserRole> _trialUserRoleRepository,
IRepository<IdentityUser> _identityUserRepository,
IRepository<TrialDocConfirmedIdentityUser> _trialDocConfirmedUserRepository,
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
{
@ -241,7 +243,6 @@ namespace IRaCIS.Core.Application.Services
select new UnionDocumentWithConfirmInfoView()
{
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
@ -409,6 +410,21 @@ namespace IRaCIS.Core.Application.Services
var result = await unionQuery.ToPagedListAsync(inQuery);
//Concat 不能用导航属性
var sysids = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
var sysDataList = await _systemDocumentRepository.Where(x => sysids.Contains(x.Id)).Include(x => x.SystemDocumentAttachmentList).ToListAsync();
result.CurrentPageData.ForEach(x =>
{
if (sysDataList.Any(y => y.Id == x.Id))
{
x.AttachmentCount = sysDataList.Where(y => y.Id == x.Id).Select(x => x.SystemDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault();
}
});
#endregion
#region 临时方案
@ -473,12 +489,12 @@ namespace IRaCIS.Core.Application.Services
var trialDocQuery =
from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
&& t.TrialUserRoleList.AsQueryable().Any(t => trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId))
)
.Where(t => inQuery.UserId != null ? t.IdentityUserId == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == inQuery.UserTypeId) : true)
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
&& t.TrialUserRoleList.AsQueryable().Any(t => trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId))
)
.Where(t => inQuery.UserId != null ? t.IdentityUserId == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == inQuery.UserTypeId) : true)
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
@ -557,13 +573,27 @@ namespace IRaCIS.Core.Application.Services
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
.WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value)
.WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value)
.WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value)
.WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value)
.WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime)
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted);
var result = await unionQuery.ToPagedListAsync(inQuery);
//Concat 不能用导航属性
var sysids = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
var sysDataList = await _systemDocumentRepository.Where(x => sysids.Contains(x.Id)).Include(x => x.SystemDocumentAttachmentList).ToListAsync();
result.CurrentPageData.ForEach(x =>
{
if (sysDataList.Any(y => y.Id == x.Id))
{
x.AttachmentCount = sysDataList.Where(y => y.Id == x.Id).Select(x => x.SystemDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault();
}
});
#region 处理文档 需要签署的角色类型 和每个人的角色信息
var trialDocIdList = result.CurrentPageData.Where(t => t.IsSystemDoc == false).Select(t => t.Id).ToList();
@ -749,6 +779,112 @@ namespace IRaCIS.Core.Application.Services
}
/// <summary>
/// 获取系统签署文档签署人下拉框
/// </summary>
/// <returns></returns>
public async Task<IResponseOutput> GetSysDocSignUserList()
{
var list = _systemDocConfirmedUserRepository.Where(t => t.ConfirmTime != null).Select(t => new { t.ConfirmUserId, t.ConfirmUser.UserName, t.ConfirmUser.FullName }).Distinct().ToList();
return ResponseOutput.Ok(list);
}
[HttpPost]
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetSysDocumentConfirmList(SystemDocQuery inQuery)
{
var isInternal = _userInfo.IsZhiZhun;
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
select new UnionDocumentWithConfirmInfoView()
{
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
IsDeleted = sysDoc.IsDeleted,
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
Name = sysDoc.Name,
Path = sysDoc.Path,
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
FileTypeId = sysDoc.FileTypeId,
UpdateTime = sysDoc.UpdateTime,
//IsConfirmed = confirm.ConfirmTime != null,
ConfirmUserId = identityUser.Id,
ConfirmTime = confirm.ConfirmTime,
RealName = identityUser.FullName,
UserName = identityUser.UserName,
//UserTypeId = trialUser.UserRole.UserTypeId,
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
FullFilePath = sysDoc.Path
};
var unionQuery = systemDocQuery.IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
.WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value)
.WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value)
.WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime)
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(isInternal == false, t => t.ConfirmTime != null);
var result = await unionQuery.ToPagedListAsync(inQuery);
#region 处理文档 需要签署的角色类型 和每个人的角色信息
var trialDocIdList = result.CurrentPageData.Where(t => t.IsSystemDoc == false).Select(t => t.Id).ToList();
var sysDocIdList = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
var identityUserIdList = result.CurrentPageData.Select(t => t.ConfirmUserId).Distinct().ToList();
var sysDocUserTypeList = _systemDocNeedConfirmedUserTypeRepository.Where(t => sysDocIdList.Contains(t.SystemDocumentId)).Select(t => new { t.SystemDocumentId, t.UserTypeRole.UserTypeShortName }).ToList();
var identityUserUserTypeList = _identityUserRepository.Where(t => identityUserIdList.Contains(t.Id)).IgnoreQueryFilters().Select(t => new { IdentityUserId = t.Id, UserTypeList = t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Select(c => c.UserTypeRole.UserTypeShortName).ToList() });
//Concat 不能用导航属性
var sysids = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
var sysDataList = await _systemDocumentRepository.Where(x => sysids.Contains(x.Id)).Include(x => x.SystemDocumentAttachmentList).ToListAsync();
foreach (var item in result.CurrentPageData)
{
if (sysDataList.Any(y => y.Id == item.Id))
{
item.AttachmentCount = sysDataList.Where(y => y.Id == item.Id).Select(x => x.SystemDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault();
}
if (item.IsSystemDoc)
{
item.DocNeedSignUserTypeList = sysDocUserTypeList.Where(t => t.SystemDocumentId == item.Id).Select(t => t.UserTypeShortName).ToList();
}
item.IdentityUserTypeList = identityUserUserTypeList.Where(t => t.IdentityUserId == item.ConfirmUserId).SelectMany(c => c.UserTypeList).ToList();
}
#endregion
return ResponseOutput.Ok(result);
}
/// <summary>
/// 项目下面的参与用户下拉

View File

@ -13,6 +13,7 @@ using System.Threading.Tasks;
using IRaCIS.Core.Infra.EFCore;
using MassTransit;
using IRaCIS.Core.Infrastructure;
using Microsoft.Extensions.Options;
namespace IRaCIS.Core.Application.Service;
/// <summary>
@ -24,7 +25,7 @@ namespace IRaCIS.Core.Application.Service;
/// <param name="_localizer"></param>
[ApiExplorerSettings(GroupName = "FileRecord")]
public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepository,
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
IRepository<TrialFile> _trialFileRepository,
IRepository<SysFileType> _sysFileTypeRepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialFileTypeService
@ -116,6 +117,7 @@ public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepos
if (!(await _trialFileTypeRepository.AnyAsync(x => x.TrialId == inDto.TrialId)))
{
var trialFileTypeList = await _sysFileTypeRepository
.Where(x=>x.SysTemplateTypeEnum== _verifyConfig.CurrentValue.TemplateType|| x.SysTemplateTypeEnum==SysTemplateType.Both)
.ProjectTo<TrialFileType>(_mapper.ConfigurationProvider)
.ToListAsync();

View File

@ -15,7 +15,21 @@ namespace IRaCIS.Core.Application.Service
var userId = Guid.Empty;
var isEn_Us = false;
// 在此处拷贝automapper 映射
CreateMap<SystemDocumentAttachment, SystemDocumentAttachmentView>();
CreateMap<SystemDocumentAttachment, SystemDocumentAttachmentAddOrEdit>().ReverseMap();
CreateMap<AuditDocumentData, AuditDocumentAddOrEdit>();
//CreateMap<List<AuditDocumentData>, List<AuditDocumentAddOrEdit>>();
CreateMap<AuditDocument, AuditDocumentView>();
CreateMap<AuditDocument, AuditDocumentUpdateDto>();
CreateMap<AuditDocument, HistoricalVersionDto>();
CreateMap<AuditDocumentUpdateDto, AuditDocumentAddOrEdit>();
CreateMap<AuditDocument, AuditDocumentData>();
CreateMap<AuditDocument, AuditDocumentAddOrEdit>().ReverseMap();
CreateMap<SystemDocument, SystemDocumentView>()
.ForMember(d => d.AttachmentCount, u => u.MapFrom(s => s.SystemDocumentAttachmentList.Count()))
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));

View File

@ -137,9 +137,9 @@ namespace IRaCIS.Core.Application.Contracts
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
await _noneDicomStudyRepository.DeleteFromQueryAsync(noneDicomStudyId);
await _noneDicomStudyRepository.DeleteFromQueryAsync(noneDicomStudyId,ignoreQueryFilter:true);
await _noneDicomStudyFileRepository.DeleteFromQueryAsync(t => t.NoneDicomStudyId == noneDicomStudyId);
await _noneDicomStudyFileRepository.DeleteFromQueryAsync(t => t.NoneDicomStudyId == noneDicomStudyId, ignoreQueryFilter: true);
//确认需求 不删除
//await _studyMonitorRepository.BatchDeleteNoTrackingAsync(t => t.StudyId == noneDicomStudyId);
@ -157,13 +157,13 @@ namespace IRaCIS.Core.Application.Contracts
//提交了 但是IQC同意的时候 是可以删除的 | 普通提交后也不能删除
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
var noneDicomStudyFile = await _noneDicomStudyFileRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyFileId);
var noneDicomStudyFile = await _noneDicomStudyFileRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyFileId, true);
var success = await _noneDicomStudyFileRepository.DeleteAsync(noneDicomStudyFile, true);
var success = await _noneDicomStudyFileRepository.DeleteAsync(noneDicomStudyFile,true);
//维护文件数量数字
var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyFile.NoneDicomStudyId);
noneDicomStudy.FileCount = await _noneDicomStudyFileRepository.CountAsync(t => t.NoneDicomStudyId == noneDicomStudyFile.NoneDicomStudyId);
var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyFile.NoneDicomStudyId,true);
noneDicomStudy.FileCount = await _noneDicomStudyFileRepository.CountAsync(t => t.NoneDicomStudyId == noneDicomStudyFile.NoneDicomStudyId,true);
await _noneDicomStudyRepository.SaveChangesAsync();
return ResponseOutput.Ok();

View File

@ -845,7 +845,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var verifyStudyInfo = _dicomStudyRepository.Where(t => t.TrialId == trialId && t.Id == expectStudyId).ProjectTo<VerifyStudyDto>(_mapper.ConfigurationProvider).FirstOrDefault();
var verifyStudyInfo = _dicomStudyRepository.Where(t => t.TrialId == trialId && t.Id == expectStudyId,false,true).ProjectTo<VerifyStudyDto>(_mapper.ConfigurationProvider).FirstOrDefault();
result.StudyInfo = verifyStudyInfo;

View File

@ -27,6 +27,7 @@ namespace IRaCIS.Core.Application.ViewModel
public bool IsLoginUncommonly { get; set; }
public bool IsIgnoreUncommonly { get; set; }
public string JsonObj { get; set; }
@ -43,17 +44,26 @@ namespace IRaCIS.Core.Application.ViewModel
public UserMFAType MFAType { get; set; } = UserMFAType.Login;
}
public class SetIsIgnoreUncommonlyInDto
{
public Guid Id { get; set; }
public bool IsIgnoreUncommonly { get; set; }
}
///<summary>UserLogQuery 列表查询参数模型</summary>
public class UserLogQuery : PageInput
{
public Guid? TrialId { get; set; }
public UserOptType? OptType { get; set; }
public List<UserOptType>? OptTypeList { get; set; }
public string? IP { get; set; }
public string? LoginFaildName { get; set; }
public string? LoginUserName { get; set; }
public DateTime? BeginDate { get; set; }

View File

@ -510,11 +510,11 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.EndLastLoginTime != null, t => t.LastLoginTime <= inQuery.EndLastLoginTime)
.WhereIf(inQuery.BeginLastChangePassWordTime != null, t => t.LastChangePassWordTime >= inQuery.BeginLastChangePassWordTime)
.WhereIf(inQuery.EndLastChangePassWordTime != null, t => t.LastChangePassWordTime <= inQuery.EndLastChangePassWordTime)
.WhereIf(inQuery.UserType != null, t => t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserType))
.WhereIf(inQuery.UserType != null, t => t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserType && t.IsUserRoleDisabled==false))
.WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState)
.WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser)
.WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun)
.WhereIf(inQuery.UserCeateSource != null, t => t.UserCeateSource == inQuery.UserCeateSource)
.WhereIf(inQuery.UserCeateSource != null, t => t.UserCeateSource == inQuery.UserCeateSource)
.ProjectTo<UserListDTO>(_mapper.ConfigurationProvider);
return await userQueryable.ToPagedListAsync(inQuery);
@ -835,7 +835,17 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok();
}
/// <summary>
/// 设置是否忽略异地登录
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetIsIgnoreUncommonly(SetIsIgnoreUncommonlyInDto inDto)
{
await _userLogRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new UserLog() { IsIgnoreUncommonly = inDto.IsIgnoreUncommonly }, true);
return ResponseOutput.Ok();
}
[HttpPost]
public async Task<PageOutput<UserLogView>> GetUserLogList(UserLogQuery inQuery)
@ -850,10 +860,11 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.TargetIdentityUserId != null, t => t.TargetIdentityUserId == inQuery.TargetIdentityUserId)
.WhereIf(inQuery.TrialId != null, t => t.ActionIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId) || t.TargetIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId))
.WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime)
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
.WhereIf(inQuery.OptTypeList != null && inQuery.OptTypeList.Count > 0, t => inQuery.OptTypeList.Contains(t.OptType))
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
.WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly)
.WhereIf(inQuery.IsLoginUncommonly != null , t => t.IsLoginUncommonly== inQuery.IsLoginUncommonly)
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!))
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!))
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
@ -958,25 +969,42 @@ namespace IRaCIS.Core.Application.Service
//账号在系统存在
if (isExistAccount || loginUser != null)
{
var ipinfo = _searcher.Search(_userInfo.IP);
//var ipinfo = _searcher.Search(_userInfo.IP);
var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
//var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
string SplitAndConcatenate(string input)
//string SplitAndConcatenate(string input)
//{
// string[] parts = input.Split('|');
// return parts.Length >= 3 ? parts[0] + parts[1] : string.Join("", parts);
//}
var iPRegion = IPCityHelper.GetCityResponse(_userInfo.IP);
//设置本次登录的IP
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser()
{
string[] parts = input.Split('|');
return parts.Length >= 3 ? parts[0] + parts[1] : string.Join("", parts);
LastLoginIP = iPRegion,
LastLoginTime = DateTime.Now
});
//超过90天没修改密码
if (loginUser!= null&&_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
{
loginUser.NeedChangePassWord = true;
}
if (existUserLoginInfo.LastLoginIP != string.Empty)
{
//设置上次登录的IP
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser()
// 与上一次区域不一致
//if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion))
if (existUserLoginInfo.LastLoginIP != iPRegion)
{
LastLoginIP = iPRegion,
LastLoginTime = DateTime.Now
});
isLoginUncommonly = true;
// 与上一次区域不一致
@ -991,11 +1019,7 @@ namespace IRaCIS.Core.Application.Service
//异地登录
loginUser.LoginState = 2;
//超过90天没修改密码
if (_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
{
loginUser.NeedChangePassWord = true;
}
}
}
}
@ -1019,7 +1043,7 @@ namespace IRaCIS.Core.Application.Service
}
//登录成功的,才会算异地登录
if (loginUser.Status == 0)
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.LoginLockedAccount, IsLoginUncommonly = isLoginUncommonly }, true);

View File

@ -11,6 +11,36 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Application.Contracts
{
public class ImageBackQueryDto : PageInput
{
[NotDefault]
public Guid TrialId { get; set; }
public Guid? TrialSiteId { get; set; }
public string? SubjectCode { get; set; } = string.Empty;
public Guid? CreateUserId { get; set; }
public string? VisitName { get; set; }
public ImageBackApplyEnum? ApplyUserRole { get; set; }
public DateTime? ApplyBeginTime { get; set; }
public DateTime? ApplyEndTime { get; set; }
public ImageBackStateEnum? ImageBackState { get; set; }
public DateTime? AuditBeginTime { get; set; }
public DateTime? AuditEndTime { get; set; }
public string[]? VisitPlanArray { get; set; }
}
public class CRCVisitSearchDTO : PageInput
{
@ -166,7 +196,7 @@ namespace IRaCIS.Core.Application.Contracts
[Comment("阅片任务产生之前 采集影像")]
public CollectImagesType CollectImagesEnum { get; set; }
public List<StudyName> StudyNameList { get; set; }
public List<StudyName> StudyNameList { get; set; }
public List<string> ImageFormatList { get; set; }
@ -1687,6 +1717,40 @@ namespace IRaCIS.Core.Application.Contracts
#endregion
public class ImageBackViewModel
{
public Guid Id { get; set; }
public DateTime CreateTime { get; set; }
public string CreateUserName { get; set; }
public string CreateUserFullName { get; set; }
public DateTime? AuditTime { get; set; }
public Guid SubjectVisitId { get; set; }
public ImageBackApplyEnum ApplyUserRole { get; set; }
public ImageBackStateEnum ImageBackState { get; set; }
public DateTime? SubmitTime { get; set; }
public bool IsUrgent { get; set; }
public string VisitName { get; set; } = string.Empty;
public DateTime? EarliestScanDate { get; set; }
public DateTime? LatestScanDate { get; set; }
public decimal VisitNum { get; set; }
public string SubjectCode { get; set; } = String.Empty;
public String TrialSiteCode { get; set; } = String.Empty;
}
public class QCCRCVisitViewModel : QCVisitBasicListViewModel
@ -2108,6 +2172,8 @@ namespace IRaCIS.Core.Application.Contracts
public DateTime? ReviewAuditTime { get; set; }
public DateTime? PreliminaryAuditTime { get; set; }
public bool IsImageBackApplying { get; set; }
public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null);
}

View File

@ -121,6 +121,41 @@ namespace IRaCIS.Core.Application.Service
}
return svExpression;
}
public static Expression<Func<SubjectVisitImageBackRecord, bool>> GetSubjectVisitImageBackRecordFilter(string[]? VisitPlanArray)
{
Expression<Func<SubjectVisitImageBackRecord, bool>> svExpression = x => true;
bool isNeedVisitSearch = VisitPlanArray != null && VisitPlanArray?.Length > 0;
if (isNeedVisitSearch)
{
var inPlanArray = VisitPlanArray!.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray();
var isSelectOutPlan = VisitPlanArray!.Any(t => t.Contains('.'));
if (inPlanArray.Length > 0)
{
svExpression = svExpression.And(t => inPlanArray.Contains(t.SubjectVisit.VisitNum));
if (isSelectOutPlan)
{
svExpression = svExpression.Or(t => t.SubjectVisit.InPlan == false);
}
}
else if (isSelectOutPlan)
{
svExpression = t => t.SubjectVisit.InPlan == false;
}
}
return svExpression;

View File

@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
using MassTransit.Initializers;
using Microsoft.AspNetCore.Mvc;
@ -22,10 +23,47 @@ namespace IRaCIS.Core.Application.Image.QA
IRepository<DicomSeries> _dicomSeriesRepository,
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
IRepository<QCChallenge> _qcChallengeRepository,
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
IReadingImageTaskService _IReadingImageTaskService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IQCListService
{
#region CRC IQC 直接申请回退影像流程
public async Task<IResponseOutput> GetImageBackApplyUserList(Guid trialId)
{
var list = _subjectVisitImageBackRecordReposiotry.Where(t => t.SubjectVisit.TrialId == trialId).Select(t => new { t.CreateUserId, t.CreateUserRole.UserName, t.CreateUserRole.FullName }).Distinct().ToList();
return ResponseOutput.Ok(list);
}
[HttpPost]
public async Task<IResponseOutput<PageOutput<ImageBackViewModel>>> GetImageBackList(ImageBackQueryDto inQuery)
{
var svExpression = QCCommon.GetSubjectVisitImageBackRecordFilter(inQuery.VisitPlanArray);
var query = _subjectVisitImageBackRecordReposiotry.Where(t => t.SubjectVisit.TrialId == inQuery.TrialId)
.WhereIf(inQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(inQuery.SubjectCode))
.WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName))
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
.WhereIf(inQuery.CreateUserId != null, t => t.CreateUserId == inQuery.CreateUserId)
.WhereIf(inQuery.ApplyUserRole != null, t => t.ApplyUserRole == inQuery.ApplyUserRole)
.WhereIf(inQuery.ApplyBeginTime != null, t => t.CreateTime >= inQuery.ApplyBeginTime)
.WhereIf(inQuery.ApplyEndTime != null, t => t.CreateTime <= inQuery.ApplyEndTime)
.WhereIf(inQuery.ImageBackState != null, t => t.ImageBackState == inQuery.ImageBackState)
.WhereIf(inQuery.AuditBeginTime != null, t => t.AuditTime >= inQuery.AuditBeginTime)
.WhereIf(inQuery.AuditEndTime != null, t => t.AuditTime <= inQuery.AuditEndTime)
.ProjectTo<ImageBackViewModel>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(ImageBackViewModel.IsUrgent) + " desc", nameof(ImageBackViewModel.SubjectCode), nameof(ImageBackViewModel.VisitNum) };
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
return ResponseOutput.Ok(pageList);
}
#endregion
@ -380,7 +418,7 @@ namespace IRaCIS.Core.Application.Image.QA
ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
SeriesList = temp.SeriesList,
RelationInfo = await GetVisitQCSubjectInfo(subjectVisitId),
NoneDicomStudyList = await _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId,ignoreQueryFilters:true).ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider).ToListAsync(),
NoneDicomStudyList = await _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId, ignoreQueryFilters: true).ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider).ToListAsync(),
SubjectClinicalData = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId)
.ProjectTo<SubjectClinicalDataDto>(_mapper.ConfigurationProvider, new { subjectVisitId = subjectVisitId, token = _userInfo.UserToken }).FirstOrDefaultAsync()
};
@ -410,7 +448,7 @@ namespace IRaCIS.Core.Application.Image.QA
TypeValue = data.TypeValue
}).OrderBy(t => t.ShowOrder).ToListAsync();
var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t=>t.ShowOrder).ToList();
var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t => t.ShowOrder).ToList();
result.ForEach(x =>
{
GetQuestionChild(x, questionAnswerlist);
@ -534,7 +572,7 @@ namespace IRaCIS.Core.Application.Image.QA
var visit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).FirstNotNullAsync();
var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo<QAStudyInfoDTO>(_mapper.ConfigurationProvider,new { isNeedStat= isNeedStat }).OrderBy(t => t.StudyCode).ToListAsync();
var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo<QAStudyInfoDTO>(_mapper.ConfigurationProvider, new { isNeedStat = isNeedStat }).OrderBy(t => t.StudyCode).ToListAsync();
var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Trial).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();

View File

@ -3,12 +3,14 @@ using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using Medallion.Threading;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Org.BouncyCastle.Asn1.Cmp;
using System.ComponentModel.DataAnnotations;
using System.Data;
@ -38,6 +40,8 @@ namespace IRaCIS.Core.Application.Image.QA
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService,
IOSSService _oSSService,
IRepository<ReadingClinicalData> _readingClinicalDataReposiotry,
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService, IQCOperationService
{
@ -239,6 +243,183 @@ namespace IRaCIS.Core.Application.Image.QA
#endregion
#region CRC IQC 申请退回
/// <summary>
/// CRC IQC 申请影像回退
/// </summary>
/// <param name="subjectVisitId"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
[HttpPut]
public async Task<IResponseOutput> RequestImageBack(Guid subjectVisitId)
{
if (_subjectVisitRepository.Any(t => t.Id == subjectVisitId && t.QCChallengeList.Any(t => t.IsClosed == false)))
{
//有未关闭的质疑,不允许在此申请影像回退
throw new BusinessValidationFailedException(_localizer["QCOperation_HaveNotClosedQCChanllenge"]);
}
if (!_subjectVisitRepository.Any(t => t.Id == subjectVisitId && !t.VisitTaskList.Any(u => u.TaskState == TaskState.Effect) && t.SubmitState == SubmitStateEnum.Submitted))
{
//已提交未生成任务的才允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_ShouldBeforeCheckPassed"]);
}
if (_subjectVisitImageBackRecordReposiotry.Any(t => t.SubjectVisitId == subjectVisitId && t.ImageBackState == ImageBackStateEnum.None))
{
//已经有在申请的影像回退记录
throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]);
}
if (_qcChallengeRepository.Any(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false && t.ReuploadEnum == QCChanllengeReuploadEnum.CRCRequestReupload))
{
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack)
{
// 该访视已在其他途径申请影像回退中,不允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
var newRecord = new SubjectVisitImageBackRecord() { SubjectVisitId = subjectVisitId, SubmitTime = sv.SubmitTime, EarliestScanDate = sv.EarliestScanDate, LatestScanDate = sv.LatestScanDate };
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
{
newRecord.ApplyUserRole = ImageBackApplyEnum.CRCRequestBack;
}
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
{
newRecord.ApplyUserRole = ImageBackApplyEnum.IQCRequestBack;
}
await _subjectVisitImageBackRecordReposiotry.AddAsync(newRecord, true);
return ResponseOutput.Ok();
}
/// <summary>
/// PM 审核CRC IQC 申请影像回退
/// </summary>
/// <param name="iamgeBackRecordId"></param>
/// <param name="isAgree"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
[HttpPut]
public async Task<IResponseOutput> AuditImageBack(Guid iamgeBackRecordId, bool isAgree)
{
var backRecord = (await _subjectVisitImageBackRecordReposiotry.FirstOrDefaultAsync(t => t.Id == iamgeBackRecordId)).IfNullThrowException();
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == backRecord.SubjectVisitId)).IfNullThrowException();
var subjectVisitId = backRecord.SubjectVisitId;
if (backRecord.ApplyUserRole != ImageBackApplyEnum.CRCRequestBack && backRecord.ApplyUserRole != ImageBackApplyEnum.IQCRequestBack)
{
//当前访视状态不在影像申请回退状态,不允许审核通过
throw new BusinessValidationFailedException(_localizer["QCOperation_NotInRequestImageBackState"]);
}
if (isAgree)
{
if (_subjectVisitRepository.Any(t => t.Id == subjectVisitId && t.QCChallengeList.Any(t => t.IsClosed == false)))
{
//有未关闭的质疑,不允许同意影像回退
throw new BusinessValidationFailedException(_localizer["QCOperation_HaveNotClosedQCChanllenge"]);
}
if (sv.SubmitState == SubmitStateEnum.Submitted && _subjectVisitRepository.Any(t => t.Id == backRecord.SubjectVisitId && !t.VisitTaskList.Any(u => u.TaskState == TaskState.Effect)))
{
backRecord.ImageBackState = ImageBackStateEnum.PMAgreeBack;
}
else
{
//已提交未生成任务的才允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_ShouldBeforeCheckPassed"]);
}
#region 回退处理
//需要重新产生任务
sv.IsVisitTaskGenerated = false;
sv.IsPMBackOrReReading = true;
sv.AuditState = AuditStateEnum.None;
sv.SubmitState = SubmitStateEnum.ToSubmit;
sv.ReadingStatus = ReadingStatusEnum.ImageNotSubmit;
//回退后,回退状态恢复
sv.RequestBackState = RequestBackStateEnum.NotRequest;
sv.IsCheckBack = false;
sv.CheckBackTime = null;
sv.CheckState = CheckStateEnum.None;
sv.CheckChallengeState = CheckChanllengeTypeEnum.None;
sv.SVENDTC = null;
sv.SVSTDTC = null;
sv.PreliminaryAuditTime = null;
sv.SubmitTime = null;
sv.ReviewAuditTime = null;
sv.CurrentActionUserExpireTime = null;
sv.IsTake = false;
sv.CurrentActionUserId = null;
sv.PreliminaryAuditUserId = null;
sv.ReviewAuditUserId = null;
if (sv.IsBaseLine)
{
await _readingClinicalDataReposiotry.UpdatePartialFromQueryAsync(t => t.ReadingId == sv.Id && (t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit), c => new ReadingClinicalData() { IsSign = false, ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded });
}
else
{
await _readingClinicalDataReposiotry.UpdatePartialFromQueryAsync(t => t.ReadingId == sv.Id && t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit, c => new ReadingClinicalData()
{
IsSign = false,
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded,
IsBlind = null,
IsComplete = null
});
}
await _trialQCQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisitId == subjectVisitId);
#endregion
}
else
{
backRecord.ImageBackState = ImageBackStateEnum.PMNotAgreeBack;
}
backRecord.AuditTime = DateTime.Now;
await _subjectVisitRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
#endregion
#region 一致性核查
/// <summary>
@ -383,6 +564,20 @@ namespace IRaCIS.Core.Application.Image.QA
return ResponseOutput.NotOk(_localizer["QCOperation_Cannotback"]);
}
if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)))
{
// 该访视已在其他途径申请影像回退中,不允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack)
{
// 该访视已在其他途径申请影像回退中,不允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
var QCChallengeId = await _qcChallengeRepository.Where(x => x.SubjectVisitId == subjectVisitId).Select(x => x.Id).FirstOrDefaultAsync();
await _checkChallengeDialogRepository.AddAsync(new CheckChallengeDialog()
@ -394,7 +589,7 @@ namespace IRaCIS.Core.Application.Image.QA
});
if (sv.RequestBackState == RequestBackStateEnum.NotRequest || sv.RequestBackState == RequestBackStateEnum.PM_NotAgree)
if (sv.RequestBackState != RequestBackStateEnum.CRC_RequestBack)
{
sv.RequestBackState = RequestBackStateEnum.CRC_RequestBack;
@ -468,16 +663,14 @@ namespace IRaCIS.Core.Application.Image.QA
return ResponseOutput.NotOk(_localizer["QCOperation_CannotRollback"]);
}
//sv.CheckChallengeState = (int)CheckChanllengeTypeEnum.None;
//sv.CheckState = CheckStateEnum.None;
//sv.ChallengeState = (int)ChallengeStateEnum.No;
sv.RequestBackState = RequestBackStateEnum.PM_AgressBack;
sv.AuditState = AuditStateEnum.None;
sv.SubmitState = SubmitStateEnum.ToSubmit;
sv.ReadingStatus = ReadingStatusEnum.ImageNotSubmit;
//回退后,回退状态恢复
sv.RequestBackState = RequestBackStateEnum.NotRequest;
sv.IsCheckBack = true;
sv.CheckBackTime = DateTime.Now;
sv.CheckState = CheckStateEnum.None;
@ -731,7 +924,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <returns></returns>
[HttpPut]
[TrialGlobalLimit("AfterStopCannNotOpt")]
public async Task<IResponseOutput> SetNodicomStudyState(Guid subjectVisitId, Guid noneDicomStudyId, Guid? noneDicomStudyFileId, int state)
public async Task<IResponseOutput> SetNodicomStudyState(Guid subjectVisitId, Guid noneDicomStudyId, Guid? noneDicomStudyFileId, int state)
{
await VerifyIsCanQCAsync(null, subjectVisitId);
@ -757,7 +950,7 @@ namespace IRaCIS.Core.Application.Image.QA
else if (state == 5)
{
noneDicomStudy.IsDeleted = false;
}
}
//设置检查下面的文件
@ -818,7 +1011,7 @@ namespace IRaCIS.Core.Application.Image.QA
{
var studyId = updateModalityCommand.Id;
var study = (await _dicomStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId)).IfNullThrowException();
var study = (await _dicomStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId, true)).IfNullThrowException();
study.BodyPartForEdit = updateModalityCommand.BodyPart;
@ -890,7 +1083,7 @@ namespace IRaCIS.Core.Application.Image.QA
//---CRC已经提交不允许删除。
return ResponseOutput.NotOk(_localizer["QCOperation_CrcNoDelete"]);
}
var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id)).ToListAsync();
var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id), false, true).ToListAsync();
foreach (var study in waitDeleteStudyList)
{
@ -907,30 +1100,12 @@ namespace IRaCIS.Core.Application.Image.QA
await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new SCPStudy() { SubjectVisitId = null });
if (fisrtPath.IsNotNullOrEmpty())
{
var prefix = fisrtPath.Substring(1, fisrtPath.LastIndexOf('/') - 1);
var prefix = fisrtPath.Substring(1, fisrtPath.LastIndexOf('/') - 1);
await _oSSService.DeleteFromPrefix(prefix, true);
//var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id, true);
//var success4 = await _repository.BatchDeleteAsync<StudyMonitor>(t => t.StudyId == id);
//删除 物理文件
//var instancePathList = await _dicomInstanceRepository.Where(t => t.StudyId == id)
// .Select(t => t.Path).ToListAsync();
//instancePathList.ForEach(path =>
//{
// var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
// if (System.IO.File.Exists(physicalPath))
// {
// File.Delete(physicalPath);
// }
//});
await _oSSService.DeleteFromPrefix(prefix, true);
}
}
@ -1697,8 +1872,8 @@ namespace IRaCIS.Core.Application.Image.QA
//删除 软删除的物理文件
var instancePathList = await _dicomInstanceRepository.Where(t => (t.DicomSerie.IsDeleted || t.IsDeleted) && t.SubjectVisitId == subjectVisitId, false, true)
.Select(t => t.Path).ToListAsync();
var noneDicomFileList = await _noneDicomStudyFileRepository.Where(t => (t.NoneDicomStudy.IsDeleted ||t.IsDeleted) && t.NoneDicomStudy.SubjectVisitId == subjectVisitId, false, true)
.Select(t => t.Path).ToListAsync();
var noneDicomFileList = await _noneDicomStudyFileRepository.Where(t => (t.NoneDicomStudy.IsDeleted || t.IsDeleted) && t.NoneDicomStudy.SubjectVisitId == subjectVisitId, false, true)
.Select(t => t.Path).ToListAsync();
@ -1739,13 +1914,14 @@ namespace IRaCIS.Core.Application.Image.QA
//删除影像
await _dicomStudyRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _dicomSeriesRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _dicomInstanceRepository.BatchDeleteNoTrackingAsync(t => (t.DicomSerie.IsDeleted || t.IsDeleted) && t.SubjectVisitId == subjectVisitId);
await _dicomSeriesRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _noneDicomStudyFileRepository.BatchDeleteNoTrackingAsync(t => (t.NoneDicomStudy.IsDeleted || t.IsDeleted) && t.NoneDicomStudy.SubjectVisitId == subjectVisitId);
await _noneDicomStudyRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _noneDicomStudyRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _oSSService.DeleteObjects(instancePathList.Select(t => t.TrimStart('/')).ToList());
await _oSSService.DeleteObjects(noneDicomFileList.Select(t => t.TrimStart('/')).ToList());
}
@ -1800,8 +1976,12 @@ namespace IRaCIS.Core.Application.Image.QA
dbSubjectVisit.ReadingStatus = trialConfig.IsImageConsistencyVerification ? ReadingStatusEnum.ConsistencyCheck : ReadingStatusEnum.TaskAllocate;
//删除影像
await _dicomStudyRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _dicomInstanceRepository.BatchDeleteNoTrackingAsync(t => (t.DicomSerie.IsDeleted || t.IsDeleted) && t.SubjectVisitId == subjectVisitId);
await _dicomSeriesRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _noneDicomStudyFileRepository.BatchDeleteNoTrackingAsync(t => (t.NoneDicomStudy.IsDeleted || t.IsDeleted) && t.NoneDicomStudy.SubjectVisitId == subjectVisitId);
await _noneDicomStudyRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted && t.SubjectVisitId == subjectVisitId);
await _oSSService.DeleteObjects(instancePathList.Select(t => t.TrimStart('/')).ToList());
await _oSSService.DeleteObjects(noneDicomFileList.Select(t => t.TrimStart('/')).ToList());
}
@ -2145,6 +2325,19 @@ namespace IRaCIS.Core.Application.Image.QA
{
var qcChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException();
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == qcChallenge.SubjectVisitId)).IfNullThrowException();
if (await _subjectVisitRepository.Where(t => t.Id == sv.Id).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)))
{
// 该访视已在其他途径申请影像回退中,不允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack)
{
// 该访视已在其他途径申请影像回退中,不允许申请
throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]);
}
if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.None && qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.CRCReuploaded)
{

View File

@ -528,6 +528,7 @@ namespace IRaCIS.Core.Application.Service
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count > 0)
|| t.PreviousSurgeryList.Any()))
.ForMember(d => d.DicomStudyCount, u => u.MapFrom(t => t.StudyList.Count()))
.ForMember(d => d.IsImageBackApplying, u => u.MapFrom(t => t.SubjectVisitImageBackRecordList.Any(c => c.ImageBackState == ImageBackStateEnum.None)))
.ForMember(d => d.NoneDicomStudyCount, u => u.MapFrom(t => t.NoneDicomStudyList.Count(t => t.NoneDicomFileList.Any())));
//CRC 上传列表
@ -555,6 +556,7 @@ namespace IRaCIS.Core.Application.Service
//.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum))
//.ForMember(d => d.VisitDay, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitDay : t.VisitDay))
.ForMember(d => d.DicomStudyCount, u => u.MapFrom(t => t.StudyList.Count()))
.ForMember(d => d.IsImageBackApplying, u => u.MapFrom(t => t.SubjectVisitImageBackRecordList.Any(c => c.ImageBackState == ImageBackStateEnum.None)))
.ForMember(d => d.NoneDicomStudyCount, u => u.MapFrom(t => t.NoneDicomStudyList.Count(t => t.NoneDicomFileList.Any())));
//.ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count()));
CreateMap<Subject, QCCRCVisitViewModel>();
@ -731,12 +733,22 @@ namespace IRaCIS.Core.Application.Service
Guid? visiTaskId = null;
CreateMap<NoneDicomStudy, TaskDicomStudyView>()
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s =>
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => isFilterZip ? !t.FileType.Contains(StaticData.FileType.Zip):true)
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s =>
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => isFilterZip ? !t.FileType.Contains(StaticData.FileType.Zip) : true)
.Where(t => isReading ? t.IsReading && t.IsDeleted == false : true)
.OrderBy(t => t.CreateTime).ThenBy(t => t.FileName)))
.OrderBy(t => t.CreateTime).ThenBy(t => t.FileName)))
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
CreateMap<SubjectVisitImageBackRecord, ImageBackViewModel>()
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code))
.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.SubjectVisit.VisitNum))
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode))
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
.ForMember(d => d.IsUrgent, u => u.MapFrom(s => s.SubjectVisit.IsUrgent))
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.UserName))
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName));
}
}

View File

@ -291,6 +291,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public List<string> SheetNames { get; set; }
}
public class TestOncologyDto
{
public Guid Id { get; set; }
public string TargetLesion { get; set; }
public string NonTargetLesions { get; set; }
public string NewLesion { get; set; }
public string OverallEfficacy { get; set; }
}
/// <summary>
/// 阅片计算Dto
/// </summary>

View File

@ -877,6 +877,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class CopyTableAnswerRowInfo : ReadingTableAnswerRowInfoBase
{
public Guid OriginalId { get; set; }
public LesionType? LesionType { get; set; }
}
public class CopyTableAnswerDto
{
@ -1852,6 +1854,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsBaseLine { get; set; }
/// <summary>
/// 阅片版本
/// </summary>
public ReadingVersion ReadingVersionEnum { get; set; }
public List<string> ReadingToolList { get; set; } = new List<string>();
public ReadingCategory ReadingCategory { get; set; }
public decimal VisitNum { get; set; }

View File

@ -792,6 +792,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public int? DigitPlaces { get; set; } = 2;
/// <summary>
/// 阅片版本
/// </summary>
public ReadingVersion? ReadingVersionEnum { get; set; }
}

View File

@ -16,6 +16,7 @@ namespace IRaCIS.Core.Application.Service.RC
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswer,
IRepository<Dictionary> _dictionarRepository,
IRepository<ReadingCriterionPage> _readingCriterionPageRepository,
IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository,
IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository,
@ -384,7 +385,14 @@ namespace IRaCIS.Core.Application.Service.RC
[HttpPost]
public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionTrial(AddOrUpdateReadingQuestionCriterionTrialInDto indto)
{
if (indto.ReadingVersionEnum == null)
{
var dic = await _dictionarRepository.Where(x => x.Parent.Code == "ReadingVersion").ToListAsync();
var maxDic = dic.Select(x => int.Parse(x.Code)).Max();
indto.ReadingVersionEnum=(ReadingVersion)maxDic;
}
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
return ResponseOutput.Ok(entity.Id.ToString());
}
@ -654,9 +662,15 @@ namespace IRaCIS.Core.Application.Service.RC
List<ReadingQuestionCriterionTrial> needAddCriterionList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id) && x.IsEnable && !trialCriterionNames.Contains(x.CriterionName)).ProjectTo<ReadingQuestionCriterionTrial>(_mapper.ConfigurationProvider).ToListAsync();
List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
var dic = await _dictionarRepository.Where(x => x.Parent.Code == "ReadingVersion").ToListAsync();
var maxDic = dic.Select(x => int.Parse(x.Code)).Max();
needAddCriterionList.ForEach(x =>
{
//x.IsEnable = false;
x.ReadingVersionEnum = (ReadingVersion)maxDic;
x.TrialId = trialId;
x.ReadingQuestionCriterionSystemId = x.Id;
x.Id = NewId.NextGuid();

View File

@ -22,6 +22,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<CriterionNidusSystem> _criterionNidusSystemRepository,
IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository,
IReadingImageTaskService _iReadingImageTaskService,
IRepository<ReadingSystemCriterionDictionary> _readingSystemCriterionDictionaryRepository,
@ -961,7 +962,12 @@ namespace IRaCIS.Core.Application.Service
{
question.RelevanceId = copyNewQuestionList.Where(y => x.RelevanceId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddDatas.Add(question);
if (question.GroupId != null)
{
question.GroupId = copyNewQuestionList.Where(y => x.GroupId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddDatas.Add(question);
};
await _readingQuestionSystemRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == inDto.NewSystemCriterionId);
@ -970,14 +976,24 @@ namespace IRaCIS.Core.Application.Service
#region 表格问题
var newSystemTableQuestionList = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId)
.ProjectTo<ReadingTableQuestionSystemData>(_mapper.ConfigurationProvider).ToListAsync();
foreach (var question in newSystemTableQuestionList)
{
question.SystemCriterionId = inDto.NewSystemCriterionId;
question.Id = NewId.NextGuid();
}
var copeNewSystemTableQuestionList = newSystemTableQuestionList.Clone();
var needAddTableDatas = new List<ReadingTableQuestionSystemData>();
foreach (var x in newSystemTableQuestionList)
{
var tableQuestion = x.Clone();
tableQuestion.SystemCriterionId = inDto.NewSystemCriterionId;
tableQuestion.Id = NewId.NextGuid();
if (tableQuestion.ParentId != null)
tableQuestion.ReadingQuestionId = copyNewQuestionList.Where(y => x.ReadingQuestionId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
if (tableQuestion.ParentId != null)
{
tableQuestion.ParentId = copeNewSystemTableQuestionList.Where(y => x.ParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
@ -989,7 +1005,11 @@ namespace IRaCIS.Core.Application.Service
{
tableQuestion.DependParentId = copeNewSystemTableQuestionList.Where(y => x.DependParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddTableDatas.Add(tableQuestion);
if (tableQuestion.ClassifyTableQuestionId != null)
{
tableQuestion.ClassifyTableQuestionId = copeNewSystemTableQuestionList.Where(y => x.ClassifyTableQuestionId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddTableDatas.Add(tableQuestion);
}
await _readingTableQuestionSystemRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
await _readingTableQuestionSystemRepository.AddRangeAsync(needAddTableDatas);
@ -1035,7 +1055,17 @@ namespace IRaCIS.Core.Application.Service
#endregion
#region criterionNidus
var criterionNidusSystems = await _criterionNidusSystemRepository.Where(x => x.CriterionId == inDto.SourceSystemCriterionId).ToListAsync();
criterionNidusSystems.ForEach(x =>
{
x.Id = NewId.NextGuid();
x.CriterionId = inDto.NewSystemCriterionId;
});
await _criterionNidusSystemRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.NewSystemCriterionId);
await _criterionNidusSystemRepository.AddRangeAsync(criterionNidusSystems);
#endregion

View File

@ -1,4 +1,5 @@
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Helper;
@ -52,6 +53,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<ReadModule> _readModuleRepository,
IRepository<DicomInstance> _dicomInstanceRepository,
IRepository<OrganInfo> _organInfoRepository,
IRepository<OrganTrialInfo> _organTrialInfoRepository,
IRepository<TrialDocument> _trialDocumentRepository,
ILuganoCalculateService _luganoCalculateService,
IRepository<ReadingCustomTag> _readingCustomTagRepository,
@ -1647,14 +1649,7 @@ namespace IRaCIS.Core.Application.Service
QuestionMark.IsLymph,
};
tableAnswers.ForEach(x =>
{
x.Id = NewId.NextGuid();
x.RowIndex = newRowIndex;
x.VisitTaskId = inDto.VisitTaskId;
x.RowId = rowAnswer.Id;
x.Answer = needSaveMark.Contains(x.QuestionMark) ? x.Answer : string.Empty;
});
switch (taskInfo.TrialReadingCriterion.CriterionType)
{
@ -1701,7 +1696,27 @@ namespace IRaCIS.Core.Application.Service
x.Answer = needSetNa.Contains(x.QuestionMark) ? "NA" : x.Answer;
});
break;
case CriterionType.mRECISTHCC:
needSaveMark = new List<QuestionMark?>()
{
QuestionMark.Organ,
QuestionMark.Location,
QuestionMark.Part,
QuestionMark.IsLymph,
QuestionMark.TypicalIntrahepaticLesion,
};
break;
}
tableAnswers.ForEach(x =>
{
x.Id = NewId.NextGuid();
x.RowIndex = newRowIndex;
x.VisitTaskId = inDto.VisitTaskId;
x.RowId = rowAnswer.Id;
x.Answer = needSaveMark.Contains(x.QuestionMark) ? x.Answer : string.Empty;
});
await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer);
await _readingTableQuestionAnswerRepository.AddRangeAsync(_mapper.Map<List<ReadingTableQuestionAnswer>>(tableAnswers));
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId, x => new ReadingTableAnswerRowInfo()
@ -2245,6 +2260,7 @@ namespace IRaCIS.Core.Application.Service
}
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
inDto.BlindName = taskinfo.TaskBlindName;
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
switch (taskinfo.TrialReadingCriterion.CriterionType)
{
// 对于非靶病灶,如果状态选择为显著增大,请验证:
@ -2391,9 +2407,56 @@ namespace IRaCIS.Core.Application.Service
break;
case CriterionType.mRECISTHCC:
//var orginInfo=await _organTrialInfoRepository.Where(x =>x.TrialCriterionId== taskinfo.TrialReadingCriterionId&& x.OrganInfoId == inDto.OrganInfoId).FirstOrDefaultAsync();
//if (orginInfo != null && orginInfo.TULOCEN == "Liver")
//{
// var otherorganCount=await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.Id!=inDto.Id&&x.OrganInfo.TULOCEN == "Liver").CountAsync();
// if (otherorganCount >=2)
// {
// throw new BusinessValidationFailedException(_localizer["ReadingImageTask_HCCOrganRepeat"]);
// }
//}
// 如果当前添加 是 非靶病灶 并且 典型肝内病灶为 是 时 如果 靶病灶的典型肝内病灶 为是的 数量<2 给提示
// 验证去掉
//if (questionInfo.LesionType == LesionType.NonTargetLesions)
//{
// // 非靶病灶
// var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId && x.ReadingQuestionId == inDto.QuestionId).ToListAsync();
// // 判断表格问题是否为空
// var tableQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.TypicalIntrahepaticLesion).FirstOrDefault();
// if (tableQuestion != null)
// {
// if (inDto.AnswerList.Where(x => x.TableQuestionId == tableQuestion.Id).Select(x => x.Answer).FirstOrDefault().EqEnum(ReadingYesOrNo.Yes))
// {
// var yesString = ((int)(object)ReadingYesOrNo.Yes).ToString();
// var targetList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingQuestionTrial.LesionType == LesionType.TargetLesion
// && x.LesionAnswerList.Any(y => y.Answer == yesString && y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.TypicalIntrahepaticLesion)
// ).ToListAsync();
// if (targetList.Count() < 2)
// {
// throw new BusinessValidationFailedException(_localizer["ReadingImageTask_PriorityTarget"]);
// }
// }
// }
//}
break;
}
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
@ -3114,9 +3177,11 @@ namespace IRaCIS.Core.Application.Service
x.IsReadingShowPreviousResults,
x.IsReadingShowSubjectInfo,
x.DigitPlaces,
x.ReadingVersionEnum,
x.CriterionType,
x.IseCRFShowInDicomReading,
x.IsReadingTaskViewInOrder,
x.ReadingToolList,
}).FirstNotNullAsync();
task.IsReadingShowPreviousResults = criterionInfo.IsReadingShowPreviousResults;
@ -3172,6 +3237,8 @@ namespace IRaCIS.Core.Application.Service
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
task.IsShowStudyName= trialInfo.IsShowStudyName;
task.IsBaseLine = isBaseLine;
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
task.ReadingToolList = criterionInfo.ReadingToolList;
task.IsExistUnprocessedFeedback = await _userFeedBackRepository.AnyAsync(x => x.VisitTaskId == task.VisitTaskId && x.State == 0);
// 添加默认答案
if (inDto.VisitTaskId == null && visitTaskInfo.ReadingTaskState != ReadingTaskState.HaveSigned)

View File

@ -166,7 +166,8 @@ namespace IRaCIS.Core.Application.Service
CreateMap<CopyTableAnswerRowInfo, ReadingTableAnswerRowInfo>().ForMember(dest => dest.CreateUserRole, opt => opt.Ignore());
CreateMap<ReadingTableAnswerRowInfo, CopyTableAnswerRowInfo>()
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id))
.ForMember(d => d.LesionType, u => u.MapFrom(s => s.ReadingQuestionTrial.LesionType));
//.ForMember(dest => dest.Instance, opt => opt.Ignore())
//.ForMember(dest => dest.ReadingQuestionTrial, opt => opt.Ignore());

View File

@ -33,6 +33,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{CriterionType.IVUS,typeof(IVUSCalculateService) },
{CriterionType.OCT,typeof(OCTCalculateService) },
{CriterionType.MRIPDFF,typeof(MRIPDFFCalculateService) },
{CriterionType.mRECISTHCC,typeof(MRECISTHCCCalculateService) },
};

File diff suppressed because it is too large Load Diff

View File

@ -114,6 +114,19 @@ namespace IRaCIS.Core.Application.Contracts
{
}
public class ImageBackToBeDoneQuery : PageInput
{
}
public class ImageBackToBeDoneDto: TrialBaseInfoDto
{
public int? ToBeApprovalCount { get; set; }
}
public class ReviewerSelectToBeDoneDto : TrialBaseInfoDto
{
public bool IsUrgent { get; set; }
@ -402,6 +415,8 @@ namespace IRaCIS.Core.Application.Contracts
public int? PM_ClinicalDataCount { get; set; }
public int? PM_ImageBackApprovalCount { get; set; }
#endregion
#region CRC

View File

@ -376,6 +376,13 @@ namespace IRaCIS.Core.Application.Contracts
public class GetTrialReadingInfoOutDto
{
public ReadingVersion ReadingVersionEnum { get; set; }
/// <summary>
/// 阅片工具
/// </summary>
public List<string> ReadingToolList { get; set; }
public string TrialModalitys { get; set; }
public bool IsImageFilter { get; set; }
@ -901,6 +908,8 @@ namespace IRaCIS.Core.Application.Contracts
public class SetCriterionReadingInfoInDto
{
public List<string> ReadingToolList { get; set; } = new List<string>() { };
public bool IsImageFilter { get; set; }
public string CriterionModalitys { get; set; }

View File

@ -16,6 +16,7 @@ namespace IRaCIS.Core.Application
IRepository<SystemDocument> _systemDocumentRepository,
IClinicalAnswerService _clinicalAnswerService,
IRepository<SystemNotice> _systemNoticeRepository,
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
{
@ -213,7 +214,7 @@ namespace IRaCIS.Core.Application
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ;
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount });
}
@ -259,6 +260,32 @@ namespace IRaCIS.Core.Application
return ResponseOutput.Ok(result, new { ToBeApprovalCount = all.Sum(x => x.ToBeApprovalCount) }); ;
}
[HttpPost]
public async Task<IResponseOutput<PageOutput<ImageBackToBeDoneDto>>> GetPMImageBackToBeDoneList(ImageBackToBeDoneQuery inQuery)
{
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Select(t => new ImageBackToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
ToBeApprovalCount = t.SubjectVisitList.SelectMany(u => u.SubjectVisitImageBackRecordList.Where(t=>t.ImageBackState==ImageBackStateEnum.None)).Count()
}).Where(x => x.ToBeApprovalCount > 0);
var defalutSortArray = new string[] { nameof(ImageBackToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
return ResponseOutput.Ok(result);
}
#endregion
@ -1223,6 +1250,14 @@ namespace IRaCIS.Core.Application
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Where(t => t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count() > 0).CountAsync() : 0,
PM_ImageBackApprovalCount = isPM ? await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Where(t=>t.SubjectVisitList.SelectMany(u=>u.SubjectVisitImageBackRecordList).Any(t=>t.ImageBackState==ImageBackStateEnum.None)).CountAsync():0,
//await _subjectVisitImageBackRecordReposiotry.Where(t => t.SubjectVisit.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
//.Where(t => t.SubjectVisit.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
//.CountAsync() : 0,
#endregion
#region CRC
@ -1391,94 +1426,94 @@ namespace IRaCIS.Core.Application
var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
.WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP,
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false)
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialIdentityUserList.Any(t => t.IdentityUser.EMail.Contains(inQuery.PM_EMail)))
.Select(t => new TrialToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
CreateTime = t.CreateTime,
Sponsor = _userInfo.IsEn_Us ? t.Sponsor.SponsorName : t.Sponsor.SponsorNameCN,
TrialStatusStr = t.TrialStatusStr,
var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
.WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP,
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false)
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialIdentityUserList.Any(t => t.IdentityUser.EMail.Contains(inQuery.PM_EMail)))
.Select(t => new TrialToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
CreateTime = t.CreateTime,
Sponsor = _userInfo.IsEn_Us ? t.Sponsor.SponsorName : t.Sponsor.SponsorNameCN,
TrialStatusStr = t.TrialStatusStr,
ExpetiedTaskCount = isPM ? t.VisitTaskList.Where(t => t.IsUrgent && t.IsAnalysisCreate==false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)).Count() : 0,
ExpetiedTaskCount = isPM ? t.VisitTaskList.Where(t => t.IsUrgent && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)).Count() : 0,
ReReadingApprovalCount = isPM ? t.VisitTaskReReadingList.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count() : 0,
ReReadingApprovalCount = isPM ? t.VisitTaskReReadingList.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count() : 0,
PendingReconciliationCount = isPM ? t.SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck).Count() : 0,
PendingReconciliationCount = isPM ? t.SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck).Count() : 0,
PendingResponseCount = isPM ? t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
PendingResponseCount = isPM ? t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
SPM_ReReadingApprovalCount = isSPMOrCPM ? t.VisitTaskReReadingList.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count() : 0,
SPM_ReReadingApprovalCount = isSPMOrCPM ? t.VisitTaskReReadingList.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count() : 0,
SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0,
SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0,
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.VisitTask.IsUrgent &&
u.AuditState != MedicalReviewAuditState.HaveSigned).Count() : 0,
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.VisitTask.IsUrgent &&
u.AuditState != MedicalReviewAuditState.HaveSigned).Count() : 0,
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0,
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0,
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0,
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0,
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId) && t.IsUrgent).Count() : 0,
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId) && t.IsUrgent).Count() : 0,
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0,
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0,
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0,
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0,
//待审核 审核中 加急的数量
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
//待审核 审核中 加急的数量
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
//审核未完成
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
//审核未完成
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
//质疑待处理
IQC_QuestionToBeDealedCount = isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
//质疑待处理
IQC_QuestionToBeDealedCount = isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
//待领取
IQC_ToBeClaimedCount = isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count() : 0,
//待领取
IQC_ToBeClaimedCount = isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count() : 0,
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
IR_PMEmailList = isIR ? t.TrialUserRoleList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.IdentityUser.EMail).Select(t => t.UserRole.IdentityUser.EMail).ToList() : null,
IR_PMEmailList = isIR ? t.TrialUserRoleList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.IdentityUser.EMail).Select(t => t.UserRole.IdentityUser.EMail).ToList() : null,
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
IR_UnReadCount = isIR ? t.VisitTaskList
.Where(c => c.DoctorUserId == _userInfo.UserRoleId && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
IR_UnReadCount = isIR ? t.VisitTaskList
.Where(c => c.DoctorUserId == _userInfo.UserRoleId && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0,
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0,
IR_UrgentCount = isIR ? t.VisitTaskList.Where(t => t.SourceSubjectVisit.IsUrgent).Count() : 0,
IR_UrgentCount = isIR ? t.VisitTaskList.Where(t => t.SourceSubjectVisit.IsUrgent).Count() : 0,
});
});

View File

@ -562,6 +562,7 @@ namespace IRaCIS.Core.Application
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
{
ReadingToolList=inDto.ReadingToolList,
IsImageFilter = inDto.IsImageFilter,
ImageDownloadEnum = inDto.ImageDownloadEnum,
ImageUploadEnum = inDto.ImageUploadEnum,

View File

@ -13,6 +13,7 @@ using Microsoft.Extensions.Options;
using NPOI.SS.Formula.Functions;
using Panda.DynamicWebApi.Attributes;
using ZiggyCreatures.Caching.Fusion;
using static IRaCIS.Core.Domain.Share.StaticData;
namespace IRaCIS.Core.Application.Service
{
@ -105,11 +106,43 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect()
{
// SuperAdmin Admin OP
List<int> sap = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP };
// pm
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
// QA EA
List<int> qAEq= new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
List<int> other = new List<int>() { };
other.AddRange(sap);
other.AddRange(pm);
other.AddRange(qAEq);
List<string> trialState = new List<string>() { StaticData.TrialState.TrialOngoing, StaticData.TrialState.TrialCompleted, StaticData.TrialState.TrialStopped };
return await _trialRepository.AsQueryable()
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP,
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && t.IsDeleted == false)
.Where(t=>t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))
&& (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager))
//SuperAdmin Admin OP
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=> trialState.Contains(x.TrialStatusStr))
// pm
.WhereIf(pm.Contains(_userInfo.UserTypeEnumInt),t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false)
// QA EA
.WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false && trialState.Contains(t.TrialStatusStr))
// other
.WhereIf(!other.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false&& t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
}

View File

@ -149,8 +149,8 @@ namespace IRaCIS.Core.Application.Services
public async Task<List<TrialSiteSelect>> GetTrialSiteSelectList(string? siteName)
{
var list = _siteRepository
.WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName))
.Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us ? t.SiteName : t.SiteNameCN, AliasName = t.AliasName })
.WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName))
.Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us ? t.SiteName : t.SiteNameCN, AliasName = t.AliasName }).ToList()
.OrderBy(x=>x.SiteName)
.ToList();

View File

@ -435,7 +435,7 @@ namespace IRaCIS.Core.Application.Service
//变更某一访视计划Item 受试者访视相关字段
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.VisitStageId == changedItem.Id, k => new SubjectVisit()
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.VisitStageId == changedItem.Id, k => new SubjectVisit()
{
IsBaseLine = changedItem.IsBaseLine,
VisitName = changedItem.VisitName,

View File

@ -218,7 +218,7 @@ namespace IRaCIS.Core.Application.Service
TrialReadingCriterionList = intoGroup.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, IsOncologyReading = t.IsOncologyReading, IsArbitrationReading = t.IsArbitrationReading, IsGlobalReading = t.IsGlobalReading, ReadingInfoSignTime = t.ReadingInfoSignTime, ReadingType = t.ReadingType }).ToList(),
DoctorCriterionStatusList = intoGroup.EnrollReadingCriteriaList.Select(t => new DoctorCriterionStatus()
DoctorCriterionStatusList = intoGroup.EnrollReadingCriteriaList.Where(t=>t.TrialReadingCriterion.IsConfirm).Select(t => new DoctorCriterionStatus()
{
EnrollId = t.Id,
Id = t.Id,
@ -228,9 +228,9 @@ namespace IRaCIS.Core.Application.Service
CriterionReadingCategoryList = intoGroup.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
CriterionReadingCategoryList = intoGroup.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterion.IsConfirm).Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
CriterionFileList = doctor.CriterionFileList.Where(x => x.IsEnable && (x.TrialId == null || x.TrialId == trialId)).Select(x => new CriterionFile()
CriterionFileList = doctor.CriterionFileList.Where(t => t.TrialReadingCriterion.IsConfirm).Where(x => x.IsEnable && (x.TrialId == null || x.TrialId == trialId)).Select(x => new CriterionFile()
{
CriterionType = x.CriterionType,
DoctorId = x.DoctorId,
@ -242,7 +242,7 @@ namespace IRaCIS.Core.Application.Service
Id = x.Id
}).ToList(),
ReadingTaskStateList = intoGroup.DoctorUser.VisitTaskList.Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
ReadingTaskStateList = intoGroup.DoctorUser.VisitTaskList.Where(t => t.TrialReadingCriterion.IsConfirm).Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
{
ReadingTaskState = x.ReadingTaskState,
TrialReadingCriterionId = x.TrialReadingCriterionId,

View File

@ -16,6 +16,7 @@ using IRaCIS.Core.Infrastructure.Encryption;
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
using MassTransit;
using MassTransit.Mediator;
using MaxMind.GeoIP2;
using Medallion.Threading;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
@ -95,6 +96,38 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok();
}
[AllowAnonymous]
public async Task<IResponseOutput> NewIP([FromServices] IRepository<UserLog> _userLogRepository, [FromServices] IRepository<IdentityUser> _identityUserRepository)
{
var path = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "GeoLite2-City.mmdb");
var ipList = _userLogRepository.Select(t => t.IP).Distinct().ToList();
foreach (var ip in ipList)
{
var ipRegion = IPCityHelper.GetCityResponse(ip);
await _userLogRepository.BatchUpdateNoTrackingAsync(t => t.IP == ip, u => new UserLog() { IPRegion = ipRegion });
}
#region 用户表最后一次登录的ipRegion 需要维护
var userList = _identityUserRepository.Where(t => t.LastLoginIP != "").Select(t => new { t.Id, t.LastLoginIP, t.UpdateUserId }).ToList();
foreach (var user in userList)
{
var lastLoginRegion = _userLogRepository.Where(t => t.ActionIdentityUserId == user.Id && (t.OptType == UserOptType.Login || t.OptType == UserOptType.LoginLockedAccount)).OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefault()??string.Empty;
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == user.Id, u => new Domain.Models.IdentityUser() { LastLoginIP = lastLoginRegion, UpdateUserId = user.UpdateUserId });
}
#endregion
return ResponseOutput.Ok();
}
/// <summary>
/// IQC 回退到影像上传
@ -232,6 +265,62 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// 后端处理某个中心缩略图有问题 先下载,生成缩略图上传,然后更新数据库
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public async Task<IResponseOutput> BackImageResize(Guid trialSiteId, Guid subjectId/* , [FromServices] IRepository<>*/)
{
///${params.trialId}/ Image /${params.subjectId}/${params.subjectVisitId}/${ dicomInfo.studyUid}/${ v.seriesUid}.jpg
var dealSeriesList = await _dicomSeriesRepository.Where(t => t.DicomStudy.Subject.TrialSiteId == trialSiteId && t.SubjectId == subjectId).Select(t => new { t.Id, t.SubjectId, t.TrialId, t.SubjectVisitId, t.StudyInstanceUid, t.SeriesInstanceUid, t.ImageResizePath, t.UpdateUserId, FirstInstancePath = t.DicomInstanceList.First().Path }).ToListAsync();
//下载到本地
string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
Directory.CreateDirectory(tempFolderPath);
foreach (var dealSeries in dealSeriesList)
{
var fileName = Path.GetFileNameWithoutExtension(dealSeries.FirstInstancePath);
var localFilePath = Path.Combine(tempFolderPath, fileName);
await _IOSSService.DownLoadFromOSSAsync(dealSeries.FirstInstancePath, localFilePath);
var resizePath = localFilePath + "_New.jpg";
//生成缩略图
// 读取 DICOM 文件
var dicomImage = new DicomImage(localFilePath);
// 渲染 DICOM 图像到 ImageSharp 格式
using (var image = dicomImage.RenderImage().AsSharpImage())
{
// 生成缩略图(调整大小)
image.Mutate(x => x.Resize(500, 500));
// 保存缩略图为 JPEG
image.Save(resizePath, new JpegEncoder());
}
var ossFolder = $"{dealSeries.TrialId}/Image/{dealSeries.SubjectId}/{dealSeries.SubjectVisitId}/{dealSeries.StudyInstanceUid}";
var relativePath = await _IOSSService.UploadToOSSAsync(resizePath, ossFolder, false);
await _dicomSeriesRepository.BatchUpdateNoTrackingAsync(t => t.Id == dealSeries.Id, u => new DicomSeries() { ImageResizePath = relativePath, UpdateUserId = dealSeries.UpdateUserId });
}
return ResponseOutput.Ok();
}
public async Task<IResponseOutput> DeleteOSSDate(string rootFolder,
[FromServices] IOSSService _oSSService, [FromServices] IWebHostEnvironment _hostEnvironment)
{

View File

@ -1,5 +1,7 @@
using EntityFrameworkCore.Triggered;
using IP2Region.Net.Abstractions;
using IRaCIS.Core.Application.Helper;
using MaxMind.GeoIP2;
namespace IRaCIS.Core.Application.Triggers
{
@ -18,10 +20,11 @@ namespace IRaCIS.Core.Application.Triggers
if (context.ChangeType == ChangeType.Added)
{
var ipinfo = _searcher.Search(userLog.IP);
//var ipinfo = _searcher.Search(userLog.IP);
userLog.IPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
//userLog.IPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
userLog.IPRegion = IPCityHelper.GetCityResponse(userLog.IP);
}
}

View File

@ -89,10 +89,13 @@ namespace IRaCIS.Core.Domain.Share
//不登陆通过邮箱重置密码
UnloginUseEmailResetPassword = 23,
//影像异常反馈
IRImageError=24,
//系统反馈
SysFeedBack=26,
//项目反馈
TrialFeedBack=27,
TrialSubjectVisitFeedBack = 28,
@ -243,6 +246,74 @@ namespace IRaCIS.Core.Domain.Share
/// </summary>
Reviewer_CV_Collection = 57,
/// <summary>
/// 通用培训 - 生效通知
/// </summary>
GeneralTraining_EffectiveNotification=58,
/// <summary>
/// 通用培训 - 到期通知
/// </summary>
GeneralTraining_ExpirationNotification = 59,
/// <summary>
/// 影像质疑-CRC申请重传
/// </summary>
ImageQueryCRCApplyRe_Uploading = 60,
/// <summary>
/// 影像质疑-IQC审批重传
/// </summary>
ImageQuery_IQCApprovalRe_Uploading = 61,
/// <summary>
/// 一致性核查 - CRC审批重传
/// </summary>
DataReconciliation_CRCApplyRe_Uploading = 62,
/// <summary>
/// 一致性核查 - PM审批重传
/// </summary>
DataReconciliation_PMApprovalRe_Uploading = 63,
/// <summary>
/// 影像质控 - IQC申请重传
/// </summary>
ImageQC_IQCApplyRe_Uploading = 64,
/// <summary>
/// 影像上传-CRC申请重传
/// </summary>
ImageUploadCRCApplyRe_Uploading = 65,
/// <summary>
/// 影像重传-PM审批重传
/// </summary>
ImageReUpload_PMApprovalRe_Uploading = 66,
/// <summary>
/// 阅片跟踪-PM 申请重阅
/// </summary>
ReadTracking_PMApplyRe_Reading = 67,
/// <summary>
/// 重阅审批-SPM/CPM 审批重阅审批
/// </summary>
Re_ReadApproval_SPMCPMApprovalRe_Reading = 68,
/// <summary>
/// 阅片人筛选-PM申请审批
/// </summary>
ReviewerSelection_PMApplyApproving = 69,
/// <summary>
/// 阅片人筛选-SPM 审批
/// </summary>
ReviewerSelection_SPMCPMApproval = 70,
}

View File

@ -16,7 +16,29 @@ namespace IRaCIS.Core.Domain.Share
//PM 已同意 CRC
PM_AgressBack = 2,
PM_NotAgree=3,
PM_NotAgree = 3,
}
/// <summary>
/// 申请角色
/// </summary>
public enum ImageBackApplyEnum
{
CRCRequestBack = 1,
IQCRequestBack = 2,
}
/// <summary>
/// 审核状态
/// </summary>
public enum ImageBackStateEnum
{
None = 0,
PMAgreeBack = 1,
PMNotAgreeBack = 2,
}
}

View File

@ -2205,6 +2205,12 @@ public enum SUVChangeVSBaseline
/// </summary>
SUVmax = 20,
/// <summary>
/// 典型肝内病灶
/// </summary>
TypicalIntrahepaticLesion = 21,
/// <summary>
/// 外弹力膜面积
/// </summary>

View File

@ -9,6 +9,10 @@ public class DoctorCriterionFile : BaseAddAuditEntity
[JsonIgnore]
[ForeignKey("DoctorId")]
public Doctor Doctor { get; set; }
[JsonIgnore]
[ForeignKey("TrialReadingCriterionId")]
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }
#endregion
public string CriterionName { get; set; } = null!;

View File

@ -9,6 +9,10 @@ public class EnrollReadingCriterion : BaseAddAuditEntity
[JsonIgnore]
[ForeignKey("EnrollId")]
public Enroll Enroll { get; set; }
[JsonIgnore]
[ForeignKey("TrialReadingCriterionId")]
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }
#endregion
public Guid EnrollId { get; set; }

View File

@ -0,0 +1,83 @@
using IRaCIS.Core.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Domain.Models
{
[Comment("稽查文档管理")]
[Table("AuditDocument")]
public class AuditDocument : BaseFullAuditEntity
{
/// <summary>
/// 文件夹名或者文件名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 文档类型
/// </summary>
public AuditDocumentType AuditDocumentTypeEnum { get; set; }
/// <summary>
/// 父文件夹Id
/// </summary>
public Guid? ParentId { get; set; }
/// <summary>
/// 文件路径
/// </summary>
[StringLength(1000)]
public string FilePath { get; set; } = string.Empty;
/// <summary>
/// 文件大小
/// </summary>
public decimal? FileSize { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public string FileFormat { get; set; } = string.Empty;
/// <summary>
/// 版本
/// </summary>
public int? Version { get; set; }
/// <summary>
/// 主文件Id
/// </summary>
public Guid? MainFileId { get; set; }
/// <summary>
/// 是否授权
/// </summary>
public bool IsAuthorization { get; set; } = false;
}
/// <summary>
/// 稽查文档类型
/// </summary>
public enum AuditDocumentType
{
/// <summary>
/// 文件夹
/// </summary>
Folder = 0,
/// <summary>
/// 文件
/// </summary>
File = 1,
/// <summary>
/// 历史版本
/// </summary>
HistoricalVersion = 2,
}
}

View File

@ -1,3 +1,5 @@
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Domain.Models;
[Comment("后台 - 系统签署文档")]
@ -7,6 +9,10 @@ public class SystemDocument : BaseFullDeleteAuditEntity
#region 导航属性
[JsonIgnore]
public List<SystemDocConfirmedIdentityUser> SystemDocConfirmedUserList { get; set; }
[JsonIgnore]
public List<SystemDocumentAttachment> SystemDocumentAttachmentList { get; set; }
[JsonIgnore]
public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
[JsonIgnore]
@ -22,6 +28,68 @@ public class SystemDocument : BaseFullDeleteAuditEntity
public string Path { get; set; } = string.Empty;
public DocUserSignType DocUserSignType { get; set; }
/// <summary>
/// 现有员工培训天数
/// </summary>
public int? CurrentStaffTrainDays { get; set; }
/// <summary>
/// 新员工培训天数
/// </summary>
public int? NewStaffTrainDays { get; set; }
/// <summary>
/// 是否发布
/// </summary>
public bool IsPublish { get; set; } = true;
}
[Comment("后台 - 系统签署文档附件")]
[Table("SystemDocumentAttachment")]
public class SystemDocumentAttachment : BaseFullAuditEntity
{
[JsonIgnore]
[ForeignKey("SystemDocumentId")]
public SystemDocument SystemDocument { get; set; }
/// <summary>
/// 系统文档Id
/// </summary>
public Guid SystemDocumentId { get; set; }
public string Name { get; set; } = string.Empty;
/// <summary>
/// 文件名称
/// </summary>
public string FileName { get; set; } = string.Empty;
/// <summary>
/// 是否下线
/// </summary>
public bool OffLine { get; set; }
/// <summary>
/// 文件路径
/// </summary>
[StringLength(1000)]
public string FilePath { get; set; } = string.Empty;
/// <summary>
/// 文件大小
/// </summary>
public decimal? FileSize { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public string FileFormat { get; set; } = string.Empty;
}
public enum DocUserSignType

View File

@ -39,6 +39,29 @@ public enum ArchiveType
}
/// <summary>
/// 文档模板
/// </summary>
public enum SysTemplateType
{
/// <summary>
/// Elevate
/// </summary>
Elevate = 1,
/// <summary>
/// Extensive
/// </summary>
Extensive = 2,
/// <summary>
/// Both
/// </summary>
Both = 3,
}
/// <summary>
/// 文档子类标识
@ -105,6 +128,11 @@ public class SysFileType : BaseFullAuditEntity
/// </summary>
public int ShowOrder { get; set; }
/// <summary>
/// 文档类型
/// </summary>
public SysTemplateType SysTemplateTypeEnum { get; set; } = SysTemplateType.Extensive;
}
[Comment("项目文件 - 文件类型表")]

View File

@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="EntityFrameworkCore.Projectables.Abstractions" Version="3.0.4" />
<PackageReference Include="MassTransit" Version="8.3.0" />
<PackageReference Include="MassTransit" Version="8.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View File

@ -44,6 +44,9 @@ public class UserLog : BaseAddAuditEntity
[Comment("异地登录")]
public bool IsLoginUncommonly { get; set; }
[Comment("是否忽略异地登录")]
public bool IsIgnoreUncommonly { get; set; }
#region 后续删除

View File

@ -161,6 +161,34 @@ public class ReadingQuestionCriterionTrial : BaseAddAuditEntity
[Comment("是否影像筛选")]
public bool IsImageFilter { get; set; }
/// <summary>
/// 阅片版本
/// </summary>
public ReadingVersion ReadingVersionEnum { get; set; } = ReadingVersion.RT0;
/// <summary>
/// 阅片工具
/// </summary>
public List<string> ReadingToolList { get; set; } = new List<string>();
}
/// <summary>
/// 阅片版本
/// </summary>
public enum ReadingVersion
{
/// <summary>
/// RT0
/// </summary>
RT0 = 0,
/// <summary>
/// RT1
/// </summary>
RT1 = 1,
}
public enum ReadingImageDownload

View File

@ -9,6 +9,10 @@ public class EnrollReadingCategory : BaseAddAuditEntity
[JsonIgnore]
[ForeignKey("EnrollId")]
public Enroll Enroll { get; set; }
[JsonIgnore]
[ForeignKey("TrialReadingCriterionId")]
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }
#endregion
public Guid EnrollId { get; set; }
public ReadingCategory ReadingCategory { get; set; }

View File

@ -70,6 +70,9 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
[JsonIgnore]
public List<SubjectCriteriaEvaluationVisitFilter> SubjectCriteriaEvaluationVisitFilterList { get; set; }
[JsonIgnore]
public List<SubjectVisitImageBackRecord> SubjectVisitImageBackRecordList { get; set; }
#endregion
public Guid TrialSiteId { get; set; }
@ -161,6 +164,7 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public DateTime? CheckPassedTime { get; set; }
[Comment("计划外上一访视")]
public Guid? OutPlanPreviousVisitId { get; set; }
[Comment("一致性核查 回退")]
public RequestBackStateEnum RequestBackState { get; set; }
public bool IsQCConfirmedReupload { get; set; }
@ -180,5 +184,34 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public Guid? SubmitUserId { get; set; }
public ReadingStatusEnum ReadingStatus { get; set; }
}
[Comment("受试者访视影像回退记录表")]
[Table("SubjectVisitImageBackRecord")]
public class SubjectVisitImageBackRecord : BaseFullAuditEntity
{
[JsonIgnore]
public SubjectVisit SubjectVisit { get; set; }
public Guid SubjectVisitId { get; set; }
public DateTime? SubmitTime { get; set; }
public DateTime? EarliestScanDate { get; set; }
[Comment("最晚拍片日期")]
public DateTime? LatestScanDate { get; set; }
public ImageBackApplyEnum ApplyUserRole { get; set; }
[Comment("影像上传 回退")]
public ImageBackStateEnum ImageBackState { get; set; }
public DateTime? AuditTime { get; set; }
}

View File

@ -0,0 +1,69 @@
using IRaCIS.Core.Domain.BaseModel;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Domain._DomainEvent
{
/// <summary>
/// 直接申请流程 IQC申请PM/APM审批通知IQC和CRCCRC申请PM/APM审批通知CRC SubjectVisitImageBackRecord表
/// </summary>
public class DirectApplyReupdloadEvent : DomainEvent
{
public Guid SubjectVisitId { get; set; }
public ImageBackApplyEnum ApplyUserRole { get; set; }
public ImageBackStateEnum ImageBackState { get; set; }
}
/// <summary>
/// 正常业务流程申请重传审批 一致性核查 CRC申请 CRC申请PM/APM审批通知CRC SubjectVisit表
/// </summary>
public class CheckReuploadEvent : DomainEvent
{
public Guid SubjectVisitId { get; set; }
[Comment("一致性核查 回退")]
public RequestBackStateEnum RequestBackState { get; set; }
}
/// <summary>
///正常业务流程申请重传审批 质疑CRC 申请 (CRC申请IQC审批通知CRC) QCChallenge表
/// </summary>
public class QCChanllengeReuploadEvent : DomainEvent
{
public Guid SubjectVisitId { get; set; }
public QCChanllengeReuploadEnum ReuploadEnum { get; set; }
}
/// <summary>
///针对于已阅的任务 PM 申请, SPM/CPM审批通知PM/阅片人
/// </summary>
public class HaveReadVisitTaskReReading : DomainEvent
{
public Guid SubjectId { get; set; }
public Guid VisitTaskId { get; set; }
public ReReadingApplyState ReReadingApplyState { get; set; }
}
/// <summary>
///针对于未阅的任务 PM直接退回通知CRC --这里废弃 ,没有审批流程,不做
/// </summary>
public class UnReadVisitTaskReReadingApproval : DomainEvent
{
public Guid SubjectVisitId { get; set; }
}
}

View File

@ -0,0 +1,35 @@
using IRaCIS.Core.Domain.BaseModel;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Domain._DomainEvent
{
/// <summary>
/// SPM审批通过通知PM Enroll表
/// </summary>
public class ReviewerSPMApprovedEvent : DomainEvent
{
public Guid TrialId { get; set; }
public List<Guid> EnrollIdList { get; set; }
/// <summary>
/// 有SPM 会从 EnrollStatus.HasCommittedToCRO -> InviteIntoGroup
/// </summary>
//public EnrollStatus EnrollStatus { get; set; }
}
/// <summary>
/// PM 申请审批 Enroll表
/// </summary>
public class ReviewerPMApplyEvent : DomainEvent
{
public Guid TrialId { get; set; }
public List<Guid> EnrollIdList { get; set; }
}
}

View File

@ -43,6 +43,11 @@
Guid? BatchId { get; set; }
/// <summary>
/// 稽查额外字符串
/// </summary>
string AuditIdentification { get; set; }
bool IsNotNeedInspection { get; set; }

View File

@ -314,10 +314,16 @@ namespace IRaCIS.Core.Domain.Share
get; set;
}
/// <summary>
/// 是否不需要记录稽查
/// </summary>
public bool IsNotNeedInspection { get; set; } = false;
/// <summary>
/// 稽查额外字符串
/// </summary>
public string AuditIdentification { get; set; } = string.Empty;
}
public static class ClaimAttributes

View File

@ -1890,6 +1890,44 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisitImageBackRecord)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as SubjectVisitImageBackRecord;
var extraIdentification = string.Empty;
var isDistinctionInterface = true;
var reason = string.Empty;
#region 处理标识
#endregion
var SubjectId = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).Select(x => x.SubjectId).FirstOrDefaultAsync();
await InsertInspection<SubjectVisitImageBackRecord>(item.Entity as SubjectVisitImageBackRecord, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = isDistinctionInterface,
Reason = reason,
//Subject的信息 找离的最近的Subject稽查信息
ObjectRelationParentId = x.SubjectVisitId,
SubjectId = SubjectId,
SubjectVisitId = x.Id,
ExtraIndentification = extraIdentification,
}
);
}
// 访视
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisit)))
{
@ -2074,7 +2112,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
armEnum = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Select(x => x.ArmEnum).FirstOrDefaultAsync();
}
var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == entity.NoneDicomStudyId).FirstNotNullAsync();
var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == entity.NoneDicomStudyId).IgnoreQueryFilters().FirstNotNullAsync();
await InsertInspection<NoneDicomStudyFile>(item.Entity as NoneDicomStudyFile, type, x => new InspectionConvertDTO()
{
@ -3190,7 +3228,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
u.ShowOrder
}
).OrderBy(t => t.ShowOrder).ToList()
});
},_userInfo.AuditIdentification);
////添加/修改病灶接口 只会对单个病灶进行操作
@ -3633,7 +3671,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <param name="expression">表达式</param>
/// <param name="otherItem">其他对象</param>
/// <returns></returns>
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null) where T : Entity
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null,string auditIdentification = "") where T : Entity
{
InspectionConvertDTO inspection = new InspectionConvertDTO();
@ -3650,7 +3688,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id;
inspection.GeneralId = generalId;
inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification;
inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine, auditIdentification) + inspection.ExtraIndentification;
//将实体对象属性 映射到稽查实体
MapEntityPropertyToAuditEntity(entityObj, inspection);
@ -3860,7 +3898,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// 获取稽查记录的标识符 部分业务会进行特殊处理
/// </summary>
/// <returns></returns>
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false)
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false,string auditIdentification="")
{
//var entityType = _dbContext.Model.FindEntityType(entityObj.GetType());
//var tableName = entityType.GetTableName();
@ -3872,18 +3910,18 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//{
// entityTypeName = "New/" + "UserSigned";
//}
string result = string.Empty;
//默认规则
if (IsDistinctionInterface)
{
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
if (isSelfDefine)
{
return $"{_userInfo.RequestUrl}/{entityTypeName}";
result= $"{_userInfo.RequestUrl}/{entityTypeName}";
}
else
{
return $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
result= $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
}
@ -3893,15 +3931,22 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
if (isSelfDefine)
{
return $"{entityTypeName}";
result = $"{entityTypeName}";
}
else
{
return $"{entityTypeName}/{type}";
result = $"{entityTypeName}/{type}";
}
}
if (auditIdentification.IsNotNullOrEmpty())
{
result = result + "/" + auditIdentification;
}
return result;
}

View File

@ -530,6 +530,7 @@ public class IRaCISDBContext : DbContext
#region Document
public virtual DbSet<SystemDocument> SystemDocument { get; set; }
public virtual DbSet<SystemDocumentAttachment> SystemDocumentAttachment { get; set; }
public virtual DbSet<TrialDocument> TrialDocument { get; set; }
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocUserTypeConfirm { get; set; }
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
@ -648,6 +649,8 @@ public class IRaCISDBContext : DbContext
#region 报告、 文档、记录
public virtual DbSet<AuditDocument> AuditDocument { get; set; }
public virtual DbSet<SysFileType> SysFileType { get; set; }
public virtual DbSet<TrialFileType> TrialFileType { get; set; }
public virtual DbSet<TrialFinalRecord> TrialFinalRecord { get; set; }
@ -657,6 +660,8 @@ public class IRaCISDBContext : DbContext
#endregion
public virtual DbSet<SubjectVisitImageBackRecord> SubjectVisitImageBackRecord { get; set; }
}
public class TestLength : Entity

View File

@ -21,17 +21,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EFCore.BulkExtensions" Version="8.1.1" />
<PackageReference Include="EFCore.BulkExtensions" Version="8.1.3" />
<PackageReference Include="EntityFrameworkCore.Triggered" Version="3.2.2" />
<PackageReference Include="EntityFrameworkCore.Projectables" Version="3.0.4" />
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="8.1.3" />
<PackageReference Include="MassTransit" Version="8.3.0" />
<PackageReference Include="MassTransit.EntityFrameworkCore" Version="8.3.0" />
<PackageReference Include="MassTransit.Hangfire" Version="8.3.0" />
<PackageReference Include="MassTransit" Version="8.4.0" />
<PackageReference Include="MassTransit.EntityFrameworkCore" Version="8.4.0" />
<PackageReference Include="MassTransit.Hangfire" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -1,12 +1,14 @@

using IRaCIS.Core.Domain;
using IRaCIS.Core.Domain._DomainEvent;
using IRaCIS.Core.Domain.BaseModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Newtonsoft.Json;
using Org.BouncyCastle.Asn1.Cmp;
namespace IRaCIS.Core.Infra.EFCore;
@ -73,6 +75,8 @@ public static class DBContext_Ext
var originCheckState = entry.Property(p => p.CheckState).OriginalValue;
var originCurrentActionUserId = entry.Property(p => p.CurrentActionUserId).OriginalValue;
var originRequestBackState = entry.Property(p => p.RequestBackState).OriginalValue;
//入组或者PD 才执行下面的逻辑
if ((subjectVisit.IsEnrollmentConfirm || subjectVisit.PDState == PDStateEnum.PDProgress))
{
@ -96,7 +100,7 @@ public static class DBContext_Ext
{
var businessEnum = subjectVisit.IsEnrollmentConfirm ? EmailBusinessScenario.EligibilityVerification_PendingImageQC : EmailBusinessScenario.PDVerification_PendingImageQC;
var delaySeconds = dbContext.TrialEmailNoticeConfig.Where(t => t.TrialId==subjectVisit.TrialId && t.BusinessScenarioEnum == businessEnum)
var delaySeconds = dbContext.TrialEmailNoticeConfig.Where(t => t.TrialId == subjectVisit.TrialId && t.BusinessScenarioEnum == businessEnum)
.Select(t => t.EmailDelaySeconds).FirstOrDefault();
Console.WriteLine("qc领取任务" + DateTime.Now.ToShortTimeString() + $"延时{delaySeconds}");
@ -108,17 +112,41 @@ public static class DBContext_Ext
}
}
}
// 重传影像
//CRC 申请 || PM审批的时候
if ((originRequestBackState != RequestBackStateEnum.CRC_RequestBack && subjectVisit.RequestBackState == RequestBackStateEnum.CRC_RequestBack) ||
(originRequestBackState == RequestBackStateEnum.CRC_RequestBack && (subjectVisit.RequestBackState == RequestBackStateEnum.PM_AgressBack || subjectVisit.RequestBackState == RequestBackStateEnum.PM_NotAgree)))
{
subjectVisit.AddDomainEvent(new CheckReuploadEvent() { RequestBackState = subjectVisit.RequestBackState, SubjectVisitId = subjectVisit.Id });
}
//PM 直接退回任务
if ((originSubmitState == SubmitStateEnum.Submitted && subjectVisit.SubmitState == SubmitStateEnum.ToSubmit) &&
(originAuditState == AuditStateEnum.QCPassed && subjectVisit.AuditState == AuditStateEnum.None) &&
(originCheckState == CheckStateEnum.CVPassed && subjectVisit.CheckState == CheckStateEnum.None))
{
subjectVisit.AddDomainEvent(new UnReadVisitTaskReReadingApproval() { SubjectVisitId = subjectVisit.Id });
}
if (subjectVisit.DomainEvents.Count > 0)
{
//添加进记录
eventStoreList.AddRange(GetStoreEvents(subjectVisit.DomainEvents));
}
}
foreach (var entry in changeTracker.Entries<QCChallenge>())
{
var qCChallenge = entry.Entity;
var originReuploadEnum = entry.Property(p => p.ReuploadEnum).OriginalValue;
var findSubjectVisit = dbContext.SubjectVisit.Where(t => t.Id == qCChallenge.SubjectVisitId)
.Select(t => new { IsEnrollmentConfirm = t.IsEnrollmentConfirm, PDState = t.PDState, t.Id, t.TrialId }).FirstOrDefault().IfNullThrowException();
@ -128,11 +156,36 @@ public static class DBContext_Ext
if (entry.State == EntityState.Added)
{
qCChallenge.AddDomainEvent(new QCRepliedQCChallengeEvent() { IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress,
QCChallengeId = qCChallenge.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
qCChallenge.AddDomainEvent(new QCRepliedQCChallengeEvent()
{
IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress,
QCChallengeId = qCChallenge.Id,
SubjectVisitId = findSubjectVisit.Id,
TrialId = findSubjectVisit.TrialId
});
}
}
//重传影像
if (
//CRC 申请
(originReuploadEnum != QCChanllengeReuploadEnum.CRCRequestReupload && qCChallenge.ReuploadEnum == QCChanllengeReuploadEnum.CRCRequestReupload)
||
//同意申请
(originReuploadEnum == QCChanllengeReuploadEnum.CRCRequestReupload && qCChallenge.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload))
{
qCChallenge.AddDomainEvent(new QCChanllengeReuploadEvent()
{
SubjectVisitId = findSubjectVisit.Id,
ReuploadEnum = qCChallenge.ReuploadEnum
});
}
if (qCChallenge.DomainEvents.Count > 0)
{
//添加进记录
eventStoreList.AddRange(GetStoreEvents(qCChallenge.DomainEvents));
}
@ -280,7 +333,7 @@ public static class DBContext_Ext
var originReReadingApplyState = entry.Property(p => p.ReReadingApplyState).OriginalValue;
if (originReReadingApplyState == ReReadingApplyState.Default && (visitTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || visitTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed))
if ((originReReadingApplyState != ReReadingApplyState.TrialGroupHaveApplyed && originReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed) && (visitTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || visitTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed))
{
var findSubjectVisit = new EnrollmentConfirmAndPD();
@ -303,14 +356,118 @@ public static class DBContext_Ext
visitTask.AddDomainEvent(new UrgentApplyedReReading() { VisitTaskId = visitTask.Id, ReReadingApplyState = visitTask.ReReadingApplyState });
//添加进记录
eventStoreList.AddRange(GetStoreEvents(visitTask.DomainEvents));
}
if (visitTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
{
visitTask.AddDomainEvent(new HaveReadVisitTaskReReading() { SubjectId = visitTask.SubjectId, VisitTaskId = visitTask.Id, ReReadingApplyState = visitTask.ReReadingApplyState });
}
}
if ((originReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || originReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) &&
(visitTask.ReReadingApplyState == ReReadingApplyState.Agree || visitTask.ReReadingApplyState == ReReadingApplyState.Reject))
{
visitTask.AddDomainEvent(new HaveReadVisitTaskReReading() { SubjectId = visitTask.SubjectId, VisitTaskId = visitTask.Id, ReReadingApplyState = visitTask.ReReadingApplyState });
}
if (visitTask.DomainEvents.Count > 0)
{
//添加进记录
eventStoreList.AddRange(GetStoreEvents(visitTask.DomainEvents));
}
}
#endregion
#region 直接申请流程重传
foreach (var entry in changeTracker.Entries<SubjectVisitImageBackRecord>())
{
var subjectVisitImageBackRecord = entry.Entity;
var originApplyUserRole = entry.Property(p => p.ApplyUserRole).OriginalValue;
var originImageBackState = entry.Property(p => p.ImageBackState).OriginalValue;
if (
//申请的时候 每次申请都是新的记录,所以状态只会存在前进,不会存在驳回后或者同意后再次变为申请
(subjectVisitImageBackRecord.ImageBackState == ImageBackStateEnum.None &&
(subjectVisitImageBackRecord.ApplyUserRole == ImageBackApplyEnum.IQCRequestBack || subjectVisitImageBackRecord.ApplyUserRole == ImageBackApplyEnum.CRCRequestBack)) ||
//审核完成的时候
(originImageBackState == ImageBackStateEnum.None && subjectVisitImageBackRecord.ImageBackState != ImageBackStateEnum.None)
)
{
subjectVisitImageBackRecord.AddDomainEvent(new DirectApplyReupdloadEvent()
{
SubjectVisitId = subjectVisitImageBackRecord.SubjectVisitId,
ApplyUserRole = subjectVisitImageBackRecord.ApplyUserRole,
ImageBackState = subjectVisitImageBackRecord.ImageBackState
});
}
if (subjectVisitImageBackRecord.DomainEvents.Count > 0)
{
//添加进记录
eventStoreList.AddRange(GetStoreEvents(subjectVisitImageBackRecord.DomainEvents));
}
}
#endregion
#region 阅片人筛选
var spmApproveEnrollIdList = new List<Guid>();
var pmApplyEnrollIdList = new List<Guid>();
Enroll lastEnroll = null;
foreach (var entry in changeTracker.Entries<Enroll>())
{
var enroll = entry.Entity;
var originEnrollStatus = entry.Property(p => p.EnrollStatus).OriginalValue;
if (originEnrollStatus == EnrollStatus.HasCommittedToCRO && enroll.EnrollStatus == EnrollStatus.InviteIntoGroup)
{
spmApproveEnrollIdList.Add(enroll.Id);
lastEnroll = enroll;
}
if (originEnrollStatus == EnrollStatus.HasApplyDownloadResume && enroll.EnrollStatus == EnrollStatus.HasCommittedToCRO)
{
pmApplyEnrollIdList.Add(enroll.Id);
lastEnroll = enroll;
}
}
if (spmApproveEnrollIdList.Count > 0)
{
lastEnroll.AddDomainEvent(new ReviewerSPMApprovedEvent() { TrialId = lastEnroll.TrialId, EnrollIdList = spmApproveEnrollIdList });
eventStoreList.AddRange(GetStoreEvents(lastEnroll.DomainEvents));
}
if (pmApplyEnrollIdList.Count > 0)
{
lastEnroll.AddDomainEvent(new ReviewerPMApplyEvent() { TrialId = lastEnroll.TrialId, EnrollIdList = pmApplyEnrollIdList });
eventStoreList.AddRange(GetStoreEvents(lastEnroll.DomainEvents));
}
#endregion
//跟随事务一起保存数据库
dbContext.EventStoreRecord.AddRange(eventStoreList);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,73 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class TrialModifyField : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "BodyPartTypes",
table: "Trial",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(400)",
oldMaxLength: 400);
migrationBuilder.AlterColumn<DateOnly>(
name: "EndDate",
table: "Education",
type: "date",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
migrationBuilder.AlterColumn<DateOnly>(
name: "BeginDate",
table: "Education",
type: "date",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "BodyPartTypes",
table: "Trial",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<DateTime>(
name: "EndDate",
table: "Education",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateOnly),
oldType: "date",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "BeginDate",
table: "Education",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateOnly),
oldType: "date",
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More