Compare commits
265 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e4ad1c0653 | |||
| 84df49ca07 | |||
| 400edd0b70 | |||
| c4add1ecc8 | |||
| d5879e28d7 | |||
| 37e083face | |||
| 290506a060 | |||
| 1b4bc3690a | |||
| 6374781d26 | |||
| b28013a02f | |||
| fe429d2bdc | |||
| d63af2ed20 | |||
| cebf9875b1 | |||
| 131681a0b3 | |||
| f833adc710 | |||
| df80d1e551 | |||
| 82dc092247 | |||
| 44894fcaa9 | |||
| 083bebdc03 | |||
| e808764dd6 | |||
| 77d198cb09 | |||
| 180b02b28c | |||
| c49a74d742 | |||
| c76fc8f052 | |||
| 14875dfacc | |||
| 0a68788c0f | |||
| b17e5d9ff3 | |||
| 05ce4b7155 | |||
| c8bbb3da48 | |||
| 65de108ecd | |||
| d20c306219 | |||
| e69991ae37 | |||
| e1e2544ee3 | |||
| 318333bae4 | |||
| d569de4dfe | |||
| 05627ff126 | |||
| 627618c854 | |||
| 2711c5eb04 | |||
| a6982f79c3 | |||
| 2a542949cd | |||
| a8ccbce76f | |||
| df7cf30aed | |||
| 0664fbdfb7 | |||
| 0a6ee05417 | |||
| 8325ccad72 | |||
| c27c4ce617 | |||
| b9ecabf915 | |||
| 4f13a98eff | |||
| 2a4e4e66fa | |||
| b72cc5cbc0 | |||
| 04f91560b8 | |||
| 87af2edf17 | |||
| 856977612d | |||
| d1ac17cee1 | |||
| 9748e70cdf | |||
| f9bd8c3f5c | |||
| 5ba0a9bbd0 | |||
| d8ea1e8f94 | |||
| cb83c2a737 | |||
| 806d663cfb | |||
| 7ab1728bc7 | |||
| fdd9afd4f0 | |||
| 32e64eaeff | |||
| 7b6efd52bb | |||
| 53d26c0445 | |||
| 7467f2ae11 | |||
| c498ffb21b | |||
| 1dadf7b8b6 | |||
| 793cf1b570 | |||
| 5a8f564b74 | |||
| e24c9e6ac2 | |||
| 814f6fd83c | |||
| 40d035e7a7 | |||
| a13807ae5f | |||
| 9d5aaf1e26 | |||
| c347d08e2b | |||
| d34be9b07d | |||
| e205ea0018 | |||
| ba9d3a30b9 | |||
| 10cf908775 | |||
| ee9ad472f0 | |||
| 1cdfc5f2b5 | |||
| 9e9f07e4fd | |||
| a0294e6bd6 | |||
| 55fdf431e0 | |||
| 9f1110f91a | |||
| d76b24bc25 | |||
| 0787875b3b | |||
| b33aca3230 | |||
| 0b291e8b21 | |||
| 0cf7e5fddd | |||
| 95f708da58 | |||
| ce47776f19 | |||
| 7fff48b07a | |||
| 4688cb388e | |||
| 21e1a7ab01 | |||
| 5952af85f1 | |||
| 5e193db33b | |||
| 30bcfcc675 | |||
| 514764ee6e | |||
| 685269eebf | |||
| 276ad83080 | |||
| 7a318eae45 | |||
| 0769f8fe05 | |||
| 03ac25835e | |||
| 29c3888108 | |||
| 91951be107 | |||
| 935e46a8f1 | |||
| 1345808019 | |||
| 400d0d3336 | |||
| ca0fd77176 | |||
| f7cf6d9669 | |||
| 7f19944005 | |||
| e8aec5f04c | |||
| 0afbd24923 | |||
| 932772f8c8 | |||
| b7a803678c | |||
| e99360bf5b | |||
| 5064630d1f | |||
| 4034da47f2 | |||
| 381b1965cf | |||
| d5e747becd | |||
| 758273d362 | |||
| 1560a0278e | |||
| 64c275a91c | |||
| 05189b4e5a | |||
| 80aaac997d | |||
| c560921092 | |||
| 81cd9aa6b7 | |||
| 4bfc6dd295 | |||
| a8464364c1 | |||
| e333368528 | |||
| 58c1c25fc2 | |||
| 3045b0ec48 | |||
| 2d50037c03 | |||
| 6a1cd07951 | |||
| c7103654e3 | |||
| 4e03071c4c | |||
| bf9e8a6758 | |||
| 00c6705161 | |||
| 209d932757 | |||
| e954ea8538 | |||
| f79a8b4cfb | |||
| 8fc01e2509 | |||
| 232e607b8c | |||
| bdeb7c464e | |||
| 3668079479 | |||
| c115e9453b | |||
| f157a0f473 | |||
| c2252b4e9f | |||
| b0554119f1 | |||
| 37387692dd | |||
| 970c41a064 | |||
| 67a3fe0f1b | |||
| 15108156c2 | |||
| 1a2c51da12 | |||
| 3d10482da8 | |||
| 3abc8787c6 | |||
| df346d31e6 | |||
| a8babb53f2 | |||
| 3c1cc92e1b | |||
| 99ee8c4757 | |||
| fc81d6da22 | |||
| 47edcbd761 | |||
| a499971e91 | |||
| afd34c7c9b | |||
| 529c646277 | |||
| b8f03153ca | |||
| a14df73879 | |||
| cb9141c1ce | |||
| ff2461dafc | |||
| 779af013e6 | |||
| 75fb357cc5 | |||
| 89eb1032cf | |||
| eca9c36110 | |||
| 2430651ed4 | |||
| 87d658031b | |||
| 34b90538ab | |||
| d2571d5f79 | |||
| 1688d7c934 | |||
| 9ab5dc7d02 | |||
| 97cdec61be | |||
| c0d6eb3203 | |||
| d125ff6324 | |||
| 1b830b386e | |||
| ee83909123 | |||
| 844e27e94e | |||
| 6fded9f028 | |||
| b5103f1940 | |||
| 8bf54dfc1b | |||
| 1069292c54 | |||
| 88c6f574ec | |||
| f5f6d3b6ac | |||
| 38f937ea9e | |||
| 2913eb67f4 | |||
| a0ceec28e7 | |||
| b77a50caf6 | |||
| 87f2d0e429 | |||
| e17fc6bce9 | |||
| 0970e2807b | |||
| a64d26513a | |||
| 73e80f2571 | |||
| 770f361d04 | |||
| 7476472071 | |||
| 1fff2f7256 | |||
| 1e4044488d | |||
| 1e1822151b | |||
| c37b6c4c84 | |||
| 8f65b9e60e | |||
| a8a9a09f88 | |||
| 7526ca2905 | |||
| fd83c3e7a7 | |||
| a3c575857a | |||
| c292f6ce44 | |||
| 84a7d75174 | |||
| 048afdcc7b | |||
| 06e319cf09 | |||
| cee0730e03 | |||
| adaa672185 | |||
| b6b5d3e4c9 | |||
| 6ac057a0c7 | |||
| 6607a0ff8f | |||
| 0374551655 | |||
| be9f0075e3 | |||
| 2cc004746e | |||
| b1a7ac1d28 | |||
| 5a31e16c65 | |||
| 0b56836097 | |||
| a4a11aaaec | |||
| ae1b2523b1 | |||
| 87f9d08c74 | |||
| 81abd9622f | |||
| faf87f5b86 | |||
| 66dc231850 | |||
| 34ff47bc1c | |||
| 842b7117a2 | |||
| 6543aba53f | |||
| 06cee8926e | |||
| a35fe11f5b | |||
| cc13544968 | |||
| 19ee511d8d | |||
| 0b47d6ca09 | |||
| 00193bb4bc | |||
| 4379fcbdb3 | |||
| 8464625bbf | |||
| e88f949cb7 | |||
| 4fdb0737fc | |||
| 04be8cf642 | |||
| 089ecbf144 | |||
| b95e97a5df | |||
| e84710c4aa | |||
| f549d1fca9 | |||
| 2c72dc000f | |||
| 2ceddc1340 | |||
| f118c48d0e | |||
| a3a1236d5b | |||
| a7848727ee | |||
| 5787c36687 | |||
| 89d009fcbf | |||
| 7d65cf5051 | |||
| e74427c45c | |||
| e8825c7efa | |||
| 628e0ad034 | |||
| 2f3f639918 | |||
| 87caf24dd1 |
@@ -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="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.0" />
|
||||
<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>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Amazon.Auth.AccessControlPolicy;
|
||||
using AlibabaCloud.SDK.Sts20150401;
|
||||
using Amazon.Auth.AccessControlPolicy;
|
||||
using Amazon.SecurityToken;
|
||||
using AutoMapper;
|
||||
using Azure.Core;
|
||||
@@ -21,6 +22,7 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Org.BouncyCastle.Tls;
|
||||
using RestSharp;
|
||||
using RestSharp.Authenticators;
|
||||
using System;
|
||||
@@ -182,6 +184,69 @@ namespace IRaCIS.Api.Controllers
|
||||
}
|
||||
|
||||
|
||||
#region 老项目依赖
|
||||
|
||||
[HttpGet("user/GenerateSTS")]
|
||||
public IResponseOutput GenerateSTS([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
{
|
||||
|
||||
var ossOptions = options.CurrentValue.AliyunOSS;
|
||||
|
||||
var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config()
|
||||
{
|
||||
AccessKeyId = ossOptions.AccessKeyId,
|
||||
AccessKeySecret = ossOptions.AccessKeySecret,
|
||||
Endpoint = "sts.cn-hangzhou.aliyuncs.com"
|
||||
});
|
||||
|
||||
var assumeRoleRequest = new AlibabaCloud.SDK.Sts20150401.Models.AssumeRoleRequest();
|
||||
// 将<YOUR_ROLE_SESSION_NAME>设置为自定义的会话名称,例如oss-role-session。
|
||||
assumeRoleRequest.RoleSessionName = $"session-name-{NewId.NextGuid()}";
|
||||
// 将<YOUR_ROLE_ARN>替换为拥有上传文件到指定OSS Bucket权限的RAM角色的ARN。
|
||||
assumeRoleRequest.RoleArn = ossOptions.RoleArn;
|
||||
//assumeRoleRequest.RoleArn = "acs:ram::1899121822495495:role/webdirect";
|
||||
assumeRoleRequest.DurationSeconds = ossOptions.DurationSeconds;
|
||||
var runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
|
||||
var response = client.AssumeRoleWithOptions(assumeRoleRequest, runtime);
|
||||
var credentials = response.Body.Credentials;
|
||||
|
||||
var tempToken = new AliyunOSSTempToken()
|
||||
{
|
||||
AccessKeyId = credentials.AccessKeyId,
|
||||
AccessKeySecret = credentials.AccessKeySecret,
|
||||
|
||||
//转为服务器时区,最后统一转为客户端时区
|
||||
Expiration = TimeZoneInfo.ConvertTimeFromUtc(DateTime.Parse(credentials.Expiration), TimeZoneInfo.Local),
|
||||
SecurityToken = credentials.SecurityToken,
|
||||
|
||||
|
||||
Region = ossOptions.Region,
|
||||
BucketName = ossOptions.BucketName,
|
||||
EndPoint = ossOptions.EndPoint,
|
||||
ViewEndpoint = ossOptions.ViewEndpoint,
|
||||
PreviewEndpoint = ossOptions.PreviewEndpoint
|
||||
|
||||
};
|
||||
|
||||
// 返回STS令牌信息给前端
|
||||
var stsToken = new
|
||||
{
|
||||
AccessKeyId = credentials.AccessKeyId,
|
||||
AccessKeySecret = credentials.AccessKeySecret,
|
||||
SecurityToken = credentials.SecurityToken,
|
||||
Expiration = credentials.Expiration,
|
||||
|
||||
Region = ossOptions.Region,
|
||||
BucketName = ossOptions.BucketName,
|
||||
ViewEndpoint = ossOptions.ViewEndpoint,
|
||||
|
||||
};
|
||||
|
||||
return ResponseOutput.Ok(stsToken);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
[HttpGet("User/UserRedirect")]
|
||||
|
||||
@@ -527,7 +527,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
var uploadFinishedTime = DateTime.Now;
|
||||
|
||||
var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync((t => t.Id == noneDicomStudyId));
|
||||
var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyId,true);
|
||||
|
||||
noneDicomStudy.FileCount = noneDicomStudy.FileCount + (incommand.VisitTaskId != null ? 0 : incommand.UploadedFileList.Count);
|
||||
|
||||
|
||||
@@ -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() });
|
||||
|
||||
|
||||
|
||||
@@ -71,21 +71,21 @@
|
||||
<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="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>
|
||||
|
||||
@@ -52,7 +52,10 @@
|
||||
|
||||
"IsNeedChangePassWord": true,
|
||||
|
||||
"ChangePassWordDays": 90
|
||||
"ChangePassWordDays": 90,
|
||||
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 2
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
"ReadingRestTimeMin": 10,
|
||||
|
||||
"IsNeedChangePassWord": true,
|
||||
"ChangePassWordDays": 90
|
||||
"ChangePassWordDays": 90,
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 2
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
"IsNeedChangePassWord": true,
|
||||
"ChangePassWordDays": 90,
|
||||
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 2,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
|
||||
"IsNeedChangePassWord": true,
|
||||
"ChangePassWordDays": 90,
|
||||
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 1,
|
||||
|
||||
"OpenTrialRelationDelete": false
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
"IsNeedChangePassWord": true,
|
||||
|
||||
"ChangePassWordDays": 90,
|
||||
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 1,
|
||||
"OpenLoginMFA": true
|
||||
},
|
||||
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
"ReadingRestTimeMin": 10,
|
||||
|
||||
"IsNeedChangePassWord": true,
|
||||
"ChangePassWordDays": 90
|
||||
"ChangePassWordDays": 90,
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 1
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
|
||||
@@ -70,7 +70,9 @@
|
||||
"ReadingRestTimeMin": 10,
|
||||
|
||||
"IsNeedChangePassWord": true,
|
||||
"ChangePassWordDays": 90
|
||||
"ChangePassWordDays": 90,
|
||||
// 模板类型 1 Elevate 2 Extensive
|
||||
"TemplateType": 2
|
||||
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
|
||||
@@ -34,6 +34,8 @@ public class ServiceVerifyConfigOption
|
||||
[Description("修改密码的天数")]
|
||||
public int ChangePassWordDays { get; set; }
|
||||
|
||||
public SysTemplateType TemplateType { get; set; }
|
||||
|
||||
public string ThirdPdfUrl { get; set; }
|
||||
|
||||
}
|
||||
@@ -73,6 +75,7 @@ public class SystemEmailSendConfig
|
||||
|
||||
public class SystemEmailSendConfigView
|
||||
{
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
public string CompanyName { get; set; } = string.Empty;
|
||||
|
||||
public string CompanyNameCN { get; set; } = string.Empty;
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,38 +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="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="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.0" />
|
||||
<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="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.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>
|
||||
|
||||
@@ -522,7 +522,7 @@
|
||||
<param name="agreeReReadingCommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PMSetTaskBack(System.Guid,System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PMSetTaskBack(System.Guid,System.Guid,System.String)">
|
||||
<summary>
|
||||
PM 设置任务 退回
|
||||
</summary>
|
||||
@@ -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
|
||||
@@ -1409,6 +1413,14 @@
|
||||
<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>
|
||||
新增稽查文档
|
||||
@@ -1592,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>
|
||||
@@ -4553,32 +4565,32 @@
|
||||
<param name="digitPlaces"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
||||
<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.MRECISTHCCCalculate.sODData">
|
||||
<member name="F:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.sODData">
|
||||
<summary>
|
||||
获取Sod的值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
|
||||
<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.MRECISTHCCCalculate.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
||||
<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.MRECISTHCCCalculate.TestCalculate(System.Guid,IRaCIS.Core.Domain.Share.QuestionType)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.TestCalculate(System.Guid,IRaCIS.Core.Domain.Share.QuestionType)">
|
||||
<summary>
|
||||
测试计算
|
||||
</summary>
|
||||
@@ -4586,21 +4598,21 @@
|
||||
<param name="type"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
|
||||
<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.MRECISTHCCCalculate.GetReportVerify(IRaCIS.Core.Application.Service.Reading.Dto.GetReportVerifyInDto)">
|
||||
<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.MRECISTHCCCalculate.ReadingCalculate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.Collections.Generic.List{IRaCIS.Core.Domain.Share.QuestionType})">
|
||||
<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>
|
||||
@@ -4608,35 +4620,35 @@
|
||||
<param name="calculateType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetReportTumor(System.Guid)">
|
||||
<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.MRECISTHCCCalculate.GetReportIsExistDisease(System.Guid)">
|
||||
<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.MRECISTHCCCalculate.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
||||
<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.MRECISTHCCCalculate.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
||||
<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.MRECISTHCCCalculate.GetSODData(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetSODData(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取SOD
|
||||
</summary>
|
||||
@@ -4646,28 +4658,28 @@
|
||||
</remarks>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetSumOfDiameter(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetSODChange(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetSODPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
与整个访视期间SOD最低点相比增加的值(mm)
|
||||
</summary>
|
||||
@@ -4677,7 +4689,7 @@
|
||||
</remarks>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetLowPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
与整个访视期间SOD最低点相比增加的百分比
|
||||
</summary>
|
||||
@@ -4687,7 +4699,7 @@
|
||||
</remarks>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetLowVisit(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetLowVisit(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
整个访视期间SOD最低点访视名称
|
||||
</summary>
|
||||
@@ -4697,48 +4709,48 @@
|
||||
</remarks>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetIsLymphTarget(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetIsAddFive(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetIsAddFiveRowIndexs(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetNETarget(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetTumor(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.TestOncology">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.TestOncology">
|
||||
<summary>
|
||||
测试肿瘤学评估
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.CalculationGetImgOncology(System.String,System.String,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.CalculationGetImgOncology(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
计算整体肿瘤评估 【测试】
|
||||
</summary>
|
||||
@@ -4766,28 +4778,28 @@
|
||||
</remarks>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetIsExistDisease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.ChangeAllLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
|
||||
<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.MRECISTHCCCalculate.ChangeAllLowVisitName(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
|
||||
<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.MRECISTHCCCalculate.ChangeAllVisitTaskAnswer(System.Collections.Generic.List{System.Guid},System.Guid,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.ChangeAllVisitTaskAnswer(System.Collections.Generic.List{System.Guid},System.Guid,System.String)">
|
||||
<summary>
|
||||
修改所有访视任务的答案
|
||||
</summary>
|
||||
@@ -4796,42 +4808,42 @@
|
||||
<param name="answer"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetBaseLineSOD(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetLowSODVisit(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetVisitTaskAnswerList(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetLastVisitTaskId(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<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.MRECISTHCCCalculate.GetTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)" -->
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculate.GetNoTargetLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<!-- 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.MRECISTHCCCalculate.GetNewLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRECISTHCCCalculateService.GetNewLesionEvaluate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取新病灶评估
|
||||
</summary>
|
||||
@@ -8847,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>
|
||||
任务展示访视 读片任务显示是否顺序
|
||||
@@ -10503,6 +10520,16 @@
|
||||
修约小数点
|
||||
</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.AddOrUpdateReadingQuestionCriterionTrialInDto.ReadingToolList">
|
||||
<summary>
|
||||
阅片工具
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
|
||||
<summary>
|
||||
标准分组
|
||||
@@ -12731,7 +12758,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>
|
||||
@@ -13285,7 +13312,7 @@
|
||||
阅片期配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
阅片期配置
|
||||
</summary>
|
||||
@@ -13357,7 +13384,7 @@
|
||||
生成的阅片模块(在大列表上展示的) 阅片期
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(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.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(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.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
生成的阅片模块(在大列表上展示的) 阅片期
|
||||
</summary>
|
||||
@@ -14065,6 +14092,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>
|
||||
翻译字典
|
||||
@@ -14127,17 +14174,67 @@
|
||||
返回
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ConsistencyCheckConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Domain.Share.IUserInfo,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},AutoMapper.IMapper,Microsoft.Extensions.Localization.IStringLocalizer,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
|
||||
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ConsistencyCheckConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Domain.Share.IUserInfo,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},AutoMapper.IMapper,Microsoft.Extensions.Localization.IStringLocalizer,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary})">
|
||||
<summary>
|
||||
构造函数注入
|
||||
</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>
|
||||
@@ -14155,7 +14252,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>
|
||||
@@ -14172,19 +14269,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">
|
||||
@@ -14212,7 +14309,7 @@
|
||||
CRC 提交了 通知QC进行质控 Code005,006
|
||||
</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进行质控 Code005,006
|
||||
</summary>
|
||||
@@ -14222,7 +14319,7 @@
|
||||
CRC 回复质控质疑 通知QC Code012,013
|
||||
</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 Code012,013
|
||||
</summary>
|
||||
@@ -14232,7 +14329,7 @@
|
||||
QC回复 质控质疑,通知CRC (014,015)
|
||||
</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 (014,015)
|
||||
</summary>
|
||||
@@ -14242,19 +14339,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>
|
||||
@@ -14264,7 +14361,7 @@
|
||||
QC 领取了质控任务 (007,008)
|
||||
</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 领取了质控任务 (007,008)
|
||||
</summary>
|
||||
@@ -14330,6 +14427,17 @@
|
||||
影像质控
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.SystemDocumentErverDayEvent">
|
||||
<summary>
|
||||
定时提醒
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.MassTransit.Consumer.SystemDocumentPublishEvent.NewUserTypeIds">
|
||||
<summary>
|
||||
新增的需要发送邮件的用户角色ID列表
|
||||
如果为null或空,则发送给所有相关角色
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.QCImageQuestionRecurringSchedule">
|
||||
<summary>
|
||||
QC 影像质疑待处理
|
||||
@@ -14350,11 +14458,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>
|
||||
@@ -14709,6 +14837,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>
|
||||
显示顺序
|
||||
@@ -15815,6 +15948,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>
|
||||
课时状态
|
||||
@@ -15838,6 +15991,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>
|
||||
@@ -16113,6 +16281,16 @@
|
||||
组件一致性和原Arm2是否有差异
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.ImageBackViewModel.ApplyReason">
|
||||
<summary>
|
||||
申请原因
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.ImageBackViewModel.ResultRemark">
|
||||
<summary>
|
||||
结果备注
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.GetNextCRCChallengeInDto.QCChallengeId">
|
||||
<summary>
|
||||
QCChallengeId
|
||||
@@ -16558,6 +16736,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
|
||||
@@ -16947,12 +17130,33 @@
|
||||
<member name="T:IRaCIS.Core.Application.Services.SystemDocumentService">
|
||||
<summary>
|
||||
SystemDocumentService
|
||||
</summary>
|
||||
</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>
|
||||
</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>
|
||||
@@ -16961,6 +17165,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>
|
||||
获取需要签署的系统文档列表
|
||||
@@ -16972,7 +17188,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>
|
||||
@@ -17005,6 +17221,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>
|
||||
项目下面的参与用户下拉
|
||||
@@ -17357,20 +17579,22 @@
|
||||
<param name="qaDialogCommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.RequestImageBack(System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.RequestImageBack(System.Guid,System.String)">
|
||||
<summary>
|
||||
CRC IQC 申请影像回退
|
||||
</summary>
|
||||
<param name="subjectVisitId"></param>
|
||||
<param name="ApplyReason"></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)">
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.AuditImageBack(System.Guid,System.Boolean,System.String)">
|
||||
<summary>
|
||||
PM 审核CRC IQC 申请影像回退
|
||||
</summary>
|
||||
<param name="subjectVisitId"></param>
|
||||
<param name="iamgeBackRecordId"></param>
|
||||
<param name="isAgree"></param>
|
||||
<param name="resultRemark"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using AutoMapper;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
@@ -24,6 +26,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig;
|
||||
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
/// <summary>
|
||||
/// 构造函数注入
|
||||
/// </summary>
|
||||
@@ -31,7 +34,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
public ConsistencyCheckConsumer(IRepository<DicomStudy> studyRepository, IUserInfo userInfo,
|
||||
IRepository<Subject> subjectRepository, IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<TrialSite> trialSiteRepository, IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
||||
IMapper mapper, IStringLocalizer localizer, IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig)
|
||||
IMapper mapper, IStringLocalizer localizer, IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig, IRepository<Dictionary> dictionaryRepository)
|
||||
{
|
||||
_noneDicomStudyRepository = noneDicomStudyRepository;
|
||||
_studyRepository = studyRepository;
|
||||
@@ -43,6 +46,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
_localizer = localizer;
|
||||
|
||||
_systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
_dictionaryRepository = dictionaryRepository;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +56,9 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
|
||||
var trialId = context.Message.TrialId;
|
||||
|
||||
//系统定义MRI 到底是MR 还是MRI
|
||||
var mriModality = await _dictionaryRepository.Where(t => t.Parent.Code == "Modality").Where(t => t.Code == "MRI").Select(t => t.Value).FirstNotNullAsync();
|
||||
|
||||
//处理Excel大小写
|
||||
context.Message.ETCList.ForEach(t => { t.Modality = t.Modality.ToUpper().Trim(); t.StudyDate = Convert.ToDateTime(t.StudyDate).ToString("yyyy-MM-dd"); t.SiteCode = t.SiteCode.ToUpper().Trim(); t.VisitName = t.VisitName.ToUpper().Trim(); t.SubjectCode = t.SubjectCode.ToUpper().Trim(); });
|
||||
var etcList = context.Message.ETCList;
|
||||
@@ -120,6 +127,16 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
var etcVisitStudyList = etcList.Where(t => t.SubjectCode == sv.SubjectCode && t.SiteCode == sv.SiteCode && t.VisitName == sv.VisitName).ToList();
|
||||
|
||||
|
||||
//以我们系统数据库为准 ,判断是MR 还是MRI, 把Excel 里的MR 或者MRI 处理成一致,MR MRI 是一致的
|
||||
foreach (var item in etcVisitStudyList)
|
||||
{
|
||||
if (item.Modality == "MR" || item.Modality == "MRI")
|
||||
{
|
||||
item.Modality = mriModality;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
StringBuilder dialogMsg = new StringBuilder();
|
||||
//---您好,根据本系统自动识别,该受试者当前访视在IRC系统中已提交的影像检查情况如下:
|
||||
@@ -229,7 +246,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
{
|
||||
num++;
|
||||
//影像检查(EDC 缺少) ConsistencyVerification_EdcL
|
||||
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_EdcL", item.StudyDate, item.Modality, _systemEmailConfig.SystemShortName]}</div>");
|
||||
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_EdcL", item.StudyDate, item.Modality/*, _systemEmailConfig.SystemShortName*/]}</div>");
|
||||
|
||||
}
|
||||
|
||||
@@ -243,8 +260,8 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
dialogMsg.AppendLine($"<br/>");
|
||||
dialogMsg.AppendLine(@$"<div>{_localizer["ConsistencyVerification_Desc"]}</div>");
|
||||
|
||||
dbSV.CheckResult =
|
||||
String.Join(" | ", dbExceptExcel.Select(t => $"{_localizer["ConsistencyVerification_EdcL", t.StudyDate, t.Modality, _systemEmailConfig.SystemShortName]}")) + " | "
|
||||
dbSV.CheckResult =
|
||||
String.Join(" | ", dbExceptExcel.Select(t => $"{_localizer["ConsistencyVerification_EdcL", t.StudyDate, t.Modality/*, _systemEmailConfig.SystemShortName*/]}")) + " | "
|
||||
+ String.Join(" | ", excelExceptDB.Select(t => $"{_localizer["ConsistencyVerification_IrcLi", t.StudyDate, t.Modality, _systemEmailConfig.SystemShortName]}"));
|
||||
|
||||
//新增一致性核查质疑记录
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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("发送(014,015) 【 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("发送(016,017) 【 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("发送(Code007,008) 【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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,24 @@ 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; }
|
||||
|
||||
/// <summary>
|
||||
/// 新增的需要发送邮件的用户角色ID列表
|
||||
/// 如果为null或空,则发送给所有相关角色
|
||||
/// </summary>
|
||||
public List<Guid> NewUserTypeIds { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
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}
|
||||
_systemEmailConfig.SiteUrl
|
||||
);
|
||||
|
||||
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;
|
||||
|
||||
// 记录是否只发送给新增角色的日志
|
||||
if (context.Message.NewUserTypeIds != null && context.Message.NewUserTypeIds.Any())
|
||||
{
|
||||
Console.WriteLine($"只发送给新增的角色,角色数量: {context.Message.NewUserTypeIds.Count}");
|
||||
}
|
||||
// 构建查询
|
||||
IQueryable<UnionDocumentWithConfirmInfoView> systemDocQuery;
|
||||
|
||||
if (context.Message.NewUserTypeIds != null && context.Message.NewUserTypeIds.Any())
|
||||
{
|
||||
// 只查询新增角色的用户
|
||||
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 => context.Message.NewUserTypeIds.Contains(t.UserTypeId) &&
|
||||
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
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// 查询所有相关角色的用户
|
||||
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}
|
||||
_systemEmailConfig.SiteUrl
|
||||
);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,6 +214,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
/// </summary>
|
||||
public bool IsManualGeneration { get; set; }
|
||||
//public bool IsAfterConvertedTask { get; set; }
|
||||
|
||||
public string PMBackReason { get; set; }
|
||||
|
||||
public int? RandomOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -480,6 +484,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public string? RequestReReadingReason { get; set; }
|
||||
|
||||
public ExportResult? ReadingExportType { get; set; }
|
||||
|
||||
public int? RandomOrder { get; set; }
|
||||
public bool? IsRandomOrderList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -906,6 +913,30 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
CancelAssign = 4,
|
||||
}
|
||||
|
||||
|
||||
public class SetRandomTaskOrderCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid DoctorUserId { get; set; }
|
||||
|
||||
public bool IsAutoSet { get; set; }
|
||||
|
||||
public List<VisitTaskOrderCommand> SetList { get; set; }
|
||||
}
|
||||
|
||||
public class VisitTaskOrderCommand
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public int? RandomOrder { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
IRepository<ClinicalDataTrialSet> _trialClinicalDataSetRepository,
|
||||
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
||||
IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository,
|
||||
IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment, IFusionCache _fusionCache) : BaseService, IVisitTaskHelpeService
|
||||
{
|
||||
|
||||
@@ -47,16 +47,16 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<FileResult> ExportTemplateAsync(ExportTemplateAsyncDto inDto)
|
||||
public async Task<FileResult> ExportTemplateAsync(ExportTemplateAsyncDto inDto)
|
||||
{
|
||||
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
||||
{
|
||||
Data=inDto.Data,
|
||||
commonDocumentRepository= _commonDocumentRepository,
|
||||
TemplateCode=inDto.TemplateCode,
|
||||
ExportFileName=inDto.ExportFileName,
|
||||
hostEnvironment=_hostEnvironment,
|
||||
IsEnglish=_userInfo.IsEn_Us,
|
||||
Data = inDto.Data,
|
||||
commonDocumentRepository = _commonDocumentRepository,
|
||||
TemplateCode = inDto.TemplateCode,
|
||||
ExportFileName = inDto.ExportFileName,
|
||||
hostEnvironment = _hostEnvironment,
|
||||
IsEnglish = _userInfo.IsEn_Us,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -757,248 +757,30 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
||||
{
|
||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
|
||||
.Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
||||
|
||||
//当前任务没有分配医生,初次分配 不处理 只生成任务,后续根据生成的任务 再进行分配
|
||||
if (allocateSubjectArmList.Count == 0)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
//并且配置了医生
|
||||
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
||||
#region 当前访视处理
|
||||
|
||||
//配置了医生
|
||||
if (assignConfigList.Count > 0)
|
||||
{
|
||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||
|
||||
#region 后续访视 未分配的进行再次分配,重置的或者失效的 需要重新生成新的任务 (PM 有序退回 或者PM 有序 申请重阅)
|
||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
//之前有回退的,那么当前访视任务生成但是不分配
|
||||
if (beforeBackVisitTask != null)
|
||||
{
|
||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||
|
||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
//之前有回退的,那么当前访视任务生成但是不分配
|
||||
if (beforeBackVisitTask != null)
|
||||
{
|
||||
//不用进行额外处理
|
||||
|
||||
//访视2 PM 回退 基线回退 访视2先一致性核查通过,生成访视2任务,但是不分配
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 当前访视根据配置规则分配出去
|
||||
|
||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
task1.TaskAllocationState = defaultState;
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
|
||||
task1.AllocateTime = DateTime.Now;
|
||||
|
||||
task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
task2.TaskAllocationState = defaultState;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
|
||||
task2.AllocateTime = DateTime.Now;
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//后续最近的未一致性核查通过的访视任务
|
||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
//大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成
|
||||
|
||||
//存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
|
||||
var followVisitTaskList = await _visitTaskRepository
|
||||
.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
|
||||
.ToListAsync();
|
||||
|
||||
var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
|
||||
|
||||
//每个访视去判断 是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
|
||||
foreach (var visitGroup in followVisitGroup)
|
||||
{
|
||||
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
|
||||
{
|
||||
x.PDState,
|
||||
x.IsEnrollmentConfirm,
|
||||
x.IsUrgent,
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
|
||||
TaskUrgentType? urgentType = null;
|
||||
|
||||
if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
|
||||
{
|
||||
urgentType = TaskUrgentType.PDProgress;
|
||||
}
|
||||
else if (subjectVisitInfo.IsEnrollmentConfirm)
|
||||
{
|
||||
urgentType = TaskUrgentType.EnrollmentConfirm;
|
||||
}
|
||||
else if (subjectVisitInfo.IsUrgent)
|
||||
{
|
||||
urgentType = TaskUrgentType.VisitUrgent;
|
||||
}
|
||||
|
||||
bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
|
||||
|
||||
//如果后续访视已分配有效 就不用处理
|
||||
if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
|
||||
{
|
||||
//不做处理
|
||||
}
|
||||
else
|
||||
{
|
||||
var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
|
||||
|
||||
if (arm1 != null)
|
||||
{
|
||||
|
||||
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
arm1.IsUrgent = visit.IsUrgent;
|
||||
arm1.TaskUrgentType = urgentType;
|
||||
arm1.IsCanEditUrgentState = isCanEdit;
|
||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm1.AllocateTime = DateTime.Now;
|
||||
arm1.DoctorUserId = task1.DoctorUserId;
|
||||
arm1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
||||
|
||||
|
||||
|
||||
|
||||
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
ReadingCategory = ReadingCategory.Visit,
|
||||
|
||||
SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
|
||||
VisitTaskNum = latestTask.VisitTaskNum,
|
||||
TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
|
||||
TaskName = latestTask.TaskName,
|
||||
|
||||
BlindSubjectCode = latestTask.BlindSubjectCode,
|
||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
TaskAllocationState = TaskAllocationState.Allocated,
|
||||
AllocateTime = DateTime.Now,
|
||||
DoctorUserId = task1!.DoctorUserId,
|
||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||
});
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//如果后续访视已分配有效 就不用处理
|
||||
if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm2))
|
||||
{
|
||||
//不做处理
|
||||
}
|
||||
else
|
||||
{
|
||||
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
||||
if (arm2 != null)
|
||||
{
|
||||
//有可能仅仅只分配了一个Subject
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
arm2.IsUrgent = visit.IsUrgent;
|
||||
arm2.TaskUrgentType = urgentType;
|
||||
arm2.IsCanEditUrgentState = isCanEdit;
|
||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm2.AllocateTime = DateTime.Now;
|
||||
arm2.DoctorUserId = task2.DoctorUserId;
|
||||
arm2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).OrderByDescending(t => t.CreateTime).First();
|
||||
|
||||
var taskTwo = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
|
||||
//CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
ReadingCategory = ReadingCategory.Visit,
|
||||
|
||||
SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
|
||||
VisitTaskNum = latestTask.VisitTaskNum,
|
||||
TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
|
||||
TaskName = latestTask.TaskName,
|
||||
|
||||
BlindSubjectCode = latestTask.BlindSubjectCode,
|
||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
TaskAllocationState = TaskAllocationState.Allocated,
|
||||
|
||||
AllocateTime = DateTime.Now,
|
||||
DoctorUserId = task2!.DoctorUserId,
|
||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||
});
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//不用进行额外处理
|
||||
|
||||
//访视2 PM 回退 基线回退 访视2先一致性核查通过,生成访视2任务,但是不分配
|
||||
}
|
||||
//无序的时候 生成任务并分配出去
|
||||
else
|
||||
{
|
||||
#region 当前访视根据配置规则分配出去
|
||||
|
||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
@@ -1019,21 +801,237 @@ namespace IRaCIS.Core.Application.Service
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
else
|
||||
//后续访视不自动分配,或者配置的医生数量不足,就不进行分配
|
||||
#endregion
|
||||
|
||||
#region 后续访视处理
|
||||
|
||||
|
||||
|
||||
|
||||
//后续最近的未一致性核查通过的访视任务
|
||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
//大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成
|
||||
|
||||
//存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
|
||||
var followVisitTaskList = await _visitTaskRepository
|
||||
.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
|
||||
.ToListAsync();
|
||||
|
||||
var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
|
||||
|
||||
//每个访视去判断 是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
|
||||
foreach (var visitGroup in followVisitGroup)
|
||||
{
|
||||
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
|
||||
{
|
||||
x.PDState,
|
||||
x.IsEnrollmentConfirm,
|
||||
x.IsUrgent,
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
|
||||
TaskUrgentType? urgentType = null;
|
||||
|
||||
if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
|
||||
{
|
||||
urgentType = TaskUrgentType.PDProgress;
|
||||
}
|
||||
else if (subjectVisitInfo.IsEnrollmentConfirm)
|
||||
{
|
||||
urgentType = TaskUrgentType.EnrollmentConfirm;
|
||||
}
|
||||
else if (subjectVisitInfo.IsUrgent)
|
||||
{
|
||||
urgentType = TaskUrgentType.VisitUrgent;
|
||||
}
|
||||
|
||||
bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
|
||||
|
||||
//如果后续访视已分配有效 就不用处理
|
||||
if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
|
||||
{
|
||||
//不做处理
|
||||
}
|
||||
else
|
||||
{
|
||||
var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
|
||||
|
||||
if (arm1 != null)
|
||||
{
|
||||
arm1.IsUrgent = visit.IsUrgent;
|
||||
arm1.TaskUrgentType = urgentType;
|
||||
arm1.IsCanEditUrgentState = isCanEdit;
|
||||
|
||||
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm1.AllocateTime = DateTime.Now;
|
||||
arm1.DoctorUserId = task1.DoctorUserId;
|
||||
arm1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
||||
|
||||
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
ReadingCategory = ReadingCategory.Visit,
|
||||
|
||||
SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
|
||||
VisitTaskNum = latestTask.VisitTaskNum,
|
||||
TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
|
||||
TaskName = latestTask.TaskName,
|
||||
|
||||
BlindSubjectCode = latestTask.BlindSubjectCode,
|
||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||
});
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
taskOne.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
taskOne.AllocateTime = DateTime.Now;
|
||||
taskOne. DoctorUserId = task1!.DoctorUserId;
|
||||
taskOne. SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//如果后续访视已分配有效 就不用处理
|
||||
if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm2))
|
||||
{
|
||||
//不做处理
|
||||
}
|
||||
else
|
||||
{
|
||||
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
||||
if (arm2 != null)
|
||||
{
|
||||
arm2.IsUrgent = visit.IsUrgent;
|
||||
arm2.TaskUrgentType = urgentType;
|
||||
arm2.IsCanEditUrgentState = isCanEdit;
|
||||
|
||||
//有可能仅仅只分配了一个Subject
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm2.AllocateTime = DateTime.Now;
|
||||
arm2.DoctorUserId = task2.DoctorUserId;
|
||||
arm2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).OrderByDescending(t => t.CreateTime).First();
|
||||
|
||||
var taskTwo = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
|
||||
//CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
ReadingCategory = ReadingCategory.Visit,
|
||||
|
||||
SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
|
||||
VisitTaskNum = latestTask.VisitTaskNum,
|
||||
TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
|
||||
TaskName = latestTask.TaskName,
|
||||
|
||||
BlindSubjectCode = latestTask.BlindSubjectCode,
|
||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||
});
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
taskTwo.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
taskTwo.AllocateTime = DateTime.Now;
|
||||
taskTwo.DoctorUserId = task2!.DoctorUserId;
|
||||
taskTwo.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//无序的时候 生成任务并分配出去
|
||||
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
||||
{
|
||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
task1.TaskAllocationState = defaultState;
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
|
||||
task1.AllocateTime = DateTime.Now;
|
||||
|
||||
task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
task2.TaskAllocationState = defaultState;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
|
||||
task2.AllocateTime = DateTime.Now;
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
||||
|
||||
@@ -74,7 +75,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
return await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null)
|
||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null, bool? isRandom = null)
|
||||
{
|
||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
||||
|
||||
@@ -107,7 +108,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
|
||||
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
||||
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate).ToList();
|
||||
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate)
|
||||
.WhereIf(isRandom == true, t => t.IsReadingTaskViewInOrder == ReadingOrder.Random).ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -761,6 +763,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState==ReadingTaskState.Reading) && t.TaskAllocationState==TaskAllocationState.Allocated)
|
||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
||||
@@ -1005,6 +1009,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr }).FirstOrDefault();
|
||||
|
||||
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
||||
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
@@ -1012,7 +1020,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||
.Where(t => !t.Subject.SubjectVisitList.Where(t => extralConfig.IsOpenLostVistRead ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||
@@ -1035,14 +1043,15 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
//未读 里可读任务量
|
||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||
UnReadCanReadTaskCount = x.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false).Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||
//不能对包含聚合或子查询的表达式执行聚合函数
|
||||
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
||||
).Count(),
|
||||
|
||||
|
||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false)
|
||||
.Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
@@ -1055,7 +1064,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
IsExistUnprocessedFeedback=u.UserFeedBackList.Any(t => t.State ==0),
|
||||
IsExistUnprocessedFeedback = u.UserFeedBackList.Any(t => t.State == 0),
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
@@ -2203,12 +2212,13 @@ 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var readingTaskQuestionAnswerList = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
@@ -2216,6 +2226,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
|
||||
}
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskQuestionAnswerList).Result;
|
||||
|
||||
@@ -2227,9 +2238,11 @@ 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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//ReadingTableAnswerRowInfo ReadingTableQuestionAnswer 一起加
|
||||
var readingTableAnswerRowInfoList = _readingTableAnswerRowInfoRepository.Where(t => t.VisitTaskId == origenalTask.Id).Include(t => t.LesionAnswerList).ToList();
|
||||
@@ -2240,7 +2253,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
var originalVisitTaskId = item.VisitTaskId;
|
||||
var originalFristAddTaskId = item.FristAddTaskId;
|
||||
|
||||
var newRowId= NewId.NextSequentialGuid();
|
||||
var newRowId = NewId.NextSequentialGuid();
|
||||
|
||||
foreach (var mark in readingTaskQuestionMarkList)
|
||||
{
|
||||
@@ -2253,6 +2266,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)
|
||||
{
|
||||
@@ -2276,11 +2290,11 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
/// PM 设置任务 退回
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{taskId:guid}")]
|
||||
[HttpPut("{trialId:guid}/{taskId:guid}/{pmBackReason}")]
|
||||
[UnitOfWork]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
|
||||
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId)
|
||||
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId, string pmBackReason)
|
||||
{
|
||||
|
||||
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
@@ -2341,7 +2355,6 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
#region 有序 无序公用流程
|
||||
|
||||
|
||||
//执行类似一致性核查回退流程 回退访视到影像上传流程
|
||||
await VisitBackAsync(task.SourceSubjectVisitId);
|
||||
|
||||
@@ -2458,6 +2471,9 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
}
|
||||
|
||||
var trackTask = await _visitTaskRepository.FindAsync(task.Id);
|
||||
trackTask.PMBackReason = pmBackReason;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2552,7 +2568,6 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
//回退后,回退状态恢复
|
||||
sv.RequestBackState = RequestBackStateEnum.NotRequest;
|
||||
sv.ImageBackState = ImageBackStateEnum.None;
|
||||
sv.IsCheckBack = false;
|
||||
sv.CheckBackTime = null;
|
||||
sv.CheckState = CheckStateEnum.None;
|
||||
@@ -2610,7 +2625,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
|
||||
private bool IsSpmOrCPM()
|
||||
{
|
||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM ;
|
||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2675,6 +2690,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
{
|
||||
//默认影响的都是该标准的任务
|
||||
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2935,6 +2951,88 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
}
|
||||
|
||||
|
||||
#region 完全随机设置序号
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> SetRandomTaskOrder(SetRandomTaskOrderCommand inCommand)
|
||||
{
|
||||
|
||||
if (inCommand.IsAutoSet)
|
||||
{
|
||||
//找到所有的已分配的,未阅片的,生效的 非一致性分析
|
||||
|
||||
var needRandomOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||
.Where(t => t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||
.Select(t => t.Id).ToList();
|
||||
|
||||
|
||||
//var haveSignOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||
// .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime != null && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||
// .Select(t => t.RandomOrder).ToList();
|
||||
|
||||
//已阅,阅片中任务的序号
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId
|
||||
&& t.DoctorUserId == inCommand.DoctorUserId && t.ReadingTaskState != ReadingTaskState.WaitReading, u => new VisitTask() { RandomOrder = null });
|
||||
|
||||
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||
List<int> availableNumbers = Enumerable.Range(1, needRandomOrderList.Count).ToList();
|
||||
Random rng = new Random();
|
||||
foreach (var id in needRandomOrderList)
|
||||
{
|
||||
int randomIndex = rng.Next(availableNumbers.Count);
|
||||
|
||||
var num = availableNumbers[randomIndex];
|
||||
|
||||
var order = 11 + 5 * (num - 1);
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, t => new VisitTask() { RandomOrder = order });
|
||||
|
||||
availableNumbers.RemoveAt(randomIndex);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in inCommand.SetList)
|
||||
{
|
||||
var task = await _visitTaskRepository.Where(t => t.Id == item.Id).Select(t => new { t.RandomOrder, t.ReadingTaskState, t.TaskAllocationState, t.DoctorUserId }).FirstNotNullAsync();
|
||||
|
||||
if (task.ReadingTaskState != ReadingTaskState.WaitReading || task.DoctorUserId != inCommand.DoctorUserId
|
||||
|| task.TaskAllocationState != TaskAllocationState.Allocated)
|
||||
{
|
||||
//"任务不符合设置阅片序号条件"
|
||||
return ResponseOutput.NotOk(_localizer["VisitTask_NotRandomOrderTask"]);
|
||||
}
|
||||
|
||||
//设置交换序号的任务,可能不符合条件
|
||||
|
||||
//没有序号,直接设置
|
||||
if (task.RandomOrder == null)
|
||||
{
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId
|
||||
&& t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
&& t.RandomOrder == item.RandomOrder))
|
||||
{
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||
}
|
||||
else
|
||||
{
|
||||
//"序号已被占用!"
|
||||
return ResponseOutput.NotOk(_localizer["VisitTask_RandomOrderUserd"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 暂时废弃
|
||||
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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.Status == UserStateEnum.Enable && 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>
|
||||
@@ -1194,39 +1302,65 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
|
||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||
|
||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.ReReadingApplyState != null, t => t.ReReadingApplyState == inQuery.ReReadingApplyState)
|
||||
|
||||
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
|
||||
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
|
||||
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState == ReadingTaskState.Reading) && t.TaskAllocationState == TaskAllocationState.Allocated)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode) || t.BlindSubjectCode.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||
.ProjectTo<ReadingTaskExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||
if (inQuery.IsRandomOrderList == true)
|
||||
{
|
||||
list = list.OrderBy(t => t.RandomOrder).ToList();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialTaskRandomOrderList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1550,8 +1684,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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -62,12 +62,34 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
return ResponseOutput.Ok(result.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增稽查文档
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
/// <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>();
|
||||
@@ -186,7 +208,11 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
{
|
||||
|
||||
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)
|
||||
@@ -226,9 +252,12 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
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);
|
||||
GetChildren(item, data, historicalVersionList);
|
||||
|
||||
}
|
||||
result.CurrentPageData = root;
|
||||
@@ -249,12 +278,13 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
|
||||
}
|
||||
|
||||
private void GetChildren(AuditDocumentData item, List<AuditDocumentData> 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);
|
||||
GetChildren(x, dataList, historyList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +426,11 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
})).CurrentPageData;
|
||||
|
||||
List<AuditDocumentAddOrEdit> auditDocumentAddOrEdits = _mapper.Map<List<AuditDocumentAddOrEdit>>(data);
|
||||
auditDocumentAddOrEdits.ForEach(x => x.IsUpdate = false);
|
||||
auditDocumentAddOrEdits.ForEach(x => {
|
||||
x.IsUpdate = false;
|
||||
x.Id = null;
|
||||
x.ParentId = inDto.ParentId;
|
||||
});
|
||||
await addData(auditDocumentAddOrEdits);
|
||||
}
|
||||
|
||||
@@ -410,7 +444,7 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
item.Children.ForEach(x => {
|
||||
x.ParentId = result.Id;
|
||||
x.IsUpdate = false;
|
||||
|
||||
x.Id = null;
|
||||
});
|
||||
|
||||
if (item.Children.Count() > 0)
|
||||
@@ -503,14 +537,32 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||
|
||||
List<Guid> allid = new List<Guid>();
|
||||
findChild(allid, inDto.Ids, data);
|
||||
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(t => allid.Contains(t.Id), x => new AuditDocument() {
|
||||
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);
|
||||
|
||||
@@ -47,7 +47,12 @@ public class AuditDocumentData : AuditDocumentUpdateDto
|
||||
|
||||
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> (){ };
|
||||
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,27 +1,82 @@
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:03
|
||||
// 生成时间 2022-01-05 09:17:03
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// SystemDocumentService
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[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);
|
||||
@@ -71,6 +130,11 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
// 保存修改前的状态和需要确认的用户类型列表
|
||||
bool beforeIsPublish = document.IsPublish;
|
||||
bool beforeIsDeleted = document.IsDeleted;
|
||||
var beforeUserTypeIds = document.NeedConfirmedUserTypeList.Select(x => x.NeedConfirmUserTypeId).ToList();
|
||||
|
||||
_mapper.Map(addOrEditSystemDocument, document);
|
||||
|
||||
#region 之前区分路径文件夹 现在不区分废弃
|
||||
@@ -94,9 +158,39 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var success = await _systemDocumentRepository.SaveChangesAsync();
|
||||
|
||||
// 检查是否需要发送邮件给新增的角色
|
||||
if (beforeIsPublish && document.IsPublish && !beforeIsDeleted && !document.IsDeleted)
|
||||
{
|
||||
// 找出新增的用户角色ID
|
||||
var newUserTypeIds = addOrEditSystemDocument.NeedConfirmedUserTypeIdList
|
||||
.Where(id => !beforeUserTypeIds.Contains(id))
|
||||
.ToList();
|
||||
|
||||
if (newUserTypeIds.Any()&& newUserTypeIds.Count()>0)
|
||||
{
|
||||
// 发送邮件给新增的角色
|
||||
Console.WriteLine("开始 发送系统文档更新邮件给新增角色");
|
||||
Console.WriteLine(string.Join(",", newUserTypeIds));
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
// 创建独立作用域
|
||||
using (var scope = serviceScopeFactory.CreateScope())
|
||||
{
|
||||
// 从新作用域解析服务
|
||||
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
|
||||
// 只发送给新增的角色
|
||||
await mediator.Publish(new SystemDocumentPublishEvent {
|
||||
Ids = new List<Guid> { document.Id },
|
||||
NewUserTypeIds = newUserTypeIds
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(document.Id.ToString());
|
||||
}
|
||||
|
||||
@@ -104,6 +198,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 +299,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 +320,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;
|
||||
|
||||
@@ -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.Status== UserStateEnum.Enable && 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>
|
||||
/// 项目下面的参与用户下拉
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -14,6 +14,12 @@ 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>();
|
||||
@@ -23,6 +29,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
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));
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using MassTransit.Initializers;
|
||||
using Medallion.Threading;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System.Data;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
@@ -901,8 +902,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
}
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId)
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
.WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的的
|
||||
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public List<UserOptType>? OptTypeList { get; set; }
|
||||
|
||||
public List<UserOptType> OptTypeList { get; set; } = new List<UserOptType>();
|
||||
|
||||
public string? IP { get; set; }
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -856,7 +856,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var userLogQueryable =
|
||||
_userLogRepository.AsQueryable().IgnoreQueryFilters()
|
||||
.WhereIf(inQuery.OptTypeList.Count()>0, t => inQuery.OptTypeList.Contains(t.OptType))
|
||||
.WhereIf(inQuery.IdentityUserId != null, t => t.ActionIdentityUserId == inQuery.IdentityUserId)
|
||||
.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))
|
||||
@@ -864,8 +863,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
.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 && inQuery.IsLoginUncommonly.Value, t => t.IsLoginUncommonly&&!t.IsIgnoreUncommonly)
|
||||
.WhereIf(inQuery.IsLoginUncommonly != null && !inQuery.IsLoginUncommonly.Value, t => !t.IsLoginUncommonly || t.IsIgnoreUncommonly)
|
||||
.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!))
|
||||
@@ -923,7 +922,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var password = loginDto.Password;
|
||||
|
||||
var emailConfig = _emailConfig.CurrentValue;
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN };
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN,SystemShortName=emailConfig.SystemShortName };
|
||||
|
||||
|
||||
int maxFailures = _verifyConfig.CurrentValue.LoginMaxFailCount;
|
||||
@@ -990,6 +989,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
});
|
||||
|
||||
//超过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)
|
||||
{
|
||||
// 与上一次区域不一致
|
||||
@@ -1005,11 +1011,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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
@@ -867,6 +897,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
||||
}
|
||||
}
|
||||
|
||||
public int? RandomOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1687,6 +1719,50 @@ 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;
|
||||
|
||||
/// <summary>
|
||||
/// 申请原因
|
||||
/// </summary>
|
||||
public string ApplyReason { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 结果备注
|
||||
/// </summary>
|
||||
public string ResultRemark { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class QCCRCVisitViewModel : QCVisitBasicListViewModel
|
||||
@@ -2108,7 +2184,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public DateTime? ReviewAuditTime { get; set; }
|
||||
public DateTime? PreliminaryAuditTime { get; set; }
|
||||
|
||||
public ImageBackStateEnum ImageBackState { get; set; }
|
||||
public bool IsImageBackApplying { get; set; }
|
||||
|
||||
|
||||
public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -10,6 +10,7 @@ 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;
|
||||
|
||||
@@ -40,6 +41,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService,
|
||||
IOSSService _oSSService,
|
||||
IRepository<ReadingClinicalData> _readingClinicalDataReposiotry,
|
||||
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService, IQCOperationService
|
||||
{
|
||||
|
||||
@@ -249,44 +251,83 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// CRC IQC 申请影像回退
|
||||
/// </summary>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <param name="ApplyReason"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> RequestImageBack(Guid subjectVisitId)
|
||||
public async Task<IResponseOutput> RequestImageBack(Guid subjectVisitId, string ApplyReason)
|
||||
{
|
||||
if (!_subjectVisitRepository.Any(t => t.Id == subjectVisitId && t.CheckState < CheckStateEnum.CVPassed && t.SubmitState == SubmitStateEnum.Submitted))
|
||||
|
||||
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, ApplyReason = ApplyReason, SubmitTime = sv.SubmitTime, EarliestScanDate = sv.EarliestScanDate, LatestScanDate = sv.LatestScanDate };
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
|
||||
{
|
||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { ImageBackState = ImageBackStateEnum.CRCRequestBack }, true);
|
||||
|
||||
newRecord.ApplyUserRole = ImageBackApplyEnum.CRCRequestBack;
|
||||
|
||||
}
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
|
||||
{
|
||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { ImageBackState = ImageBackStateEnum.IQCRequestBack }, true);
|
||||
newRecord.ApplyUserRole = ImageBackApplyEnum.IQCRequestBack;
|
||||
}
|
||||
|
||||
await _subjectVisitImageBackRecordReposiotry.AddAsync(newRecord, true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PM 审核CRC IQC 申请影像回退
|
||||
/// </summary>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <param name="iamgeBackRecordId"></param>
|
||||
/// <param name="isAgree"></param>
|
||||
/// <param name="resultRemark"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> AuditImageBack(Guid subjectVisitId, bool isAgree)
|
||||
public async Task<IResponseOutput> AuditImageBack(Guid iamgeBackRecordId, bool isAgree, string? resultRemark)
|
||||
{
|
||||
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
var backRecord = (await _subjectVisitImageBackRecordReposiotry.FirstOrDefaultAsync(t => t.Id == iamgeBackRecordId)).IfNullThrowException();
|
||||
|
||||
if (sv.ImageBackState != ImageBackStateEnum.CRCRequestBack && sv.ImageBackState != ImageBackStateEnum.IQCRequestBack)
|
||||
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"]);
|
||||
@@ -294,15 +335,22 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
if (isAgree)
|
||||
{
|
||||
|
||||
if (sv.SubmitState == SubmitStateEnum.Submitted && sv.CheckState < CheckStateEnum.CVPassed)
|
||||
if (_subjectVisitRepository.Any(t => t.Id == subjectVisitId && t.QCChallengeList.Any(t => t.IsClosed == false)))
|
||||
{
|
||||
sv.ImageBackState = ImageBackStateEnum.PMAgreeBack;
|
||||
//有未关闭的质疑,不允许同意影像回退
|
||||
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"]);
|
||||
}
|
||||
|
||||
@@ -361,10 +409,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
else
|
||||
{
|
||||
sv.ImageBackState = ImageBackStateEnum.PMNotAgreeBack;
|
||||
backRecord.ImageBackState = ImageBackStateEnum.PMNotAgreeBack;
|
||||
|
||||
}
|
||||
|
||||
backRecord.AuditTime = DateTime.Now;
|
||||
backRecord.ResultRemark = resultRemark ?? string.Empty;
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
@@ -516,6 +566,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()
|
||||
@@ -527,7 +591,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;
|
||||
|
||||
@@ -601,16 +665,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;
|
||||
@@ -951,7 +1013,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;
|
||||
@@ -1023,7 +1085,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)
|
||||
{
|
||||
@@ -1040,30 +1102,14 @@ 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, false);
|
||||
await _oSSService.DeleteFromPrefix(prefix, true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1204,7 +1250,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
return new GetNextIQCQualityOutDto() { };
|
||||
break;
|
||||
case TrialQCProcess.SingleAudit:
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
||||
visitList = await _subjectVisitRepository
|
||||
.Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))
|
||||
.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.UserRoleId && (x.CurrentActionUserId == _userInfo.UserRoleId || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
@@ -1238,7 +1286,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
break;
|
||||
case TrialQCProcess.DoubleAudit:
|
||||
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||
visitList = await _subjectVisitRepository
|
||||
.Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))
|
||||
.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||
((x.CurrentActionUserId == _userInfo.UserRoleId) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.UserRoleId)))
|
||||
)
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId)
|
||||
@@ -1312,6 +1362,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCConfigFirst"], ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
|
||||
if (_subjectVisitImageBackRecordReposiotry.Any(t => t.SubjectVisitId == subjectVisitId && t.ImageBackState == ImageBackStateEnum.None))
|
||||
{
|
||||
//已申请的影像回退,不能领取
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBackCanNotObtain"]);
|
||||
}
|
||||
|
||||
//if (await _subjectVisitRepository.AnyAsync(t => t.IsTake &&
|
||||
// t.SubjectId != dbSubjectVisit.SubjectId &&
|
||||
@@ -1872,8 +1927,9 @@ 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 _oSSService.DeleteObjects(instancePathList.Select(t => t.TrimStart('/')).ToList());
|
||||
@@ -1933,8 +1989,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());
|
||||
}
|
||||
@@ -2278,6 +2338,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)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -792,6 +792,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public int? DigitPlaces { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 阅片版本
|
||||
/// </summary>
|
||||
public ReadingVersion? ReadingVersionEnum { get; set; }
|
||||
|
||||
|
||||
public ReadingTool? ReadingTool { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅片工具
|
||||
/// </summary>
|
||||
public List<string> ReadingToolList { get; set; } = new List<string>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IReadingImageTaskService
|
||||
{
|
||||
Task TriggerJudgeQuestion(Guid visitTaskId);
|
||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||
|
||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||
|
||||
@@ -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,20 @@ 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;
|
||||
}
|
||||
|
||||
indto.ReadingTool = ReadingTool.Dicom;
|
||||
indto.ReadingToolList = new List<string>()
|
||||
{
|
||||
"Length", "Bidirectional", "RectangleROI", "ArrowAnnotate", "CircleROI"
|
||||
};
|
||||
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
@@ -654,9 +668,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();
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||
@@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
})).ToList();
|
||||
|
||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||
await _visitTaskRepository.UpdatePartialFromEFAutoAsync(inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||
@@ -301,7 +301,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
LimitEdit = y.LimitEdit,
|
||||
MaxAnswerLength = y.MaxAnswerLength,
|
||||
FileType = y.FileType,
|
||||
Unit=y.Unit,
|
||||
Unit = y.Unit,
|
||||
QuestionGenre = y.QuestionGenre,
|
||||
ShowOrder = y.ShowOrder,
|
||||
DictionaryCode = y.DictionaryCode,
|
||||
|
||||
+122
-24
@@ -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,
|
||||
@@ -645,7 +647,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
||||
IsConvertedTask = x.IsConvertedTask,
|
||||
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
||||
IsExistUnprocessedFeedback=x.UserFeedBackList.Any(y => y.State == 0),
|
||||
IsExistUnprocessedFeedback = x.UserFeedBackList.Any(y => y.State == 0),
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
@@ -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();
|
||||
@@ -2971,7 +3034,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
SubjectId = inDto.SubjectId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||
SubjectCode = inDto.SubjectCode,
|
||||
PageIndex = 1,
|
||||
PageSize = 99999,
|
||||
|
||||
@@ -3054,24 +3119,45 @@ namespace IRaCIS.Core.Application.Service
|
||||
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
||||
&& x.TaskState == TaskState.Effect)
|
||||
.Where(x => !cacheSkipIds.Contains(x.Id));
|
||||
var count = await query.CountAsync();
|
||||
if (count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
//如果是随机阅片
|
||||
|
||||
Random random = new Random();
|
||||
var skipcount = 0;
|
||||
|
||||
var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault();
|
||||
|
||||
//以随机序号优先,阅片中优先先给IR
|
||||
if (minRandomOrder != null)
|
||||
{
|
||||
query = query.Where(x => x.RandomOrder == minRandomOrder);
|
||||
skipcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//没有随机序号的,那么就按照阅片中最新的时间给
|
||||
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
||||
if (maxReadingTime != null)
|
||||
{
|
||||
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
||||
skipcount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var count = await query.CountAsync();
|
||||
if (count >= 2)
|
||||
{
|
||||
skipcount = random.Next(0, count - 1);
|
||||
}
|
||||
|
||||
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
||||
if (maxReadingTime != null)
|
||||
if (count == 0)
|
||||
{
|
||||
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
||||
skipcount = 0;
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
|
||||
|
||||
task = await query
|
||||
.Select(x => new GetReadingTaskDto()
|
||||
{
|
||||
@@ -3092,6 +3178,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
else
|
||||
{
|
||||
//触发任务随机编号
|
||||
|
||||
await _downloadAndUploadService.SubejctRandomReadingTaskNameDeal(task.SubjectId, task.TrialReadingCriterionId);
|
||||
|
||||
task.TaskBlindName = await _visitTaskRepository.Where(t => t.Id == task.VisitTaskId).Select(t => t.TaskBlindName).FirstOrDefaultAsync() ?? "";
|
||||
}
|
||||
|
||||
if (task.SubjectCode.IsNullOrEmpty())
|
||||
{
|
||||
@@ -3114,9 +3208,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;
|
||||
@@ -3170,8 +3266,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
||||
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
||||
task.IsShowStudyName= trialInfo.IsShowStudyName;
|
||||
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)
|
||||
@@ -3204,7 +3302,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _readingCustomTagRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||
{
|
||||
ReadingTaskState = ReadingTaskState.WaitReading
|
||||
});
|
||||
@@ -3284,7 +3382,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpPost]
|
||||
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
||||
{
|
||||
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid) userRoleId : _userInfo.UserRoleId;
|
||||
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid)userRoleId : _userInfo.UserRoleId;
|
||||
|
||||
//int readingMinute = 120; // 为60整数
|
||||
int restMinute = 10; //
|
||||
|
||||
+1
-1
@@ -346,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
||||
|
||||
// 这里先保存 签名的时候 会统一创建关系
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
||||
{
|
||||
RelatedVisitTaskIds = relatedVisitTaskIds
|
||||
});
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
@@ -25,6 +27,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
||||
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
||||
IReadingImageTaskService _readingImageTaskService,
|
||||
IRepository<ReadingPeriodSet> _readingPeriodSetRepository,
|
||||
IRepository<ReadModule> _readModuleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||
{
|
||||
@@ -64,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||
.Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum)
|
||||
.Where(x => !x.IsBaseLine) // 排除基线
|
||||
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0)
|
||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||
@@ -94,6 +97,29 @@ namespace IRaCIS.Core.Application.Service
|
||||
throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]);
|
||||
}
|
||||
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
|
||||
|
||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||
{
|
||||
x.ReadingType,
|
||||
x.IsArbitrationReading,
|
||||
x.IsReadingPeriod,
|
||||
x.ArbitrationRule,
|
||||
x.IsGlobalReading,
|
||||
x.IsOncologyReading,
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
// 如果生成了 访视级别的阅片期裁判 不让修改
|
||||
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||
{
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||
{
|
||||
//---当前阅片已生成裁判任务,操作失败。
|
||||
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule()
|
||||
{
|
||||
SubjectVisitId = inDto.SubjectVisitIdId,
|
||||
@@ -499,8 +525,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
#region 方式二
|
||||
|
||||
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId).Where(t => t.IsLostVisit == false)
|
||||
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum < sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
||||
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId)/*.Where(t => t.IsLostVisit == false)*/
|
||||
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum <= sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
||||
{
|
||||
Id = sv.Id,
|
||||
CreateTime = sv.CreateTime,
|
||||
@@ -885,7 +911,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||
.Where(x => x.VisitNum > maxReadVisitNum)
|
||||
.Where(x => !x.IsBaseLine) // 排除基线
|
||||
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||
{
|
||||
@@ -954,6 +980,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
&& !x.IsAnalysisCreate && x.TrialReadingCriterionId == dto.TrialReadingCriterionId
|
||||
|
||||
).ToListAsync();
|
||||
|
||||
// 生成全局阅片任务 具体是否需要生成在_visitTaskHelpeService里面有逻辑判断
|
||||
foreach (var taskInfo in taskListInfo)
|
||||
{
|
||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||
@@ -974,6 +1002,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||
if (taskListInfo.Count() > 0)
|
||||
{
|
||||
await _readingImageTaskService.TriggerJudgeQuestion(taskListInfo[0].Id);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ModuleTypeEnum.Oncology:
|
||||
@@ -1066,6 +1101,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync();
|
||||
|
||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||
{
|
||||
x.ReadingType,
|
||||
x.IsArbitrationReading,
|
||||
x.IsReadingPeriod,
|
||||
x.ArbitrationRule,
|
||||
x.IsGlobalReading,
|
||||
x.IsOncologyReading,
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned))
|
||||
{
|
||||
@@ -1094,6 +1138,17 @@ namespace IRaCIS.Core.Application.Service
|
||||
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
||||
}
|
||||
|
||||
// 如果生成了 访视级别的阅片期裁判 不让删除
|
||||
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||
{
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||
{
|
||||
//---当前阅片已生成裁判任务,操作失败。
|
||||
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
@@ -17,6 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<VisitStage> _visitStageRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IReadingImageTaskService _readingImageTaskService,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IVisitTaskHelpeService _visitTaskHelpeService,
|
||||
@@ -165,6 +167,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
});
|
||||
};
|
||||
|
||||
await _readModuleRepository.AddRangeAsync(readModules);
|
||||
|
||||
await _readModuleRepository.SaveChangesAsync();
|
||||
|
||||
// 判断是否要添加肿瘤学或者全局阅片任务
|
||||
var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
|
||||
@@ -201,6 +206,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 根据SourceSubjectVisitId 分组
|
||||
var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
|
||||
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||
foreach (var item in visitTaskid)
|
||||
{
|
||||
await _readingImageTaskService.TriggerJudgeQuestion(item);
|
||||
}
|
||||
break;
|
||||
|
||||
case ReadingSetType.TumorReading:
|
||||
@@ -269,7 +282,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
break;
|
||||
}
|
||||
|
||||
await _readModuleRepository.AddRangeAsync(readModules);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -443,13 +456,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
|
||||
.Where(x => x.VisitNum > 0)// 不能是基线
|
||||
//.Where(x => x.VisitNum > 0)// 不能是基线
|
||||
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
|
||||
{
|
||||
VisitName = x.VisitName,
|
||||
VisitNum = x.VisitNum,
|
||||
VisitStageId = x.Id,
|
||||
}).ToListAsync();
|
||||
}).OrderBy(x=>x.VisitNum).ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{CriterionType.IVUS,typeof(IVUSCalculateService) },
|
||||
{CriterionType.OCT,typeof(OCTCalculateService) },
|
||||
{CriterionType.MRIPDFF,typeof(MRIPDFFCalculateService) },
|
||||
{CriterionType.mRECISTHCC,typeof(MRECISTHCCCalculate) },
|
||||
{CriterionType.mRECISTHCC,typeof(MRECISTHCCCalculateService) },
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
@@ -11,7 +12,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Reading")]
|
||||
public class MRECISTHCCCalculate(IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||
public class MRECISTHCCCalculateService(IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
||||
@@ -757,6 +758,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
QuestionMark.MajorAxis,
|
||||
QuestionMark.ShortAxis,
|
||||
QuestionMark.State,
|
||||
|
||||
};
|
||||
|
||||
var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||
@@ -788,6 +790,138 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 基线任务
|
||||
// 如果是基线 要把res1.1的病灶复制过来
|
||||
var recistTask = await _visitTaskRepository.Where(x =>
|
||||
x.TrialId == taskinfo.TrialId &&
|
||||
x.TaskState == TaskState.Effect &&
|
||||
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||
x.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Point1 &&
|
||||
x.SubjectId == taskinfo.SubjectId &&
|
||||
x.SourceSubjectVisitId == taskinfo.SourceSubjectVisitId &&
|
||||
x.DoctorUserId==taskinfo.DoctorUserId).FirstOrDefaultAsync();
|
||||
if (recistTask != null)
|
||||
{
|
||||
_userInfo.AuditIdentification = "HCC";
|
||||
|
||||
|
||||
var trialReadingCriterion=await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
|
||||
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == recistTask.Id).ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId).ToListAsync();
|
||||
foreach (var rowInfo in tableRowAnswers)
|
||||
{
|
||||
var question = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == rowInfo.LesionType).FirstOrDefaultAsync();
|
||||
|
||||
var organ = await _organInfoRepository.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefaultAsync();
|
||||
if (organ != null)
|
||||
{
|
||||
var newOrgan = await _organInfoRepository.Where(x => x.SystemCriterionId == trialReadingCriterion.ReadingQuestionCriterionSystemId &&
|
||||
x.Classification == organ.Classification &&
|
||||
x.Part == organ.Part &&
|
||||
x.TULOC == organ.TULOC &&
|
||||
x.TULAT == organ.TULAT &&
|
||||
x.IsLymphNodes == organ.IsLymphNodes
|
||||
).FirstOrDefaultAsync();
|
||||
|
||||
if (newOrgan != null)
|
||||
{
|
||||
rowInfo.OrganInfoId = newOrgan.Id;
|
||||
}
|
||||
}
|
||||
if(rowInfo.MeasureData!=null)
|
||||
{
|
||||
rowInfo.MeasureData = rowInfo.MeasureData.Replace(recistTask.Id.ToString(), taskinfo.Id.ToString());
|
||||
}
|
||||
|
||||
rowInfo.VisitTaskId = visitTaskId;
|
||||
rowInfo.IsCurrentTaskAdd = true;
|
||||
rowInfo.Id = NewId.NextGuid();
|
||||
rowInfo.FristAddTaskId = visitTaskId;
|
||||
rowInfo.QuestionId = question == null ? default(Guid) : question.Id;
|
||||
rowInfo.RowMark = question?.OrderMark + rowInfo.RowIndex.GetLesionMark();
|
||||
}
|
||||
|
||||
|
||||
|
||||
var recistTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == recistTask.Id).Select(x => new CopyTableAnswerDto()
|
||||
{
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowId = x.RowId,
|
||||
QuestionMark = x.ReadingTableQuestionTrial.QuestionMark,
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
TrialId = x.TrialId,
|
||||
}).ToListAsync();
|
||||
|
||||
foreach (var item in recistTableAnswers)
|
||||
{
|
||||
|
||||
item.QuestionId = tableRowAnswers.Where(y => y.OriginalId == item.RowId).Select(x => x.QuestionId).FirstOrDefault();
|
||||
item.TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == item.QuestionId && x.QuestionMark == item.QuestionMark).Select(x => x.Id).FirstOrDefault();
|
||||
}
|
||||
|
||||
recistTableAnswers = recistTableAnswers.Where(x => x.TableQuestionId != default(Guid)).ToList();
|
||||
|
||||
List<QuestionMark?> notNeedCopyMarks = new List<QuestionMark?>()
|
||||
{
|
||||
|
||||
};
|
||||
var tableAnswers = recistTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
Answer = notNeedCopyMarks.Contains(x.QuestionMark) ? string.Empty : x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault(),
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
TrialId = x.TrialId,
|
||||
VisitTaskId = visitTaskId,
|
||||
}).ToList();
|
||||
|
||||
// 添加 典型肝内病灶 默认值
|
||||
tableRowAnswers.ForEach(x =>
|
||||
{
|
||||
var tableQuestion = tableQuestionList.Where(y => y.ReadingQuestionId == x.QuestionId && y.QuestionMark == QuestionMark.TypicalIntrahepaticLesion).FirstOrDefault();
|
||||
if (tableQuestion != null)
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
Answer = ((int)(object)ReadingYesOrNo.No).ToString(),
|
||||
QuestionId = x.QuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
RowId = x.Id,
|
||||
TableQuestionId = tableQuestion.Id,
|
||||
TrialId = x.TrialId,
|
||||
VisitTaskId = visitTaskId,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
|
||||
addList.ForEach(x =>
|
||||
{
|
||||
x.MergeRow = null;
|
||||
x.SplitRow = null;
|
||||
|
||||
});
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new AddTaskLesionAnswerFromLastTaskOutDto()
|
||||
|
||||
@@ -729,6 +729,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
List<QuestionMark?> questionMarkList = new List<QuestionMark?>() { QuestionMark.FirstMeasurement, QuestionMark.SecondMeasurement, QuestionMark.ThirdMeasurement };
|
||||
var measuredValueList = rowInfo.SelectMany(x => x.TableQuestionList).Where(x =>x.Answer.IsNotNullOrEmpty()&& questionMarkList.Contains(x.QuestionMark)).Select(x => decimal.Parse(x.Answer)).ToList();
|
||||
if (measuredValueList.Any(x => x > 100))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||
}
|
||||
|
||||
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -828,7 +828,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||
|
||||
if (inDto.ComputationTrigger != ComputationTrigger.PatchDataStatistics)
|
||||
List< ComputationTrigger > computationTriggers = new List<ComputationTrigger>()
|
||||
{
|
||||
ComputationTrigger.PatchDataStatistics,
|
||||
ComputationTrigger.SaveEICRFQuestions,
|
||||
|
||||
};
|
||||
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||
{
|
||||
// 计算斑块统计数据
|
||||
await this.CalculatePatchDataStatistics(inDto);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -261,11 +261,18 @@ namespace IRaCIS.Application.Contracts
|
||||
#endregion
|
||||
|
||||
|
||||
#region 项目术语配置
|
||||
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
||||
/// <summary>
|
||||
/// 打开失访可读
|
||||
/// </summary>
|
||||
public bool IsOpenLostVistRead { get; set; } = false;
|
||||
|
||||
|
||||
#region 视图模型返回 项目术语配置 ,实际数据库没有配置
|
||||
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
||||
public CollectImagesType CollectImagesEnum { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public CollectImagesType CollectImagesEnum { get; set; }
|
||||
}
|
||||
|
||||
public class TrialPacsInfo
|
||||
|
||||
@@ -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,
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -613,7 +613,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
||||
|
||||
item.InstanceInfoList = await _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).Select(k =>
|
||||
item.InstanceInfoList = await _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).OrderBy(s => s.DicomSerie.SeriesNumber).ThenBy(s => s.DicomSerie.SeriesTime).ThenBy(x=>x.InstanceTime).Select(k =>
|
||||
new InstanceBasicInfo()
|
||||
{
|
||||
Id = k.Id,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,20 +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,
|
||||
None = 0,
|
||||
|
||||
CRCRequestBack=1,
|
||||
PMAgreeBack = 1,
|
||||
|
||||
IQCRequestBack=2,
|
||||
|
||||
PMAgreeBack=3,
|
||||
|
||||
PMNotAgreeBack = 4,
|
||||
PMNotAgreeBack = 2,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2205,6 +2205,12 @@ public enum SUVChangeVSBaseline
|
||||
/// </summary>
|
||||
SUVmax = 20,
|
||||
|
||||
/// <summary>
|
||||
/// 典型肝内病灶
|
||||
/// </summary>
|
||||
|
||||
TypicalIntrahepaticLesion = 21,
|
||||
|
||||
/// <summary>
|
||||
/// 外弹力膜面积
|
||||
/// </summary>
|
||||
@@ -2897,6 +2903,11 @@ public enum PET5PSScore
|
||||
/// 保存肝脏分段
|
||||
/// </summary>
|
||||
SaveLiverSegments = 11,
|
||||
|
||||
/// <summary>
|
||||
/// 保存eCRF
|
||||
/// </summary>
|
||||
SaveEICRFQuestions=12,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -285,4 +285,16 @@ public class VisitTask : BaseFullAuditEntity
|
||||
|
||||
[Comment("通知IR加急阅片时间")]
|
||||
public DateTime? ExpetidEmailNoticeTime { get; set; }
|
||||
|
||||
[Comment("退回原因")]
|
||||
public string PMBackReason { get; set; }
|
||||
|
||||
#region 完全随机增加字段
|
||||
|
||||
[Comment("完全随机阅片号")]
|
||||
public int? RandomOrder { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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("项目文件 - 文件类型表")]
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
@@ -182,7 +185,43 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
|
||||
public Guid? SubmitUserId { get; set; }
|
||||
public ReadingStatusEnum ReadingStatus { get; set; }
|
||||
|
||||
[Comment("影像上传 回退")]
|
||||
public ImageBackStateEnum ImageBackState { 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; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请原因
|
||||
/// </summary>
|
||||
public string ApplyReason { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 结果备注
|
||||
/// </summary>
|
||||
public string ResultRemark { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
@@ -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和CRC;CRC申请,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; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,11 @@
|
||||
|
||||
Guid? BatchId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 稽查额外字符串
|
||||
/// </summary>
|
||||
string AuditIdentification { get; set; }
|
||||
|
||||
bool IsNotNeedInspection { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 翻译单位
|
||||
/// </summary>
|
||||
/// <param name="answerType">答案类型</param>
|
||||
/// <param name="unit">单位</param>
|
||||
/// <param name="customUnit">自定义单位</param>
|
||||
/// <param name="unitDataList">单位字典</param>
|
||||
/// <param name="answer">答案</param>
|
||||
/// <returns></returns>
|
||||
public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List<UnitData> unitDataList,string? answer)
|
||||
{
|
||||
if (answerType == "upload")
|
||||
{
|
||||
return "❄❅❆❇❈❉❊";
|
||||
}
|
||||
|
||||
if (unit == ValueUnit.Custom)
|
||||
{
|
||||
return answer + customUnit;
|
||||
}
|
||||
|
||||
return answer + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
|
||||
}
|
||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||
{
|
||||
if (entityEntry.State == EntityState.Added)
|
||||
@@ -188,7 +210,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
//TrialDicList = string.Join(",", trialDics)
|
||||
|
||||
ImageFormatListStr = string.Join("|", entity.ImageFormatList),
|
||||
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x=>_userInfo.IsEn_Us?x.EnName:x.Name )),
|
||||
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x => _userInfo.IsEn_Us ? x.EnName : x.Name)),
|
||||
|
||||
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
||||
|
||||
@@ -1738,11 +1760,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
|
||||
var entity = item.Entity as IdentityUser;
|
||||
|
||||
|
||||
await InsertInspection<IdentityUser>(entity, type, x => new InspectionConvertDTO
|
||||
{
|
||||
IsDistinctionInterface = type == AuditOpt.Update ? true : false,
|
||||
});
|
||||
|
||||
await InsertInspection<IdentityUser>(entity, type, x => new InspectionConvertDTO
|
||||
{
|
||||
IsDistinctionInterface = type == AuditOpt.Update ? true : false,
|
||||
});
|
||||
}
|
||||
|
||||
// 项目参与人员
|
||||
@@ -1777,7 +1799,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
identityUser.Phone,
|
||||
identityUser.OrganizationName,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 项目人员
|
||||
@@ -1795,7 +1817,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
//var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
|
||||
await InsertInspection<TrialUserRole>(entity, type, x => new InspectionConvertDTO
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
IsDistinctionInterface = false,
|
||||
TrialId = x.TrialId,
|
||||
ObjectRelationParentId = x.TrialId,
|
||||
ExtraIndentification = extraIndentification,
|
||||
@@ -1890,6 +1912,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)))
|
||||
{
|
||||
@@ -1980,10 +2040,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
switch (_userInfo.RequestUrl)
|
||||
{
|
||||
case "QCOperation/updateModality":
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
|
||||
{
|
||||
extraIdentification = "/2";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
ObjectRelationParentId = x.SubjectVisitId
|
||||
ObjectRelationParentId = x.SubjectVisitId,
|
||||
ExtraIndentification = extraIdentification
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2074,7 +2147,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()
|
||||
{
|
||||
@@ -2975,6 +3048,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
QuestionId = t.Id,
|
||||
t.DictionaryCode,
|
||||
t.Unit,
|
||||
t.CustomUnit,
|
||||
t.ShowOrder,
|
||||
AnswerType = t.Type,
|
||||
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||
@@ -3007,8 +3081,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
{
|
||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||
t.ReadingQuestionTrial.Unit,
|
||||
t.ReadingQuestionTrial.CustomUnit,
|
||||
t.Unit,
|
||||
t.CustomUnit,
|
||||
t.DictionaryCode,
|
||||
t.QuestionName,
|
||||
t.QuestionEnName,
|
||||
@@ -3022,7 +3096,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
new
|
||||
{
|
||||
//如果问题类型是附件 特殊处理 方便前端解析
|
||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
|
||||
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||
u.QuestionName,
|
||||
u.QuestionEnName,
|
||||
u.DictionaryCode,
|
||||
@@ -3053,8 +3127,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
(t, u) =>
|
||||
new
|
||||
{
|
||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
|
||||
,
|
||||
Answer = Translationunit(u.AnswerType, u.Unit,u.CustomUnit, unitDataList, t.Answer),
|
||||
u.DictionaryCode,
|
||||
u.QuestionName,
|
||||
u.QuestionEnName,
|
||||
@@ -3114,6 +3187,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
{
|
||||
|
||||
Unit = (ValueUnit)int.Parse(x.Code),
|
||||
UnitName = x.Value.ToString(),
|
||||
}).ToList();
|
||||
|
||||
//获取表格问题名称 组合成数组
|
||||
@@ -3122,8 +3196,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
{
|
||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||
t.ReadingQuestionTrial.Unit,
|
||||
t.ReadingQuestionTrial.CustomUnit,
|
||||
t.Unit,
|
||||
t.CustomUnit,
|
||||
t.DictionaryCode,
|
||||
t.QuestionName,
|
||||
t.QuestionEnName,
|
||||
@@ -3159,10 +3233,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
|
||||
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
|
||||
|
||||
string extraIdentification = string.Empty;
|
||||
|
||||
var readingQuestion = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Include(x=>x.ReadingQuestionCriterionTrial).FirstNotNullAsync();
|
||||
if (readingQuestion.ReadingQuestionCriterionTrial.CriterionGroup == CriterionGroup.Nontumorous)
|
||||
{
|
||||
extraIdentification = "/Nontumorous";
|
||||
}
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
ExtraIndentification = extraIdentification,
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
@@ -3182,7 +3265,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
new
|
||||
{
|
||||
//如果问题类型是附件 特殊处理 方便前端解析
|
||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(),
|
||||
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||
u.QuestionName,
|
||||
u.QuestionEnName,
|
||||
@@ -3190,7 +3273,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
u.ShowOrder
|
||||
}
|
||||
).OrderBy(t => t.ShowOrder).ToList()
|
||||
});
|
||||
}, _userInfo.AuditIdentification);
|
||||
|
||||
|
||||
////添加/修改病灶接口 只会对单个病灶进行操作
|
||||
@@ -3449,18 +3532,41 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
}
|
||||
else
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
|
||||
|
||||
switch (_userInfo.RequestUrl)
|
||||
{
|
||||
//申请重阅
|
||||
case "VisitTask/applyReReading":
|
||||
|
||||
|
||||
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
||||
|
||||
//PM 申请重阅,区分不了是否有SPM参与
|
||||
|
||||
if (entity.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
{
|
||||
|
||||
//var hasSPM = _dbContext.VisitTaskReReading.Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||
|
||||
var hasSPM = entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading))
|
||||
.Select(t => t.Entity as VisitTaskReReading).Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||
|
||||
|
||||
if (!hasSPM)
|
||||
{
|
||||
//有SPM 是5 没有SPM是6
|
||||
extraIdentification = "/" + 6;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
//同意重阅
|
||||
case "VisitTask/ConfirmReReading":
|
||||
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||
{
|
||||
extraIdentification = "/" + 1;
|
||||
@@ -3472,51 +3578,105 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "VisitTask/PMSetTaskBack":
|
||||
|
||||
if (entity.PMBackReason.IsNotNullOrEmpty())
|
||||
{
|
||||
extraIdentification = "/" + "Reason";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||
|
||||
//访视任务-- 非Dicom 阅片
|
||||
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
{
|
||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//Dicom 阅片 签名
|
||||
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||
|
||||
//跳转阅片结果需要该参数
|
||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||
|
||||
obj.SubjectCode = subjectCode;
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/resetReadingTask":
|
||||
//跳转阅片结果需要该参数
|
||||
|
||||
obj.IsReadingReset = true;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
#region 裁判、肿瘤学、全局 都是通用的
|
||||
|
||||
//裁判任务 结果的保存 和签名提交
|
||||
if (entity.JudgeResultTaskId != null && (_userInfo.RequestUrl == "ReadingImageTask/SaveJudgeVisitTaskResult" || _userInfo.RequestUrl == "ReadingImageTask/SubmitJudgeVisitTaskResult"))
|
||||
{
|
||||
|
||||
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId == entity.Id && t.TrialReadingCriterionId == entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||
|
||||
|
||||
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
||||
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
||||
|
||||
obj.R1 = r1.FullName;
|
||||
obj.R2 = r2.FullName;
|
||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//增加进入阅片中的稽查
|
||||
|
||||
//重置阅片也会从待阅片 变为阅片中,因为复制病灶依赖这个改变
|
||||
if (obj.IsReadingReset != true)
|
||||
{
|
||||
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState == ReadingTaskState.WaitReading))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ChangeToReading";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entity.IsReadClinicalData == true)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.IsReadClinicalData == false))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ReadClinicalData";
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.TaskBlindName.Contains("Timepoint Ran"))
|
||||
{
|
||||
if(_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/TriggerSystemBlindingName";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//访视任务-- 非Dicom 阅片
|
||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitVisitTaskQuestions" && entity.ReadingTaskState != ReadingTaskState.HaveSigned && type == AuditOpt.Update)
|
||||
{
|
||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Dicom 阅片 签名
|
||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
|
||||
{
|
||||
//跳转阅片结果需要该参数
|
||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||
|
||||
obj.SubjectCode = subjectCode;
|
||||
}
|
||||
|
||||
#region 裁判、肿瘤学、全局 都是通用的
|
||||
|
||||
//裁判任务 结果的保存 和签名提交
|
||||
if (entity.JudgeResultTaskId != null && (_userInfo.RequestUrl == "ReadingImageTask/SaveJudgeVisitTaskResult" || _userInfo.RequestUrl == "ReadingImageTask/SubmitJudgeVisitTaskResult"))
|
||||
{
|
||||
|
||||
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId == entity.Id && t.TrialReadingCriterionId == entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||
|
||||
|
||||
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
||||
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
||||
|
||||
obj.R1 = r1.FullName;
|
||||
obj.R2 = r2.FullName;
|
||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 通过链接跳转 2022 12-19
|
||||
|
||||
@@ -3633,7 +3793,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 +3810,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 +4020,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 +4032,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 +4053,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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||
public string CutOffVisitName { get; set; }
|
||||
|
||||
public string SelectResult { get; set; }
|
||||
|
||||
public bool? IsReadingReset { get;set; }
|
||||
}
|
||||
public class InspectionConvertDTO : DataInspection
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
@@ -659,6 +660,8 @@ public class IRaCISDBContext : DbContext
|
||||
#endregion
|
||||
|
||||
|
||||
public virtual DbSet<SubjectVisitImageBackRecord> SubjectVisitImageBackRecord { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class TestLength : Entity
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
<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.14" />
|
||||
<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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
-17717
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-17716
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
-17774
File diff suppressed because it is too large
Load Diff
@@ -1,153 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class EventStore : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ReadingTableAnswerRowInfo_DicomInstance_InstanceId",
|
||||
table: "ReadingTableAnswerRowInfo");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomSeries_SeriesId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomStudy_StudyId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "JudgeResultTaskId",
|
||||
table: "VisitTask",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
comment: "裁判结果的任务ID(访视或者全局)",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true,
|
||||
oldComment: "裁判结果的任务ID");
|
||||
|
||||
migrationBuilder.AddUniqueConstraint(
|
||||
name: "AK_DicomInstance_Id",
|
||||
table: "DicomInstance",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EventStoreRecord",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EventType = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
EventData = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
EventState = table.Column<int>(type: "int", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EventStoreRecord", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EventStoreRecord_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "记录触发的事件,以及状态,从而方便重试操作");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EventStoreRecord_CreateUserId",
|
||||
table: "EventStoreRecord",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ReadingTableAnswerRowInfo_DicomInstance_InstanceId",
|
||||
table: "ReadingTableAnswerRowInfo",
|
||||
column: "InstanceId",
|
||||
principalTable: "DicomInstance",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomSeries_SeriesId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter",
|
||||
column: "SeriesId",
|
||||
principalTable: "DicomSeries",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomStudy_StudyId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter",
|
||||
column: "StudyId",
|
||||
principalTable: "DicomStudy",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ReadingTableAnswerRowInfo_DicomInstance_InstanceId",
|
||||
table: "ReadingTableAnswerRowInfo");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomSeries_SeriesId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomStudy_StudyId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EventStoreRecord");
|
||||
|
||||
migrationBuilder.DropUniqueConstraint(
|
||||
name: "AK_DicomInstance_Id",
|
||||
table: "DicomInstance");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "JudgeResultTaskId",
|
||||
table: "VisitTask",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
comment: "裁判结果的任务ID",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true,
|
||||
oldComment: "裁判结果的任务ID(访视或者全局)");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ReadingTableAnswerRowInfo_DicomInstance_InstanceId",
|
||||
table: "ReadingTableAnswerRowInfo",
|
||||
column: "InstanceId",
|
||||
principalTable: "DicomInstance",
|
||||
principalColumn: "SeqId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomSeries_SeriesId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter",
|
||||
column: "SeriesId",
|
||||
principalTable: "DicomSeries",
|
||||
principalColumn: "SeqId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomStudy_StudyId",
|
||||
table: "SubjectCriteriaEvaluationVisitStudyFilter",
|
||||
column: "StudyId",
|
||||
principalTable: "DicomStudy",
|
||||
principalColumn: "SeqId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-17777
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TrialImageDownloadAddSubejctId : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SubjectId",
|
||||
table: "TrialImageDownload",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SubjectId",
|
||||
table: "TrialImageDownload");
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user