Compare commits
201 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61cbfe231d | |||
| 9ee2dd477e | |||
| 7a0e1eda0c | |||
| a14472358b | |||
| 51f02e79c1 | |||
| 0202a61b07 | |||
| 6cc4c32625 | |||
| 3d304961d3 | |||
| f4426dd280 | |||
| 457544adc3 | |||
| f426df9d7f | |||
| 61780a3fe8 | |||
| 35d7202fc3 | |||
| cec6174bb6 | |||
| 52ba183846 | |||
| b08a0aa4f1 | |||
| 327874d396 | |||
| eae6be5fb4 | |||
| d49350a8cd | |||
| 72f0fd3193 | |||
| 0a581db6d1 | |||
| a2dd550a72 | |||
| 1e91c08ae3 | |||
| 96462aa4ba | |||
| dfba116268 | |||
| 1072049741 | |||
| 16bf3e9cd8 | |||
| 1861374c31 | |||
| 320ede4d7b | |||
| 15414365ec | |||
| a5ef0fc902 | |||
| 01ee530e38 | |||
| e8db8a892c | |||
| 1e0af11110 | |||
| 5f6b174dd9 | |||
| 4d2589c112 | |||
| 47706913ca | |||
| 1bbd11bbcd | |||
| 5d946d820e | |||
| 1e67d97169 | |||
| 84f4343791 | |||
| bd4e4e0072 | |||
| 5afe0be277 | |||
| 71fad05411 | |||
| 8afd215957 | |||
| 42e3b0df45 | |||
| facdb3264d | |||
| 9732b65017 | |||
| 80a60dff38 | |||
| 6276e0611a | |||
| 5ccfe70f97 | |||
| 7dc40fbc5c | |||
| a340167bfb | |||
| 0b7b96dff1 | |||
| 7b7286c2b3 | |||
| 5598385a5c | |||
| d5023c412f | |||
| b1d6d20800 | |||
| 4f5006560e | |||
| 43b302b727 | |||
| d3611ef310 | |||
| 0e0cf881be | |||
| a6ccd959fc | |||
| 4fb7f6818d | |||
| f902e44303 | |||
| 2939290915 | |||
| a55ba549eb | |||
| cdd8250a0c | |||
| d56d1142cd | |||
| e4b0210981 | |||
| 4026a34fcf | |||
| 7001639125 | |||
| 8fae551cc0 | |||
| cd00efe96f | |||
| 176f50e836 | |||
| 2cd78ab94e | |||
| 9f4e43e20a | |||
| 2caa7933ee | |||
| 3b6da279f8 | |||
| e87185a906 | |||
| 7a496e114b | |||
| fa2a0e7482 | |||
| 3f88a9df46 | |||
| 049b14ae97 | |||
| f14d4bf373 | |||
| a9afb684c9 | |||
| 9c447dbd68 | |||
| 0d446e6fcd | |||
| c8f04a878a | |||
| 633abdf0f4 | |||
| 8bd9f9a772 | |||
| 7164a53267 | |||
| f52b09e5e8 | |||
| 0acb7ca987 | |||
| 1778d45481 | |||
| 952655bf84 | |||
| c0921942ec | |||
| 7e67f4c7cf | |||
| 4d14b31fb5 | |||
| 003064429d | |||
| 34934762f0 | |||
| d1f542f03d | |||
| fbc7513f19 | |||
| e42c7407e3 | |||
| cbfae4126c | |||
| c712bee677 | |||
| f732edfc6f | |||
| 2898c0380f | |||
| a43ef376c4 | |||
| 7867a82e6e | |||
| e81e270d69 | |||
| 45b14abe63 | |||
| 22b1a839ba | |||
| 47ec4a5e7e | |||
| 4319982be9 | |||
| f0943ca9a4 | |||
| 8a42ed74bc | |||
| d9f60ded4a | |||
| 15fe8db248 | |||
| 7db339d876 | |||
| dd07057ca5 | |||
| a43abebc6e | |||
| 6a535e72d4 | |||
| 1535f1096f | |||
| 88fcddfd8b | |||
| d58cd79d28 | |||
| e5c35f7fab | |||
| 0f45729c94 | |||
| a78c4de654 | |||
| 4dfe5a1dce | |||
| ecaa72c12b | |||
| 95728c668c | |||
| 9356e6ed7e | |||
| 7a6cfc8978 | |||
| f744124f17 | |||
| 30e71b11e8 | |||
| 2de504005e | |||
| 6a41c33d34 | |||
| 3b48dfae31 | |||
| c7fd9a6bcb | |||
| 169ef180ff | |||
| f33d3d474b | |||
| 63e1331bd1 | |||
| 418cc9b4b9 | |||
| 71fb1eac6b | |||
| 0804a05925 | |||
| de6098013d | |||
| f8cd361415 | |||
| 0b1a640c3e | |||
| aa9df5838c | |||
| 2edacc9ff5 | |||
| a9a0a9d307 | |||
| 1937804e47 | |||
| 8e8b55fa46 | |||
| 3096671595 | |||
| a6102490c8 | |||
| 9e1cc1521f | |||
| a579c26ada | |||
| 754da2c7fc | |||
| 995bdee1f6 | |||
| a70f661e86 | |||
| 8312bfb78b | |||
| 7194796841 | |||
| c6918cca46 | |||
| be7b38c6ce | |||
| a7ebd50536 | |||
| 05f9b81e04 | |||
| 1f9eb9e36b | |||
| af46eb2d65 | |||
| d1e54629e7 | |||
| 78dbe23d0e | |||
| 4bf93d10b0 | |||
| 00827e9975 | |||
| 021b32587a | |||
| 5ffe1675db | |||
| d34eca2cb8 | |||
| 12ac7af11e | |||
| a19eb2abca | |||
| 4c9a8aadab | |||
| 034058999d | |||
| 34ea39e764 | |||
| 7caf00bd75 | |||
| aabe604e18 | |||
| f2bc281e2b | |||
| 4187a568f8 | |||
| 1611554c00 | |||
| 60fc8f9bce | |||
| 48eb20fa66 | |||
| 9e7bc09f84 | |||
| ec9e35180b | |||
| c757212c07 | |||
| 8415dd2be1 | |||
| 17d734ba11 | |||
| 476387b468 | |||
| 3a2cb138ab | |||
| fa763e6341 | |||
| c988ca0bca | |||
| c257dd4171 | |||
| ff026f45fc | |||
| cd2166f11b | |||
| 33cfacec84 |
@@ -4,6 +4,7 @@ using IRaCIS.Core.Infra.EFCore;
|
||||
using Medallion.Threading;
|
||||
using Medallion.Threading.SqlServer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -15,11 +16,12 @@ namespace IRaCIS.Core.SCP
|
||||
{
|
||||
services.AddHttpContextAccessor();
|
||||
services.AddScoped<IUserInfo, UserInfo>();
|
||||
services.AddScoped<ISaveChangesInterceptor, AuditEntityInterceptor>();
|
||||
|
||||
|
||||
|
||||
//这个注入没有成功--注入是没问题的,构造函数也只是支持参数就好,错在注入的地方不能写DbContext
|
||||
//Web程序中通过重用池中DbContext实例可提高高并发场景下的吞吐量, 这在概念上类似于ADO.NET Provider原生的连接池操作方式,具有节省DbContext实例化成本的优点
|
||||
services.AddDbContextPool<IRaCISDBContext>(options =>
|
||||
services.AddDbContext<IRaCISDBContext>((sp, options) =>
|
||||
{
|
||||
// 在控制台
|
||||
//public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => { builder.AddConsole(); });
|
||||
@@ -35,6 +37,7 @@ namespace IRaCIS.Core.SCP
|
||||
options.EnableSensitiveDataLogging();
|
||||
|
||||
options.AddInterceptors(new QueryWithNoLockDbCommandInterceptor());
|
||||
options.AddInterceptors(sp.GetServices<ISaveChangesInterceptor>());
|
||||
|
||||
options.UseProjectables();
|
||||
|
||||
|
||||
@@ -7,27 +7,25 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="DistributedLock.Core" Version="1.0.6" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.4" />
|
||||
<PackageReference Include="fo-dicom" Version="5.1.2" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.12.0" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageReference Include="DistributedLock.Core" Version="1.0.7" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.5" />
|
||||
<PackageReference Include="fo-dicom" Version="5.1.3" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.14.5" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.8" />
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="Minio" Version="6.0.2" />
|
||||
<PackageReference Include="Minio" Version="6.0.3" />
|
||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NewId" Version="4.0.1" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.2" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.1" />
|
||||
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.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.7.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -73,7 +73,6 @@ builder.Services.AddJsonLocalization(options => options.ResourcesPath = "Resourc
|
||||
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
//options.Filters.Add<LogActionFilter>();
|
||||
options.Filters.Add<ModelActionFilter>();
|
||||
options.Filters.Add<ProjectExceptionFilter>();
|
||||
options.Filters.Add<UnitOfWorkFilter>();
|
||||
|
||||
@@ -10,5 +10,16 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Test_IRC_SCP"
|
||||
}
|
||||
},
|
||||
"Uat_IRC_SCP": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:6200",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Uat_IRC_SCP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace IRaCIS.Core.SCP.Service
|
||||
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
@@ -51,9 +50,6 @@ namespace IRaCIS.Core.SCP.Service
|
||||
[MemberNotNull(nameof(_userInfo))]
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_repository))]
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_localizer))]
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
@@ -75,8 +71,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||
[MemberNotNull(nameof(_userInfo))]
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_repository))]
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
|
||||
[MemberNotNull(nameof(_localizer))]
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
@@ -93,8 +88,6 @@ namespace IRaCIS.Core.SCP.Service
|
||||
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
public static IResponseOutput Null404NotFound<TEntity>(TEntity? businessObject) where TEntity : class
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||
{
|
||||
try
|
||||
{
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE);
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE,fileSize);
|
||||
|
||||
if (!_SCPStudyIdList.Contains(scpStudyId))
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ using IRaCIS.Core.SCP.Service;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using MassTransit;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using Serilog.Sinks.File;
|
||||
|
||||
namespace IRaCIS.Core.SCP.Service
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||
/// <param name="dataset"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE)
|
||||
public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE,long fileSize)
|
||||
{
|
||||
string studyInstanceUid = dataset.GetString(DicomTag.StudyInstanceUID);
|
||||
string seriesInstanceUid = dataset.GetString(DicomTag.SeriesInstanceUID);
|
||||
@@ -270,7 +271,10 @@ namespace IRaCIS.Core.SCP.Service
|
||||
WindowCenter = dataset.GetSingleValueOrDefault(DicomTag.WindowCenter, string.Empty),
|
||||
WindowWidth = dataset.GetSingleValueOrDefault(DicomTag.WindowWidth, string.Empty),
|
||||
|
||||
Path = fileRelativePath
|
||||
Path = fileRelativePath,
|
||||
|
||||
FileSize= fileSize,
|
||||
|
||||
};
|
||||
|
||||
++findStudy.InstanceCount;
|
||||
@@ -300,7 +304,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||
}
|
||||
else
|
||||
{
|
||||
await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath });
|
||||
await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath,FileSize=fileSize });
|
||||
}
|
||||
|
||||
//await _studyRepository.SaveChangesAsync();
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||
{
|
||||
public interface IDicomArchiveService
|
||||
{
|
||||
Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE);
|
||||
Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE,long fileSize);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
"viewEndpoint": "https://zy-irc-cache.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
@@ -31,32 +30,15 @@
|
||||
},
|
||||
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=us-prod-mssql-service,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=us-prod-mssql-service,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=prod_mssql_standard,1433;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=prod_mssql_standard,1433;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||
},
|
||||
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": true,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30
|
||||
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "study@extimaging.com",
|
||||
"FromName": "研究单位阅片系统",
|
||||
"AuthorizationCode": "zhanying123",
|
||||
"SiteUrl": "https://study.extimaging.com/login"
|
||||
"DicomSCPServiceConfig": {
|
||||
"CalledAEList": [
|
||||
"STORESCP"
|
||||
],
|
||||
"ServerPort": 11112
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,19 +6,8 @@
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
<<<<<<<< HEAD:IRaCIS.Core.API/appsettings.US_Test_IRC.json
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
},
|
||||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "MinIO",
|
||||
========
|
||||
"ObjectStoreService": {
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
>>>>>>>> Test_IRC_Net8:IRC.Core.SCP/appsettings.Test_IRC_SCP.json
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
@@ -32,22 +21,6 @@
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
<<<<<<<< HEAD:IRaCIS.Core.API/appsettings.US_Test_IRC.json
|
||||
//"endPoint": "hir-oss.uat.extimaging.com",
|
||||
//"port": "443",
|
||||
//"useSSL": true,
|
||||
//"viewEndpoint": "https://hir-oss.uat.extimaging.com/hir-uat",
|
||||
|
||||
"endPoint": "47.117.164.182",
|
||||
"port": "9001",
|
||||
"useSSL": false,
|
||||
"viewEndpoint": "http://47.117.164.182:9001/test-irc-us",
|
||||
|
||||
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
||||
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
||||
"bucketName": "test-irc-us"
|
||||
|
||||
========
|
||||
"endPoint": "106.14.89.110",
|
||||
"port": "9001",
|
||||
"useSSL": false,
|
||||
@@ -55,7 +28,6 @@
|
||||
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||
"bucketName": "hir-test",
|
||||
"viewEndpoint": "http://106.14.89.110:9001/hir-test/"
|
||||
>>>>>>>> Test_IRC_Net8:IRC.Core.SCP/appsettings.Test_IRC_SCP.json
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
@@ -83,31 +55,6 @@
|
||||
"OpenLoginLimit": false,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
<<<<<<<< HEAD:IRaCIS.Core.API/appsettings.US_Test_IRC.json
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 587,
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"FromEmail": "donotreply@elevateimaging.ai",
|
||||
"FromName": "LiLi",
|
||||
"AuthorizationCode": "Q#669869497420ul",
|
||||
|
||||
"OrganizationName": "Elevate Imaging",
|
||||
"OrganizationNameCN": "Elevate Imaging",
|
||||
"CompanyName": "Elevate Imaging Inc.",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Elevate Imaging",
|
||||
"CompanyShortNameCN": "展影医疗",
|
||||
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
|
||||
}
|
||||
========
|
||||
"LoginFailLockMinutes": 30
|
||||
|
||||
},
|
||||
@@ -118,7 +65,6 @@
|
||||
"FromEmail": "test-study@extimaging.com",
|
||||
"FromName": "Test_Study",
|
||||
"AuthorizationCode": "zhanying123",
|
||||
>>>>>>>> Test_IRC_Net8:IRC.Core.SCP/appsettings.Test_IRC_SCP.json
|
||||
|
||||
"SiteUrl": "http://study.test.extimaging.com/login"
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
},
|
||||
"ObjectStoreService": {
|
||||
"ObjectStoreUse": "MinIO",
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
@@ -23,9 +22,6 @@ using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Aliyun.Acs.Core.Profile;
|
||||
using Aliyun.Acs.Core.Auth.Sts;
|
||||
using Aliyun.Acs.Core;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.Extensions.Options;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
@@ -33,6 +29,14 @@ using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
using NetTopologySuite.Algorithm;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
using AlibabaCloud.SDK.Sts20150401;
|
||||
using AlibabaCloud.SDK.Sts20150401.Models;
|
||||
using Org.BouncyCastle.Tls;
|
||||
using Amazon.SecurityToken.Model;
|
||||
using Amazon.SecurityToken;
|
||||
using Amazon;
|
||||
using AssumeRoleRequest = Amazon.SecurityToken.Model.AssumeRoleRequest;
|
||||
|
||||
namespace IRaCIS.Api.Controllers
|
||||
{
|
||||
@@ -100,12 +104,12 @@ namespace IRaCIS.Api.Controllers
|
||||
[HttpPost, Route("user/login")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> Login(UserLoginDTO loginUser,
|
||||
[FromServices] IEasyCachingProvider provider,
|
||||
[FromServices] IFusionCache _fusionCache,
|
||||
[FromServices] IUserService _userService,
|
||||
[FromServices] ITokenService _tokenService,
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
IMailVerificationService _mailVerificationService)
|
||||
[FromServices] ITokenService _tokenService,
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
[FromServices] IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
[FromServices] IMailVerificationService _mailVerificationService)
|
||||
{
|
||||
|
||||
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
||||
@@ -139,9 +143,9 @@ namespace IRaCIS.Api.Controllers
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(userId);
|
||||
|
||||
await provider.SetAsync(userId.ToString(), loginReturn.JWTStr, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(userId.ToString(), loginReturn.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await provider.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
await _fusionCache.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
|
||||
return ResponseOutput.Ok(loginReturn);
|
||||
|
||||
@@ -254,9 +258,9 @@ namespace IRaCIS.Api.Controllers
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
||||
|
||||
await provider.SetAsync(userId.ToString(), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await provider.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -293,7 +297,7 @@ namespace IRaCIS.Api.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("user/GetObjectStoreToken")]
|
||||
public IResponseOutput GetObjectStoreToken([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
public async Task<IResponseOutput> GetObjectStoreTokenAsync([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
{
|
||||
var serviceOption = options.CurrentValue;
|
||||
|
||||
@@ -302,98 +306,177 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
var ossOptions = serviceOption.AliyunOSS;
|
||||
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AliyunOSS = serviceOption.AliyunOSS, AWS = serviceOption.AWS });
|
||||
var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config()
|
||||
{
|
||||
AccessKeyId = ossOptions.AccessKeyId,
|
||||
AccessKeySecret = ossOptions.AccessKeySecret,
|
||||
//AccessKeyId = "LTAI5tJV76pYX5yPg1N9QVE8",
|
||||
//AccessKeySecret = "roRNLa9YG1of4pYruJGCNKBXEWTAWa",
|
||||
|
||||
#region 临时token 屏蔽
|
||||
//IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret);
|
||||
//DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
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 = credentials.Expiration,
|
||||
SecurityToken = credentials.SecurityToken,
|
||||
|
||||
|
||||
//// 创建一个STS请求
|
||||
//AssumeRoleRequest request = new AssumeRoleRequest
|
||||
//{
|
||||
// RoleArn = ossOptions.RoleArn, // 角色ARN,需要替换为你的角色ARN
|
||||
// RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||
// DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||
//};
|
||||
Region = ossOptions.Region,
|
||||
BucketName = ossOptions.BucketName,
|
||||
EndPoint = ossOptions.EndPoint,
|
||||
ViewEndpoint = ossOptions.ViewEndpoint,
|
||||
|
||||
};
|
||||
|
||||
//AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||
var awstempToken = await GetAWSTemToken(serviceOption);
|
||||
|
||||
//// 返回STS令牌信息给前端
|
||||
//var stsToken = new ObjectStoreDTO()
|
||||
//{
|
||||
// ObjectStoreUse = serviceOption.ObjectStoreUse,
|
||||
// AliyunOSS = new AliyunOSSTempToken()
|
||||
// {
|
||||
// AccessKeyId = response.Credentials.AccessKeyId,
|
||||
// AccessKeySecret = response.Credentials.AccessKeySecret,
|
||||
// SecurityToken = response.Credentials.SecurityToken,
|
||||
// Expiration = response.Credentials.Expiration,
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, AliyunOSS = tempToken,AWS= awstempToken });
|
||||
|
||||
// Region = ossOptions.Region,
|
||||
// BucketName = ossOptions.BucketName,
|
||||
// ViewEndpoint = ossOptions.ViewEndpoint,
|
||||
|
||||
// },
|
||||
// MinIO = serviceOption.MinIO
|
||||
//};
|
||||
//return ResponseOutput.Ok(stsToken);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
else if (Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO)
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO});
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||
var awsOptions = serviceOption.AWS;
|
||||
|
||||
//aws 临时凭证
|
||||
// 创建 STS 客户端
|
||||
var stsClient = new AmazonSecurityTokenServiceClient(awsOptions.AccessKeyId, awsOptions.SecretAccessKey);
|
||||
|
||||
// 使用 AssumeRole 请求临时凭证
|
||||
var assumeRoleRequest = new AssumeRoleRequest
|
||||
{
|
||||
|
||||
RoleArn = awsOptions.RoleArn, // 角色 ARN
|
||||
RoleSessionName = $"session-name-{NewId.NextGuid()}",
|
||||
DurationSeconds = awsOptions.DurationSeconds // 临时凭证有效期
|
||||
};
|
||||
|
||||
var assumeRoleResponse = await stsClient.AssumeRoleAsync(assumeRoleRequest);
|
||||
|
||||
var credentials = assumeRoleResponse.Credentials;
|
||||
|
||||
var tempToken = new AWSTempToken()
|
||||
{
|
||||
AccessKeyId = credentials.AccessKeyId,
|
||||
SecretAccessKey = credentials.SecretAccessKey,
|
||||
SessionToken= credentials.SessionToken,
|
||||
Expiration=credentials.Expiration,
|
||||
Region=awsOptions.Region,
|
||||
|
||||
BucketName = awsOptions.BucketName,
|
||||
EndPoint = awsOptions.EndPoint,
|
||||
ViewEndpoint = awsOptions.ViewEndpoint,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = tempToken });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[HttpGet("user/GenerateSTS")]
|
||||
public IResponseOutput GenerateSTS([FromServices] IOptionsMonitor<AliyunOSSOptions> options)
|
||||
|
||||
private async Task<AWSTempToken> GetAWSTemToken(ObjectStoreServiceOptions serviceOption)
|
||||
{
|
||||
var ossOptions = options.CurrentValue;
|
||||
var awsOptions = serviceOption.AWS;
|
||||
|
||||
//aws 临时凭证
|
||||
// 创建 STS 客户端
|
||||
var stsClient = new AmazonSecurityTokenServiceClient(awsOptions.AccessKeyId, awsOptions.SecretAccessKey);
|
||||
|
||||
IClientProfile profile = DefaultProfile.GetProfile(ossOptions.regionId, ossOptions.accessKeyId, ossOptions.accessKeySecret);
|
||||
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
// 创建一个STS请求
|
||||
AssumeRoleRequest request = new AssumeRoleRequest
|
||||
// 使用 AssumeRole 请求临时凭证
|
||||
var assumeRoleRequest = new AssumeRoleRequest
|
||||
{
|
||||
RoleArn = ossOptions.roleArn, // 角色ARN,需要替换为你的角色ARN
|
||||
RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||
DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||
|
||||
RoleArn = awsOptions.RoleArn, // 角色 ARN
|
||||
RoleSessionName = $"session-name-{NewId.NextGuid()}",
|
||||
DurationSeconds = awsOptions.DurationSeconds // 临时凭证有效期
|
||||
};
|
||||
|
||||
var assumeRoleResponse = await stsClient.AssumeRoleAsync(assumeRoleRequest);
|
||||
|
||||
AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||
var credentials = assumeRoleResponse.Credentials;
|
||||
|
||||
// 返回STS令牌信息给前端
|
||||
var stsToken = new
|
||||
var tempToken = new AWSTempToken()
|
||||
{
|
||||
AccessKeyId = response.Credentials.AccessKeyId,
|
||||
AccessKeySecret = response.Credentials.AccessKeySecret,
|
||||
SecurityToken = response.Credentials.SecurityToken,
|
||||
Expiration = response.Credentials.Expiration,
|
||||
|
||||
Region = ossOptions.region,
|
||||
BucketName = ossOptions.bucketName,
|
||||
ViewEndpoint = ossOptions.viewEndpoint,
|
||||
AccessKeyId = credentials.AccessKeyId,
|
||||
SecretAccessKey = credentials.SecretAccessKey,
|
||||
SessionToken = credentials.SessionToken,
|
||||
Expiration = credentials.Expiration,
|
||||
Region = awsOptions.Region,
|
||||
BucketName = awsOptions.BucketName,
|
||||
EndPoint = awsOptions.EndPoint,
|
||||
ViewEndpoint = awsOptions.ViewEndpoint,
|
||||
|
||||
};
|
||||
|
||||
return ResponseOutput.Ok(stsToken);
|
||||
|
||||
return tempToken;
|
||||
}
|
||||
|
||||
|
||||
#region aliyun-net-sdk-sts 之前
|
||||
//[HttpGet("user/GenerateSTS")]
|
||||
//public IResponseOutput GenerateSTS([FromServices] IOptionsMonitor<AliyunOSSOptions> options)
|
||||
//{
|
||||
// var ossOptions = options.CurrentValue;
|
||||
|
||||
|
||||
// IClientProfile profile = DefaultProfile.GetProfile(ossOptions.regionId, ossOptions.accessKeyId, ossOptions.accessKeySecret);
|
||||
// DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
// // 创建一个STS请求
|
||||
// AssumeRoleRequest request = new AssumeRoleRequest
|
||||
// {
|
||||
// RoleArn = ossOptions.roleArn, // 角色ARN,需要替换为你的角色ARN
|
||||
// RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||
// DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||
// };
|
||||
|
||||
|
||||
// AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||
|
||||
// // 返回STS令牌信息给前端
|
||||
// var stsToken = new
|
||||
// {
|
||||
// AccessKeyId = response.Credentials.AccessKeyId,
|
||||
// AccessKeySecret = response.Credentials.AccessKeySecret,
|
||||
// SecurityToken = response.Credentials.SecurityToken,
|
||||
// Expiration = response.Credentials.Expiration,
|
||||
|
||||
// Region = ossOptions.region,
|
||||
// BucketName = ossOptions.bucketName,
|
||||
// ViewEndpoint = ossOptions.viewEndpoint,
|
||||
|
||||
// };
|
||||
|
||||
// return ResponseOutput.Ok(stsToken);
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpGet("User/UserRedirect")]
|
||||
[AllowAnonymous]
|
||||
@@ -427,7 +510,7 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
[HttpGet, Route("ip")]
|
||||
[AllowAnonymous]
|
||||
public IResponseOutput Get([FromServices] IHttpContextAccessor _context/*, [FromServices] IUserService _userService*/)
|
||||
public IResponseOutput Get([FromServices] IHttpContextAccessor _context)
|
||||
{
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -448,7 +531,7 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
[HttpGet, Route("ip2")]
|
||||
[AllowAnonymous]
|
||||
public IResponseOutput Get2([FromServices] IHttpContextAccessor _context, [FromServices] IRepository _userService)
|
||||
public IResponseOutput Get2([FromServices] IHttpContextAccessor _context)
|
||||
{
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -19,18 +19,12 @@ namespace IRaCIS.Core.API.Controllers.Special
|
||||
//谨慎修改 涉及到财务模块
|
||||
|
||||
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class FinancialChangeController : ControllerBase
|
||||
public class FinancialChangeController(
|
||||
ITrialService _trialService,
|
||||
ICalculateService _calculateService,
|
||||
IStringLocalizer _localizer) : ControllerBase
|
||||
{
|
||||
private readonly ITrialService _trialService;
|
||||
private readonly ICalculateService _calculateService;
|
||||
private IStringLocalizer _localizer { get; set; }
|
||||
public FinancialChangeController(ITrialService trialService, ICalculateService calculateService, IStringLocalizer localizer
|
||||
)
|
||||
{
|
||||
_localizer = localizer;
|
||||
_trialService = trialService;
|
||||
_calculateService = calculateService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//[TrialAudit(AuditType.TrialAudit, AuditOptType.AddOrUpdateTrial)]
|
||||
|
||||
@@ -26,78 +26,19 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
[ApiController, ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
[UnitOfWork]
|
||||
public class InspectionController : ControllerBase
|
||||
public class InspectionController(
|
||||
ITrialDocumentService _trialDocumentService,
|
||||
IReadingImageTaskService _iReadingImageTaskService,
|
||||
ITrialConfigService _trialConfigService,
|
||||
IClinicalAnswerService _clinicalAnswerService,
|
||||
IReadingClinicalDataService _readingClinicalDataService,
|
||||
IQCOperationService _qCOperationService,
|
||||
IInspectionService _inspectionService,
|
||||
IReadingMedicalReviewService _readingMedicalReviewService,
|
||||
IReadingMedicineQuestionService _readingMedicineQuestionService
|
||||
) : ControllerBase
|
||||
{
|
||||
private readonly IRepository _repository;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IUserInfo _userInfo;
|
||||
private readonly ITrialDocumentService _trialDocumentService;
|
||||
private readonly IQCListService _qCListService;
|
||||
private readonly IReadingImageTaskService _iReadingImageTaskService;
|
||||
private readonly IHttpContextAccessor _httpContext;
|
||||
private readonly ITrialConfigService _trialConfigService;
|
||||
private readonly INoneDicomStudyService _noneDicomStudyService;
|
||||
private readonly IClinicalAnswerService _clinicalAnswerService;
|
||||
private readonly ISubjectService _subjectService;
|
||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||
private readonly ISubjectVisitService _subjectVisitService;
|
||||
private readonly IQCOperationService _qCOperationService;
|
||||
private readonly IClinicalDataService _clinicalDataService;
|
||||
private readonly IVisitPlanService _visitPlanService;
|
||||
|
||||
private readonly IInspectionService _inspectionService;
|
||||
private readonly IReadingMedicalReviewService _readingMedicalReviewService;
|
||||
private readonly IReadingMedicineQuestionService _readingMedicineQuestionService;
|
||||
private readonly IRepository<DataInspection> _dataInspectionRepository;
|
||||
private delegate Task<IResponseOutput> executionFun(dynamic data);
|
||||
|
||||
public InspectionController(IRepository repository,
|
||||
IRepository<DataInspection> _repositoryDataInspection,
|
||||
IMapper mapper, IUserInfo userInfo,
|
||||
ITrialDocumentService trialDocumentService,
|
||||
IRepository<DataInspection> dataInspectionRepository,
|
||||
IQCListService _qCListService,
|
||||
IReadingImageTaskService _iReadingImageTaskService,
|
||||
IHttpContextAccessor httpContext,
|
||||
IInspectionService sinspectionService,
|
||||
IReadingMedicalReviewService readingMedicalReviewService,
|
||||
IReadingMedicineQuestionService readingMedicineQuestionService,
|
||||
ITrialConfigService _trialConfigService,
|
||||
INoneDicomStudyService noneDicomStudyService,
|
||||
IClinicalAnswerService clinicalAnswerService,
|
||||
ISubjectService _subjectService,
|
||||
IReadingClinicalDataService _readingClinicalDataService,
|
||||
ISubjectVisitService subjectVisitService,
|
||||
IQCOperationService qCOperationService,
|
||||
IClinicalDataService clinicalDataService,
|
||||
IVisitPlanService visitPlanService
|
||||
)
|
||||
{
|
||||
this._repository = repository;
|
||||
this._mapper = mapper;
|
||||
this._userInfo = userInfo;
|
||||
this._inspectionService = sinspectionService;
|
||||
this._readingMedicalReviewService = readingMedicalReviewService;
|
||||
this._readingMedicineQuestionService = readingMedicineQuestionService;
|
||||
this._trialDocumentService = trialDocumentService;
|
||||
this._qCListService = _qCListService;
|
||||
this._iReadingImageTaskService = _iReadingImageTaskService;
|
||||
this._httpContext = httpContext;
|
||||
this._trialConfigService = _trialConfigService;
|
||||
this._noneDicomStudyService = noneDicomStudyService;
|
||||
this._clinicalAnswerService = clinicalAnswerService;
|
||||
this._subjectService = _subjectService;
|
||||
this._readingClinicalDataService = _readingClinicalDataService;
|
||||
this._subjectVisitService = subjectVisitService;
|
||||
this._qCOperationService = qCOperationService;
|
||||
this._clinicalDataService = clinicalDataService;
|
||||
this._visitPlanService = visitPlanService;
|
||||
this._dataInspectionRepository = dataInspectionRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 获取稽查数据
|
||||
/// <summary>
|
||||
/// 获取稽查数据
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using AutoMapper;
|
||||
using DocumentFormat.OpenXml.Drawing;
|
||||
using EasyCaching.Core;
|
||||
using ExcelDataReader;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
@@ -10,8 +9,7 @@ using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
||||
using IRaCIS.Core.Application.MediatR.Handlers;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.Service.ImageAndDoc;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
@@ -21,7 +19,7 @@ using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using MassTransit;
|
||||
using MediatR;
|
||||
using MassTransit.Mediator;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Cors.Infrastructure;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@@ -46,6 +44,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace IRaCIS.Core.API.Controllers
|
||||
@@ -228,35 +227,14 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Image")]
|
||||
[ApiController]
|
||||
public class StudyController : UploadBaseController
|
||||
public class StudyController(
|
||||
IMediator _mediator,
|
||||
QCCommon _qCCommon,
|
||||
IUserInfo _userInfo,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IStringLocalizer _localizer) : UploadBaseController
|
||||
{
|
||||
public IMapper _mapper { get; set; }
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
private readonly IRepository _repository;
|
||||
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly QCCommon _qCCommon;
|
||||
public StudyController(IMapper mapper, IStringLocalizer localizer, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IMediator mediator, IEasyCachingProvider provider,
|
||||
QCCommon qCCommon,
|
||||
IRepository repository)
|
||||
{
|
||||
_qCCommon = qCCommon;
|
||||
_provider = provider;
|
||||
_hostEnvironment = hostEnvironment;
|
||||
_mediator = mediator;
|
||||
_localizer = localizer;
|
||||
_mapper = mapper;
|
||||
_userInfo = userInfo;
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost, Route("Study/PreArchiveStudy")]
|
||||
@@ -266,11 +244,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
||||
{
|
||||
|
||||
if (_provider.Get<List<SystemAnonymization>>(StaticData.Anonymize.Anonymize_AddFixedFiled).Value == null)
|
||||
{
|
||||
await _mediator.Send(new AnonymizeCacheRequest());
|
||||
}
|
||||
|
||||
var savedInfo = _studyService.GetSaveToDicomInfo(preArchiveStudyCommand.SubjectVisitId);
|
||||
|
||||
var studyMonitor = new StudyMonitor()
|
||||
@@ -298,9 +271,8 @@ namespace IRaCIS.Core.API.Controllers
|
||||
[DisableFormValueModelBinding]
|
||||
[DisableRequestSizeLimit]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> ArchiveStudyNew(/*[FromForm] ArchiveStudyCommand archiveStudyCommand,*/ Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId, Guid studyMonitorId,
|
||||
public async Task<IResponseOutput> ArchiveStudyNew( Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId, Guid studyMonitorId,
|
||||
[FromServices] ILogger<UploadDownLoadController> _logger,
|
||||
[FromServices] IEasyCachingProvider _provider,
|
||||
[FromServices] IStudyService _studyService,
|
||||
[FromServices] IHubContext<UploadHub, IUploadClient> _uploadHub,
|
||||
[FromServices] IDicomArchiveService _dicomArchiveService,
|
||||
@@ -325,22 +297,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
var startTime = DateTime.Now;
|
||||
|
||||
|
||||
if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value == _userInfo.Id)
|
||||
{
|
||||
_provider.Set($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}"))
|
||||
//{
|
||||
// //---当前已有人正在上传和归档该检查!
|
||||
// return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress"));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _provider.Set($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30));
|
||||
//}
|
||||
|
||||
//到了接口,代表上传结束了
|
||||
|
||||
@@ -406,13 +362,12 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_provider.Remove($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}");
|
||||
|
||||
//---请求异常,请重试!
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_RequestError"]);
|
||||
}
|
||||
|
||||
studyMonitor.FileSize = (decimal)HttpContext.Request.ContentLength;
|
||||
studyMonitor.FileSize = (long)HttpContext.Request.ContentLength;
|
||||
studyMonitor.FileCount = archiveResult.ReceivedFileCount;
|
||||
studyMonitor.FailedFileCount = archiveResult.ErrorFiles.Count;
|
||||
studyMonitor.IsDicomReUpload = archiveStudyCommand.AbandonStudyId != null;
|
||||
@@ -445,7 +400,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
finally
|
||||
{
|
||||
_provider.Remove($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}");
|
||||
|
||||
studyMonitor.StudyId = archiveResult.ArchivedDicomStudies.FirstOrDefault()?.Id ?? Guid.Empty;
|
||||
studyMonitor.StudyCode = archiveResult.ArchivedDicomStudies.FirstOrDefault()?.StudyCode;
|
||||
@@ -490,12 +444,15 @@ namespace IRaCIS.Core.API.Controllers
|
||||
/// <param name="incommand"></param>
|
||||
/// <param name="_noneDicomStudyRepository"></param>
|
||||
/// <param name="_studyMonitorRepository"></param>
|
||||
/// <param name="_noneDicomStudyFileRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("NoneDicomStudy/UploadNoneDicomFile")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
public async Task<IResponseOutput> UploadNoneDicomFile(UploadNoneDicomFileCommand incommand,
|
||||
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository, [FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
||||
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository,
|
||||
[FromServices] IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository)
|
||||
{
|
||||
|
||||
var subjectVisitId = incommand.SubjectVisitId;
|
||||
@@ -503,9 +460,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||
var noneDicomStudyId = incommand.NoneDicomStudyId;
|
||||
|
||||
|
||||
await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
||||
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
|
||||
|
||||
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.TrialSiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
var sv = (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.TrialSiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
|
||||
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == studyMonitorId);
|
||||
|
||||
@@ -513,7 +470,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
foreach (var item in incommand.UploadedFileList)
|
||||
{
|
||||
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType });
|
||||
await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType,FileSize=item.FileFize });
|
||||
|
||||
}
|
||||
var uploadFinishedTime = DateTime.Now;
|
||||
@@ -532,7 +489,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
studyMonitor.IP = _userInfo.IP;
|
||||
studyMonitor.IsSuccess = true;
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
await _noneDicomStudyRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -546,12 +503,13 @@ namespace IRaCIS.Core.API.Controllers
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="oSSService"></param>
|
||||
/// <param name="_inspectionFileRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId, [FromServices] IOSSService oSSService)
|
||||
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId, [FromServices] IOSSService oSSService, [FromServices] IRepository<InspectionFile> _inspectionFileRepository)
|
||||
{
|
||||
|
||||
var fileName = string.Empty;
|
||||
@@ -561,9 +519,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||
{
|
||||
fileName = realFileName;
|
||||
|
||||
if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls"))
|
||||
if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".xls"))
|
||||
{
|
||||
//---支持.xlsx、.xls、.csv格式的文件上传。
|
||||
//---支持.xlsx、.xls格式的文件上传。
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_SupportedFormats"]);
|
||||
}
|
||||
|
||||
@@ -573,7 +531,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/Check", realFileName);
|
||||
|
||||
await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||
|
||||
return ossRelativePath;
|
||||
|
||||
@@ -743,11 +701,16 @@ namespace IRaCIS.Core.API.Controllers
|
||||
//---请保证上传数据符合模板文件中的样式,且存在有效数据。
|
||||
return ResponseOutput.NotOk(_localizer["UploadDownLoad_InvalidData"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _mediator.Send(new ConsistencyVerificationRequest() { ETCList = etcCheckList, TrialId = trialId });
|
||||
|
||||
// 适合获取结果的
|
||||
//var client = _mediator.CreateRequestClient<ConsistenCheckCommand>();
|
||||
//await client.GetResponse<ConsistenCheckResult>(new ConsistenCheckCommand() { ETCList = etcCheckList, TrialId = trialId });
|
||||
|
||||
//不获取结果,不用定义返回类型
|
||||
await _mediator.Send(new ConsistenCheckCommand() { ETCList = etcCheckList, TrialId = trialId });
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
@@ -889,89 +852,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
|
||||
|
||||
#region 废弃
|
||||
|
||||
/// <summary>
|
||||
/// 下载多个医生的所有附件
|
||||
/// </summary>
|
||||
/// <param name="doctorIds"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete]
|
||||
[HttpPost, Route("file/downloadDoctorAttachments")]
|
||||
public async Task<IResponseOutput<UploadFileInfoDTO>> DownloadAttachment(Guid[] doctorIds)
|
||||
{
|
||||
|
||||
var path = await _fileService.CreateDoctorsAllAttachmentZip(doctorIds);
|
||||
|
||||
return ResponseOutput.Ok(new UploadFileInfoDTO
|
||||
{
|
||||
FilePath = path,
|
||||
FullFilePath = path + "?access_token=" + HttpContext.Request.Headers["Authorization"].ToString().Substring(7)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载指定医生的指定附件
|
||||
/// </summary>
|
||||
/// <param name="doctorId">医生Id</param>
|
||||
/// <param name="attachmentIds">要下载的附件Id</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("file/downloadByAttachmentId/{doctorId}")]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput<UploadFileInfoDTO>> DownloadAttachmentById(Guid doctorId, Guid[] attachmentIds)
|
||||
{
|
||||
var path = await _fileService.CreateZipPackageByAttachment(doctorId, attachmentIds);
|
||||
return ResponseOutput.Ok(new UploadFileInfoDTO
|
||||
{
|
||||
FilePath = await _fileService.CreateZipPackageByAttachment(doctorId, attachmentIds),
|
||||
FullFilePath = path + "?access_token=" + HttpContext.Request.Headers["Authorization"].ToString().Substring(7)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下载医生官方简历 首页 区分 中文和英文
|
||||
/// </summary>
|
||||
/// <param name="language"></param>
|
||||
/// <param name="doctorIds"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("file/downloadOfficialCV/{language}")]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput<UploadFileInfoDTO>> DownloadOfficialResume(int language, Guid[] doctorIds)
|
||||
{
|
||||
|
||||
var path = await _fileService.CreateDoctorsAllAttachmentZip(doctorIds);
|
||||
return ResponseOutput.Ok(new UploadFileInfoDTO
|
||||
{
|
||||
FilePath = await _fileService.CreateOfficialResumeZip(language, doctorIds),
|
||||
FullFilePath = path + "?access_token=" + HttpContext.Request.Headers["Authorization"].ToString().Substring(7)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 入组 项目下载简历
|
||||
/// </summary>
|
||||
/// <param name="language"></param>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="doctorIdArray"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("enroll/downloadResume/{trialId:guid}/{language}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
[AllowAnonymous]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput<string>> DownloadResume(int language, Guid trialId, Guid[] doctorIdArray)
|
||||
{
|
||||
var zipPath = await _fileService.CreateOfficialResumeZip(language, doctorIdArray);
|
||||
|
||||
return ResponseOutput.Ok(zipPath);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1064,11 +944,11 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
var generateUserTypeList = new List<string>() { "CRC", "CRA" };
|
||||
|
||||
if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
||||
{
|
||||
//用户类型仅能为 CRC,SR,CRA 请核查Excel数据
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]);
|
||||
}
|
||||
//if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
||||
//{
|
||||
// //用户类型仅能为 CRC,SR,CRA 请核查Excel数据
|
||||
// throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]);
|
||||
//}
|
||||
if (excelList.Count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_NoValiddata"]);
|
||||
|
||||
@@ -61,27 +61,23 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="aliyun-net-sdk-sts" Version="3.1.2" />
|
||||
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.13" />
|
||||
<PackageReference Include="ConfigMapFileProvider" Version="2.0.1" />
|
||||
<PackageReference Include="EasyCaching.Interceptor.Castle" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.Serialization.MessagePack" Version="1.9.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.InMemory" Version="0.10.3" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.8.14" />
|
||||
<PackageReference Include="Invio.Extensions.Authentication.JwtBearer" Version="2.0.1" />
|
||||
<PackageReference Include="LogDashboard" Version="1.4.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.7.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<param name="doctorId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Application.Services.IMailVerificationService)">
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,ZiggyCreatures.Caching.Fusion.IFusionCache,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Application.Services.IMailVerificationService)">
|
||||
<summary> 系统用户登录接口[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">
|
||||
@@ -278,24 +278,26 @@
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadBaseController.DicomFileUploadAsync(System.Func{System.String,System.IO.Stream,System.Int32,System.Threading.Tasks.Task},System.String)">
|
||||
<summary> 流式上传 Dicom上传 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.ArchiveStudyNew(System.Guid,System.Guid,System.String,System.Nullable{System.Guid},System.Guid,Microsoft.Extensions.Logging.ILogger{IRaCIS.Core.API.Controllers.UploadDownLoadController},EasyCaching.Core.IEasyCachingProvider,IRaCIS.Core.Application.Contracts.IStudyService,Microsoft.AspNetCore.SignalR.IHubContext{IRaCIS.Core.API.UploadHub,IRaCIS.Core.API.IUploadClient},IRaCIS.Core.Application.Contracts.Dicom.IDicomArchiveService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.ArchiveStudyNew(System.Guid,System.Guid,System.String,System.Nullable{System.Guid},System.Guid,Microsoft.Extensions.Logging.ILogger{IRaCIS.Core.API.Controllers.UploadDownLoadController},IRaCIS.Core.Application.Contracts.IStudyService,Microsoft.AspNetCore.SignalR.IHubContext{IRaCIS.Core.API.UploadHub,IRaCIS.Core.API.IUploadClient},IRaCIS.Core.Application.Contracts.Dicom.IDicomArchiveService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<summary>Dicom 归档</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFileCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFileCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile})">
|
||||
<summary>
|
||||
上传非Dicom 文件 支持压缩包 多文件上传
|
||||
</summary>
|
||||
<param name="incommand"></param>
|
||||
<param name="_noneDicomStudyRepository"></param>
|
||||
<param name="_studyMonitorRepository"></param>
|
||||
<param name="_noneDicomStudyFileRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid,IRaCIS.Core.Application.Helper.IOSSService)">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid,IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.InspectionFile})">
|
||||
<summary>
|
||||
一致性核查 excel上传 支持三种格式
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="oSSService"></param>
|
||||
<param name="_inspectionFileRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
@@ -326,38 +328,6 @@
|
||||
<param name="_attachmentrepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadAttachment(System.Guid[])">
|
||||
<summary>
|
||||
下载多个医生的所有附件
|
||||
</summary>
|
||||
<param name="doctorIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadAttachmentById(System.Guid,System.Guid[])">
|
||||
<summary>
|
||||
下载指定医生的指定附件
|
||||
</summary>
|
||||
<param name="doctorId">医生Id</param>
|
||||
<param name="attachmentIds">要下载的附件Id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadOfficialResume(System.Int32,System.Guid[])">
|
||||
<summary>
|
||||
下载医生官方简历 首页 区分 中文和英文
|
||||
</summary>
|
||||
<param name="language"></param>
|
||||
<param name="doctorIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadResume(System.Int32,System.Guid,System.Guid[])">
|
||||
<summary>
|
||||
入组 项目下载简历
|
||||
</summary>
|
||||
<param name="language"></param>
|
||||
<param name="trialId"></param>
|
||||
<param name="doctorIdArray"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.DownloadCommonFile(System.String,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument})">
|
||||
<summary> 通用文件下载 </summary>
|
||||
</member>
|
||||
@@ -383,6 +353,11 @@
|
||||
序列化,反序列化的时候,处理时间 时区转换
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.JSONTimeZoneConverter.#ctor(Microsoft.AspNetCore.Http.IHttpContextAccessor)">
|
||||
<summary>
|
||||
序列化,反序列化的时候,处理时间 时区转换
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.NullToEmptyStringResolver.CreateProperties(System.Type,Newtonsoft.Json.MemberSerialization)">
|
||||
<summary>
|
||||
创建属性
|
||||
@@ -391,13 +366,6 @@
|
||||
<param name="memberSerialization">序列化成员</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.WX.CoreApi.Auth.AuthMiddleware.Invoke(Microsoft.AspNetCore.Http.HttpContext)">
|
||||
<summary>
|
||||
为了前端 一段时间无操作,需要重新登陆
|
||||
</summary>
|
||||
<param name="httpContext"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:TimeZoneAdjustmentMiddleware">
|
||||
<summary>
|
||||
废弃,没用
|
||||
|
||||
+97
-22
@@ -4,8 +4,6 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using MediatR;
|
||||
using IRaCIS.Core.Application.MediatR.Handlers;
|
||||
using System.Threading.Tasks;
|
||||
using MassTransit;
|
||||
using MassTransit.NewIdProviders;
|
||||
@@ -29,8 +27,15 @@ using IRaCIS.Core.Application.Service.ImageAndDoc;
|
||||
using IP2Region.Net.Abstractions;
|
||||
using IP2Region.Net.XDB;
|
||||
using IRaCIS.Core.Application.BusinessFilter;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||
|
||||
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
||||
#region 获取环境变量
|
||||
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
||||
var config = new ConfigurationBuilder()
|
||||
@@ -125,7 +130,7 @@ builder.Services.AddDynamicWebApiSetup();
|
||||
//AutoMapper
|
||||
builder.Services.AddAutoMapperSetup();
|
||||
//EF ORM QueryWithNoLock
|
||||
builder.Services.AddEFSetup(_configuration);
|
||||
builder.Services.AddEFSetup(_configuration,enviromentName);
|
||||
//Http 响应压缩
|
||||
builder.Services.AddResponseCompressionSetup();
|
||||
//Swagger Api 文档
|
||||
@@ -134,9 +139,30 @@ builder.Services.AddSwaggerSetup();
|
||||
builder.Services.AddJWTAuthSetup(_configuration);
|
||||
|
||||
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
||||
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||
//builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||
|
||||
#region MassTransit
|
||||
//masstransit组件 也支持MediatR 中介者模式,但是支持分布式,考虑后续,所以在次替代MediatR
|
||||
builder.Services.AddMediator(cfg =>
|
||||
{
|
||||
cfg.AddConsumer<ConsistencyCheckConsumer>();
|
||||
});
|
||||
|
||||
builder.Services.AddMassTransit(cfg =>
|
||||
{
|
||||
cfg.UsingInMemory();
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
#region FusionCache
|
||||
|
||||
builder.Services.AddFusionCache();
|
||||
|
||||
#endregion
|
||||
|
||||
// EasyCaching 缓存
|
||||
builder.Services.AddEasyCachingSetup(_configuration);
|
||||
//builder.Services.AddEasyCachingSetup(_configuration);
|
||||
|
||||
// hangfire 定时任务框架 有界面,更友好~
|
||||
builder.Services.AddhangfireSetup(_configuration);
|
||||
@@ -164,6 +190,8 @@ builder.Services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
||||
|
||||
builder.Services.AddSingleton<ISearcher>(new Searcher(CachePolicy.Content, Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "ip2region.xdb")));
|
||||
|
||||
//builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
|
||||
//builder.Services.AddProblemDetails();
|
||||
|
||||
#region 历史废弃配置
|
||||
//builder.Services.AddMemoryCache();
|
||||
@@ -190,6 +218,56 @@ var env = app.Environment;
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
#region 异常处理 全局业务异常已统一处理了,非业务错误会来到这里 400 -500状态码
|
||||
|
||||
|
||||
//app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
|
||||
app.UseStatusCodePages(async context =>
|
||||
{
|
||||
var code = context.HttpContext.Response.StatusCode;
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
if (code < 500)
|
||||
{
|
||||
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk($"Client error, actual request error status code({code})")));
|
||||
}
|
||||
else
|
||||
{
|
||||
//ResultFilter 里面的异常并不会到这里
|
||||
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject((ResponseOutput.NotOk($"Server error , actual request error status code({code})"))));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//app.UseExceptionHandler(o => { });
|
||||
|
||||
//这里没生效,原因未知,官方文档也是这种写法,也用了GlobalExceptionHandler 尝试,还是不行,怀疑框架bug
|
||||
//app.UseExceptionHandler(configure =>
|
||||
//{
|
||||
// configure.Run(async context =>
|
||||
// {
|
||||
// var exceptionHandlerPathFeature = context.Features.Get<IExceptionHandlerPathFeature>();
|
||||
//var ex = exceptionHandlerPathFeature?.Error;
|
||||
//context.Response.ContentType = "application/json";
|
||||
|
||||
//if (ex != null)
|
||||
//{
|
||||
// var errorInfo = $"Exception: {ex.Message}[{ex.StackTrace}]" + (ex.InnerException != null ? $" InnerException: {ex.InnerException.Message}[{ex.InnerException.StackTrace}]" : "");
|
||||
|
||||
// await context.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk($"{ex?.Message}")));
|
||||
|
||||
// Log.Logger.Error(errorInfo);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
// });
|
||||
//});
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
//本地化
|
||||
app.UseLocalization();
|
||||
|
||||
@@ -198,12 +276,11 @@ app.UseForwardedHeaders();
|
||||
//响应压缩
|
||||
app.UseResponseCompression();
|
||||
|
||||
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||
|
||||
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
||||
|
||||
|
||||
//LogDashboard
|
||||
app.UseLogDashboard("/LogDashboard");
|
||||
@@ -211,22 +288,24 @@ app.UseLogDashboard("/LogDashboard");
|
||||
//hangfire
|
||||
app.UseHangfireConfig(env);
|
||||
|
||||
#region 暂时废弃
|
||||
|
||||
//app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
||||
////限流 中间件
|
||||
//app.UseIpRateLimiting();
|
||||
//if (env.IsDevelopment())
|
||||
//{
|
||||
// app.UseDeveloperExceptionPage();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //app.UseHsts();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
//app.UseHsts();
|
||||
}
|
||||
|
||||
// 特殊异常处理 比如 404
|
||||
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
|
||||
SwaggerSetup.Configure(app, env);
|
||||
|
||||
@@ -296,10 +375,6 @@ try
|
||||
//Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}");
|
||||
|
||||
|
||||
|
||||
|
||||
var server = DicomServerFactory.Create<CStoreSCPService>(11112, userState: app.Services);
|
||||
|
||||
app.Run();
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
},
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"IRaCIS.Test_IRC_PGSQL": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Test_IRC_PGSQL"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"IRaCIS.Event_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
using System;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace IRaCIS.WX.CoreApi.Auth
|
||||
{
|
||||
public class AuthMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
public AuthMiddleware(RequestDelegate next, IEasyCachingProvider provider)
|
||||
{
|
||||
_next = next;
|
||||
_provider = provider;
|
||||
}
|
||||
/// <summary>
|
||||
///为了前端 一段时间无操作,需要重新登陆
|
||||
/// </summary>
|
||||
/// <param name="httpContext"></param>
|
||||
/// <returns></returns>
|
||||
public async Task Invoke(HttpContext httpContext)
|
||||
{
|
||||
|
||||
var isLogin = httpContext.Request.Path.ToString().ToLower().Contains("login");
|
||||
|
||||
var result = await httpContext.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
|
||||
|
||||
if (!isLogin)
|
||||
{
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
httpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
|
||||
await httpContext.Response.WriteAsync("Unauthorized");
|
||||
}
|
||||
else
|
||||
{
|
||||
var toekn = result.Properties.Items[".Token.access_token"];
|
||||
var jwtHandler = new JwtSecurityTokenHandler();
|
||||
JwtSecurityToken jwtToken = jwtHandler.ReadJwtToken(toekn);
|
||||
object userId;
|
||||
jwtToken.Payload.TryGetValue("id", out userId);
|
||||
|
||||
var cacheValueExist = await _provider.ExistsAsync(userId.ToString()); //Get<string>(userId.ToString()).ToString();
|
||||
if (!cacheValueExist)
|
||||
{
|
||||
httpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
|
||||
await httpContext.Response.WriteAsync("Unauthorized");
|
||||
}
|
||||
else
|
||||
{
|
||||
await _provider.SetAsync(userId.ToString(), userId.ToString(), TimeSpan.FromMinutes(15));
|
||||
httpContext.User = result.Principal;
|
||||
await _next.Invoke(httpContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
else await _next.Invoke(httpContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,18 +20,20 @@ namespace IRaCIS.Core.API
|
||||
// Set all the common properties available for every request
|
||||
diagnosticContext.Set("Host", request.Host);
|
||||
|
||||
diagnosticContext.Set("Protocol", request.Protocol);
|
||||
diagnosticContext.Set("Scheme", request.Scheme);
|
||||
|
||||
#region old 未用
|
||||
//这种获取的Ip不准 配置服务才行
|
||||
//diagnosticContext.Set("RequestIP", httpContext.Connection.RemoteIpAddress.ToString());
|
||||
|
||||
//这种方式可以,但是serilog提供了 就不用了
|
||||
//diagnosticContext.Set("TestIP", httpContext.GetUserIp());
|
||||
|
||||
diagnosticContext.Set("Protocol", request.Protocol);
|
||||
diagnosticContext.Set("Scheme", request.Scheme);
|
||||
|
||||
//这种方式不行 读取的body为空字符串 必须在中间件中读取
|
||||
//diagnosticContext.Set("RequestBody", await ReadRequestBody(httpContext.Request));
|
||||
//diagnosticContext.Set("RequestBody", RequestPayload);
|
||||
#endregion
|
||||
|
||||
// Only set it if available. You're not sending sensitive data in a querystring right?!
|
||||
if (request.QueryString.HasValue)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AutoMapper.EquivalencyExpression;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
@@ -14,11 +15,15 @@ namespace IRaCIS.Core.API
|
||||
//AutoMapper.Collection.EntityFrameworkCore
|
||||
automapper.AddCollectionMappers();
|
||||
|
||||
|
||||
// 全局忽略 DomainEvents 属性
|
||||
automapper.AddGlobalIgnore(nameof(Entity.DomainEvents));
|
||||
|
||||
#region 会使 IncludeMembers 失效 不能全局使用
|
||||
//mapping an EntityFramework Core DbContext-object.
|
||||
//automapper.UseEntityFrameworkCoreModel<IRaCISDBContext>(services);
|
||||
|
||||
|
||||
|
||||
//automapper.ForAllMaps((a, b) => b.ForAllMembers(opt => opt.Condition((src, dest, srcMember, desMenber) =>
|
||||
//{
|
||||
// //// Can test When Guid? -> Guid if source is null will change to Guid.Empty
|
||||
@@ -27,7 +32,7 @@ namespace IRaCIS.Core.API
|
||||
// // not want to map a null Guid? value to db Guid value
|
||||
//})));
|
||||
#endregion
|
||||
|
||||
|
||||
}, typeof(QCConfig).Assembly);
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Autofac;
|
||||
using Autofac.Extras.DynamicProxy;
|
||||
using IRaCIS.Core.Application;
|
||||
using IRaCIS.Core.Application.BackGroundJob;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
@@ -10,7 +9,6 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MediatR;
|
||||
using IRaCIS.Application.Services;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using AutoMapper;
|
||||
@@ -51,7 +49,7 @@ namespace IRaCIS.Core.API
|
||||
|
||||
Assembly application = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "IRaCIS.Core.Application.dll");
|
||||
containerBuilder.RegisterAssemblyTypes(application).Where(t => t.FullName.Contains("Service"))
|
||||
.PropertiesAutowired().AsImplementedInterfaces().EnableClassInterceptors();
|
||||
.PropertiesAutowired().AsImplementedInterfaces();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
using Castle.Core.Logging;
|
||||
using EntityFramework.Exceptions.SqlServer;
|
||||
using EntityFramework.Exceptions.SqlServer;
|
||||
using Hangfire.SqlServer;
|
||||
using IRaCIS.Core.Application.Triggers;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infra.EFCore.Interceptor;
|
||||
using Medallion.Threading;
|
||||
using Medallion.Threading.SqlServer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -16,25 +17,40 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
public static class EFSetup
|
||||
{
|
||||
public static void AddEFSetup( this IServiceCollection services, IConfiguration configuration)
|
||||
public static void AddEFSetup( this IServiceCollection services, IConfiguration configuration,string envName)
|
||||
{
|
||||
|
||||
services.AddHttpContextAccessor();
|
||||
services.AddScoped<IUserInfo, UserInfo>();
|
||||
services.AddScoped<ISaveChangesInterceptor, AuditEntityInterceptor>();
|
||||
services.AddScoped<ISaveChangesInterceptor, DispatchDomainEventsInterceptor>();
|
||||
|
||||
|
||||
// First, register a pooling context factory as a Singleton service, as usual:
|
||||
|
||||
//这个注入没有成功--注入是没问题的,构造函数也只是支持参数就好,错在注入的地方不能写DbContext
|
||||
//Web程序中通过重用池中DbContext实例可提高高并发场景下的吞吐量, 这在概念上类似于ADO.NET Provider原生的连接池操作方式,具有节省DbContext实例化成本的优点
|
||||
services.AddDbContext<IRaCISDBContext>(options =>
|
||||
services.AddDbContext<IRaCISDBContext>((sp, options) =>
|
||||
{
|
||||
|
||||
// 在控制台
|
||||
//public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => { builder.AddConsole(); });
|
||||
var logFactory = LoggerFactory.Create(builder => { builder.AddDebug(); });
|
||||
|
||||
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value,
|
||||
contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure());
|
||||
var dbType = configuration.GetSection("ConnectionStrings:Db_Type").Value ;
|
||||
if (!string.IsNullOrWhiteSpace(dbType) && dbType == "pgsql")
|
||||
{
|
||||
options.UseNpgsql(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
options.UseLoggerFactory(logFactory);
|
||||
|
||||
@@ -43,6 +59,7 @@ namespace IRaCIS.Core.API
|
||||
options.EnableSensitiveDataLogging();
|
||||
|
||||
options.AddInterceptors(new QueryWithNoLockDbCommandInterceptor());
|
||||
options.AddInterceptors(sp.GetServices<ISaveChangesInterceptor>());
|
||||
|
||||
options.UseProjectables();
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using EasyCaching.Core.Configurations;
|
||||
using EasyCaching.Interceptor.Castle;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
@@ -10,18 +7,18 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
public static void AddEasyCachingSetup(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddEasyCaching(options =>
|
||||
{
|
||||
options.UseInMemory();
|
||||
//services.AddEasyCaching(options =>
|
||||
//{
|
||||
// options.UseInMemory();
|
||||
|
||||
//options.UseRedis(configuration, EasyCachingConstValue.DefaultRedisName).WithMessagePack(EasyCachingConstValue.DefaultRedisName);
|
||||
// //options.UseRedis(configuration, EasyCachingConstValue.DefaultRedisName).WithMessagePack(EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
|
||||
});
|
||||
//});
|
||||
|
||||
//services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultRedisName);
|
||||
////services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
|
||||
//services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,39 @@ namespace IRaCIS.Core.API
|
||||
/// <summary>
|
||||
/// 序列化,反序列化的时候,处理时间 时区转换
|
||||
/// </summary>
|
||||
public class JSONTimeZoneConverter : DateTimeConverterBase
|
||||
public class JSONTimeZoneConverter(IHttpContextAccessor _httpContextAccessor) : DateTimeConverterBase
|
||||
{
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
private readonly TimeZoneInfo _clientTimeZone;
|
||||
public JSONTimeZoneConverter(IHttpContextAccessor httpContextAccessor)
|
||||
private TimeZoneInfo _clientTimeZone;
|
||||
|
||||
private string _dateFormat;
|
||||
|
||||
|
||||
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
#region 设置语言格式化方式,放在构造函数里面做不到动态切换
|
||||
|
||||
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
if (!isEn_US)
|
||||
{
|
||||
// Chinese date format
|
||||
_dateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default or English date format
|
||||
_dateFormat = "MM/dd/yyyy HH:mm:ss";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取当前请求的客户端时区
|
||||
|
||||
//默认是UTC
|
||||
//var timeZoneId = "Etc/UTC";
|
||||
var timeZoneId = "Asia/Shanghai";
|
||||
|
||||
var timeZoneIdHeader = _httpContextAccessor?.HttpContext?.Request?.Headers["TimeZoneId"];
|
||||
|
||||
if (timeZoneIdHeader is not null && !string.IsNullOrEmpty(timeZoneIdHeader.Value))
|
||||
@@ -33,12 +53,12 @@ namespace IRaCIS.Core.API
|
||||
|
||||
_clientTimeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
// 仅支持 DateTime 类型的转换
|
||||
return objectType == typeof(DateTime)|| objectType == typeof(DateTime?);
|
||||
|
||||
}
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
@@ -91,7 +111,10 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
//第一个参数默认使用系统本地时区 也就是应用服务器的时区
|
||||
DateTime clientZoneTime = TimeZoneInfo.ConvertTime(nullableDateTime.Value, _clientTimeZone);
|
||||
writer.WriteValue(clientZoneTime);
|
||||
|
||||
//writer.WriteValue(clientZoneTime);
|
||||
|
||||
writer.WriteValue(clientZoneTime.ToString(_dateFormat));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
|
||||
|
||||
//public class CustomContractResolver : DefaultContractResolver
|
||||
//{
|
||||
// protected override JsonContract CreateContract(Type objectType)
|
||||
// {
|
||||
// var contract = base.CreateContract(objectType);
|
||||
|
||||
// // 检查类是否有 LowercaseJsonAttribute 标记
|
||||
// if (objectType.GetCustomAttribute<LowerCamelCaseJsonAttribute>() != null)
|
||||
// {
|
||||
// contract.NamingStrategy = new IRCCamelCaseNamingStrategy();
|
||||
// }
|
||||
|
||||
// return contract;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
#region 废弃
|
||||
|
||||
public class MyDateTimeConverter : JsonConverter<DateTime>
|
||||
{
|
||||
public override DateTime ReadJson(JsonReader reader, Type objectType, DateTime existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return reader.ReadAsDateTime().Value;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer serializer)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
string dateFormat;
|
||||
if (!isEn_US)
|
||||
{
|
||||
// Chinese date format
|
||||
dateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default or English date format
|
||||
dateFormat = "MM/dd/yyyy HH:mm:ss";
|
||||
}
|
||||
|
||||
writer.WriteValue(value.ToString(dateFormat));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class MyNullableDateTimeConverter : JsonConverter<DateTime?>
|
||||
{
|
||||
public override DateTime? ReadJson(JsonReader reader, Type objectType, DateTime? existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
var val = reader.ReadAsDateTime();
|
||||
return val;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, DateTime? value, JsonSerializer serializer)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
string dateFormat;
|
||||
if (!isEn_US)
|
||||
{
|
||||
// Chinese date format
|
||||
dateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default or English date format
|
||||
dateFormat = "MM/dd/yyyy HH:mm:ss";
|
||||
}
|
||||
|
||||
if (value.HasValue)
|
||||
{
|
||||
writer.WriteValue(value.Value.ToString(dateFormat));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteValue(default(DateTime?));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
@@ -12,34 +18,43 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
public static void AddNewtonsoftJsonSetup(this IMvcBuilder builder, IServiceCollection services)
|
||||
{
|
||||
|
||||
services.AddHttpContextAccessor();
|
||||
services.AddScoped<JSONTimeZoneConverter>();
|
||||
services.AddScoped<CustomStringConverter>();
|
||||
services.AddScoped<IOSSService,OSSService>();
|
||||
services.AddScoped<ObjectStorePathConvert>();
|
||||
services.AddScoped<IOSSService, OSSService>();
|
||||
|
||||
|
||||
|
||||
builder.AddNewtonsoftJson(options =>
|
||||
{
|
||||
//options.SerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
|
||||
|
||||
//大驼峰
|
||||
//options.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
||||
//小驼峰
|
||||
//options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
||||
|
||||
|
||||
|
||||
// 忽略循环引用
|
||||
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
||||
//options.SerializerSettings.TypeNameHandling = TypeNameHandling.All;
|
||||
|
||||
//处理返回给前端 可空类型 给出默认值 比如in? 为null 设置 默认值0
|
||||
options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver(); //new DefaultContractResolver();// new NullToEmptyStringResolver();
|
||||
// 设置时间格式
|
||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||
options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver();
|
||||
|
||||
// 设置时间格式 isEn_US? "MM/dd/yyyy HH:mm:ss" :
|
||||
//options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
|
||||
|
||||
//options.SerializerSettings.Converters.Add(new JSONCustomDateConverter()) ;
|
||||
|
||||
//二者只能取其一
|
||||
//options.SerializerSettings.Converters.Add(new MyDateTimeConverter());
|
||||
//options.SerializerSettings.Converters.Add(new MyNullableDateTimeConverter());
|
||||
|
||||
//必须放在后面
|
||||
options.SerializerSettings.Converters.Add(services.BuildServiceProvider().GetService<JSONTimeZoneConverter>());
|
||||
|
||||
//options.SerializerSettings.Converters.Add(services.BuildServiceProvider().GetService<CustomStringConverter>());
|
||||
|
||||
|
||||
//IsoDateTimeConverter
|
||||
//options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||
|
||||
})
|
||||
.AddControllersAsServices()//动态webApi属性注入需要
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
@@ -30,8 +32,20 @@ namespace IRaCIS.Core.API
|
||||
|
||||
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
||||
{
|
||||
// 检查类是否有 LowerCamelCaseJsonAttribute 标记 有的话,属性名小写
|
||||
if (type.GetCustomAttribute<LowerCamelCaseJsonAttribute>() != null)
|
||||
{
|
||||
base.NamingStrategy= new LowerCamelCaseNamingStrategy();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.NamingStrategy = null;
|
||||
}
|
||||
|
||||
|
||||
IList<JsonProperty> properties = base.CreateProperties(type, memberSerialization);
|
||||
|
||||
|
||||
var list= type.GetProperties()
|
||||
.Select(p =>
|
||||
{
|
||||
|
||||
@@ -9,15 +9,13 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson
|
||||
{
|
||||
public class CustomStringConverter : JsonConverter<string>
|
||||
public class ObjectStorePathConvert : JsonConverter<string>
|
||||
{
|
||||
//private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IOSSService _oSSService;
|
||||
|
||||
// 构造函数
|
||||
public CustomStringConverter(/*IHttpContextAccessor httpContextAccessor*/ IOSSService oSSService)
|
||||
public ObjectStorePathConvert( IOSSService oSSService)
|
||||
{
|
||||
//_httpContextAccessor = httpContextAccessor;
|
||||
_oSSService = oSSService;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ namespace IRaCIS.Core.API
|
||||
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("LocalIP", httpContext.Connection.LocalIpAddress.MapToIPv4().ToString()));
|
||||
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserRealName", httpContext?.User?.FindFirst(ClaimAttributes.RealName)?.Value));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value));
|
||||
|
||||
|
||||
//这样读取没用
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestBody", await ReadRequestBody(httpContext.Request)));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestIP", IPHelper.GetIP(httpContext.Request) ));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserRealName", httpContext?.User?.FindFirst(ClaimAttributes.RealName)?.Value));
|
||||
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value));
|
||||
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("Referer", httpContext.Request.Headers["Referer"].ToString()));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_path", httpContext.Request.Path));
|
||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_method", httpContext.Request.Method));
|
||||
|
||||
@@ -16,32 +16,36 @@
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-test-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
"RegionId": "cn-shanghai",
|
||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"AccessKeyId": "LTAI5tJV76pYX5yPg1N9QVE8",
|
||||
"AccessKeySecret": "roRNLa9YG1of4pYruJGCNKBXEWTAWa",
|
||||
"BucketName": "zy-irc-test-store",
|
||||
"RoleArn": "acs:ram::1899121822495495:role/webdirect",
|
||||
"ViewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"Region": "oss-cn-shanghai",
|
||||
"DurationSeconds": 7200
|
||||
},
|
||||
"MinIO": {
|
||||
"endPoint": "hir-oss.test.extimaging.com",
|
||||
"port": "443",
|
||||
"useSSL": true,
|
||||
"accessKey": "fbStsVYCIPKHQneeqMwD",
|
||||
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||
"bucketName": "irc-test",
|
||||
"viewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||
"EndPoint": "hir-oss.test.extimaging.com",
|
||||
"Port": "443",
|
||||
"UseSSL": true,
|
||||
"AccessKey": "fbStsVYCIPKHQneeqMwD",
|
||||
"SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||
"BucketName": "irc-test",
|
||||
"ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||
},
|
||||
"AWS": {
|
||||
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||
"useSSL": true,
|
||||
"accessKey": "AKIAZQ3DRSOHFPJJ6FEU",
|
||||
"secretKey": "l+yjtvV7Z4jiwm/7xCYv30UeUj/SvuqqYzAwjJHf",
|
||||
"bucketName": "ei-irc-test-store",
|
||||
"viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
|
||||
"Region": "us-east-1",
|
||||
"EndPoint": "s3.us-east-1.amazonaws.com",
|
||||
"UseSSL": true,
|
||||
"RoleArn": "arn:aws:iam::471112624751:role/sts_s3_upload",
|
||||
"AccessKeyId": "AKIAW3MEAFJXWRCGSX5Z",
|
||||
"SecretAccessKey": "miais4jQGSd37A+TfBEP11AQM5u/CvotSmznJd8k",
|
||||
"BucketName": "ei-med-s3-lili-uat-store",
|
||||
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com/",
|
||||
"DurationSeconds": 7200
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Db_Type": "pgsql",
|
||||
"RemoteNew": "Host=106.14.89.110;Port=5432;Username=sa;Password=pgsql_pwd;Database=Test2_PG",
|
||||
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
},
|
||||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-test-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
"MinIO": {
|
||||
"endPoint": "hir-oss.test.extimaging.com",
|
||||
"port": "443",
|
||||
"useSSL": true,
|
||||
"accessKey": "fbStsVYCIPKHQneeqMwD",
|
||||
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||
"bucketName": "irc-test",
|
||||
"viewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||
},
|
||||
"AWS": {
|
||||
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||
"useSSL": true,
|
||||
"accessKey": "AKIAZQ3DRSOHFPJJ6FEU",
|
||||
"secretKey": "l+yjtvV7Z4jiwm/7xCYv30UeUj/SvuqqYzAwjJHf",
|
||||
"bucketName": "ei-irc-test-store",
|
||||
"viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
|
||||
}
|
||||
},
|
||||
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false,
|
||||
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 1,
|
||||
|
||||
"AutoLoginOutMinutes": 1,
|
||||
|
||||
"OpenLoginMFA": false,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10,
|
||||
"IsNeedChangePassWord": true,
|
||||
|
||||
"ChangePassWordDays": 90
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "test@extimaging.com",
|
||||
"FromName": "Test_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"SiteUrl": "http://irc.test.extimaging.com/login",
|
||||
|
||||
"OrganizationName": "Extlmaging",
|
||||
"OrganizationNameCN": "Extlmaging",
|
||||
"CompanyName": "Extensive Imaging",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Extensive Imaging",
|
||||
"CompanyShortNameCN": "展影医疗"
|
||||
},
|
||||
|
||||
"SystemPacsConfig": {
|
||||
"Port": "11113",
|
||||
"IP": "106.14.89.110"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using Hangfire;
|
||||
using Hangfire;
|
||||
using Hangfire.Storage;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
@@ -9,6 +8,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using SharpCompress.Common;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Application.Services.BackGroundJob
|
||||
{
|
||||
@@ -16,82 +16,47 @@ namespace IRaCIS.Application.Services.BackGroundJob
|
||||
public interface IIRaCISHangfireJob
|
||||
{
|
||||
|
||||
Task MemoryCacheTrialStatusAsync();
|
||||
//Task MemoryCacheTrialStatusAsync();
|
||||
|
||||
Task InitHangfireJobTaskAsync();
|
||||
|
||||
}
|
||||
public class IRaCISCHangfireJob : IIRaCISHangfireJob
|
||||
public class IRaCISCHangfireJob(ILogger<IRaCISCHangfireJob> _logger,
|
||||
IRepository<Internationalization> _internationalizationRepository,
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository
|
||||
) : IIRaCISHangfireJob
|
||||
{
|
||||
public static string JsonFileFolder = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources);
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly ILogger<IRaCISCHangfireJob> _logger;
|
||||
private readonly IRepository<SystemAnonymization> _systemAnonymizationRepository;
|
||||
private readonly IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository;
|
||||
private readonly IRepository<Internationalization> _internationalizationRepository;
|
||||
|
||||
|
||||
|
||||
public IRaCISCHangfireJob(IRepository<Trial> trialRepository, ILogger<IRaCISCHangfireJob> logger, IEasyCachingProvider provider, IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository, IRepository<Internationalization> internationalizationRepository, IRepository<SystemAnonymization> systemAnonymizationRepository)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_provider = provider;
|
||||
_logger = logger;
|
||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||
_internationalizationRepository = internationalizationRepository;
|
||||
_systemAnonymizationRepository = systemAnonymizationRepository;
|
||||
}
|
||||
|
||||
public async Task InitHangfireJobTaskAsync()
|
||||
{
|
||||
_logger.LogInformation("项目启动 hangfire 任务初始化 执行开始~");
|
||||
|
||||
|
||||
//项目状态 立即加载到缓存中
|
||||
await MemoryCacheTrialStatusAsync();
|
||||
|
||||
await MemoryCacheAnonymizeData();
|
||||
|
||||
|
||||
//创建项目缓存 定时任务
|
||||
HangfireJobHelper.AddOrUpdateInitCronJob<IIRaCISHangfireJob>("RecurringJob_Cache_TrialState", t => t.MemoryCacheTrialStatusAsync(), Cron.Daily());
|
||||
|
||||
//初始化
|
||||
//初始化国际化
|
||||
|
||||
await InternationalizationHelper.InitInternationlizationDataAndWatchJsonFileAsync(_internationalizationRepository);
|
||||
|
||||
//创建邮件定时任务
|
||||
await InitSysAndTrialCronJobAsync();
|
||||
|
||||
#region 废弃
|
||||
////项目状态 立即加载到缓存中
|
||||
//await MemoryCacheTrialStatusAsync();
|
||||
|
||||
////await MemoryCacheAnonymizeData();
|
||||
|
||||
|
||||
////创建项目缓存 定时任务
|
||||
//HangfireJobHelper.AddOrUpdateInitCronJob<IIRaCISHangfireJob>("RecurringJob_Cache_TrialState", t => t.MemoryCacheTrialStatusAsync(), Cron.Daily());
|
||||
#endregion
|
||||
|
||||
|
||||
_logger.LogInformation("项目启动 hangfire 任务初始化 执行结束");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存项目状态
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task MemoryCacheTrialStatusAsync()
|
||||
{
|
||||
|
||||
var list = await _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr })
|
||||
.ToListAsync();
|
||||
|
||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
||||
|
||||
}
|
||||
|
||||
public async Task MemoryCacheAnonymizeData()
|
||||
{
|
||||
var systemAnonymizationList = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
||||
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddFixedFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddIRCInfoFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_FixedField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_IRCInfoField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -136,6 +101,9 @@ namespace IRaCIS.Application.Services.BackGroundJob
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Panda.DynamicWebApi.Attributes;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
@@ -26,13 +27,13 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
public IWebHostEnvironment _hostEnvironment { get; set; }
|
||||
|
||||
|
||||
public IFusionCache _fusionCache { get; set; }
|
||||
|
||||
|
||||
public static IResponseOutput Null404NotFound<TEntity>(TEntity? businessObject) where TEntity : class
|
||||
@@ -51,8 +52,6 @@ namespace IRaCIS.Core.Application
|
||||
[MemberNotNull(nameof(_userInfo))]
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_repository))]
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_localizer))]
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
@@ -60,6 +59,9 @@ namespace IRaCIS.Core.Application
|
||||
[MemberNotNull(nameof(_hostEnvironment))]
|
||||
public IWebHostEnvironment _hostEnvironment { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_fusionCache))]
|
||||
public IFusionCache _fusionCache { get; set; }
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -75,14 +77,12 @@ namespace IRaCIS.Core.Application
|
||||
[MemberNotNull(nameof(_userInfo))]
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_repository))]
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_localizer))]
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
[MemberNotNull(nameof(_fusionCache))]
|
||||
public IFusionCache _fusionCache { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
[TypeFilter(typeof(UnifiedApiResultFilter))]
|
||||
@@ -93,10 +93,10 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
|
||||
public IRepository _repository { get; set; }
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
public IFusionCache _fusionCache { get; set; }
|
||||
|
||||
public static IResponseOutput Null404NotFound<TEntity>(TEntity? businessObject) where TEntity : class
|
||||
{
|
||||
return new ResponseOutput<string>()
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace IRaCIS.Core.Application.BusinessFilter
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 不生效,不知道为啥
|
||||
/// </summary>
|
||||
public class GlobalExceptionHandler : IExceptionHandler
|
||||
{
|
||||
private readonly ILogger<GlobalExceptionHandler> _logger;
|
||||
public GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger)
|
||||
{
|
||||
this._logger = logger;
|
||||
}
|
||||
public ValueTask<bool> TryHandleAsync(
|
||||
HttpContext httpContext,
|
||||
Exception exception,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
|
||||
httpContext.Response.ContentType = "application/json";
|
||||
|
||||
|
||||
var ex = exception;
|
||||
var errorInfo = $"Exception: {ex.Message}[{ex.StackTrace}]" + (ex.InnerException != null ? $" InnerException: {ex.InnerException.Message}[{ex.InnerException.StackTrace}]" : "");
|
||||
|
||||
httpContext.Response.WriteAsJsonAsync(ResponseOutput.NotOk($"{ex?.Message}"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_logger.LogError(errorInfo);
|
||||
|
||||
// return true to signal that this exception is handled
|
||||
return ValueTask.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application.Filter;
|
||||
|
||||
@@ -18,15 +19,15 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
{
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IFusionCache _fusionCache;
|
||||
|
||||
private readonly IUserInfo _userInfo;
|
||||
|
||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||
|
||||
public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
|
||||
public LimitUserRequestAuthorization(IFusionCache fusionCache, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
|
||||
{
|
||||
_provider = provider;
|
||||
_fusionCache = fusionCache;
|
||||
_userInfo = userInfo;
|
||||
_verifyConfig = verifyConfig;
|
||||
_localizer = localizer;
|
||||
@@ -63,7 +64,7 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
|
||||
|
||||
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
|
||||
var cacheUserToken = (await _provider.GetAsync<string>(_userInfo.Id.ToString())).Value;
|
||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.Id));
|
||||
|
||||
|
||||
|
||||
@@ -73,17 +74,17 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
cacheUserToken = _userInfo.UserToken;
|
||||
|
||||
//设置当前用户最新Token
|
||||
await _provider.SetAsync(_userInfo.Id.ToString(), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.Id), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
|
||||
//重启应用程序,所有人续期,不一下子踢出所有人
|
||||
await _provider.SetAsync($"{_userInfo.Id.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
|
||||
}
|
||||
//是同一个人
|
||||
else if (cacheUserToken == _userInfo.UserToken)
|
||||
{
|
||||
|
||||
var cacheTime = (await _provider.GetAsync<string>($"{_userInfo.Id.ToString()}_Online")).Value;
|
||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.Id));
|
||||
|
||||
//过期了 需要自动退出
|
||||
if (string.IsNullOrEmpty(cacheTime))
|
||||
@@ -91,33 +92,23 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountAuto_LoginOut"], ApiResponseCodeEnum.AutoLoginOut));
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountAuto_LoginOut"], ApiResponseCodeEnum.AutoLoginOut));
|
||||
}
|
||||
else
|
||||
{
|
||||
await _provider.SetAsync($"{_userInfo.Id.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
|
||||
//---您的账户在其他地方已登陆,您被迫下线。
|
||||
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace));
|
||||
|
||||
|
||||
//await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,52 +116,3 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//public class UserTypeRequirement : IAuthorizationRequirement
|
||||
//{
|
||||
//}
|
||||
|
||||
//public class UserTypeHandler : AuthorizationHandler<UserTypeRequirement>
|
||||
//{
|
||||
|
||||
// private IUserInfo _userInfo;
|
||||
|
||||
// public UserTypeHandler(IUserInfo userInfo)
|
||||
// {
|
||||
// _userInfo = userInfo;
|
||||
// }
|
||||
|
||||
|
||||
// protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, UserTypeRequirement requirement)
|
||||
// {
|
||||
|
||||
// //if (context.User.Claims.Count() == 0)
|
||||
// //{
|
||||
// // return Task.CompletedTask;
|
||||
// //}
|
||||
|
||||
// //string userId = context.User.Claims.First(c => c.Type == "Userid").Value;
|
||||
// //string qq = context.User.Claims.First(c => c.Type == "QQ").Value;
|
||||
|
||||
// //if (_UserService.Validata(userId, qq))
|
||||
// //{
|
||||
// // context.Succeed(requirement); //验证通过了
|
||||
// //}
|
||||
// ////在这里就可以做验证
|
||||
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace IRaCIS.Core.Application.Filter
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message, "", error!.Code, localizedInfo: info));
|
||||
|
||||
|
||||
//warning 级别记录
|
||||
//_logger.LogWarning($"[{error!.LocalizedKey}]:{StaticData.Log_Locoalize_Dic[error!.LocalizedKey]}");
|
||||
}
|
||||
@@ -60,12 +61,17 @@ namespace IRaCIS.Core.Application.Filter
|
||||
_logger.LogError(context.Exception.InnerException is null ? (context.Exception.Message + context.Exception.StackTrace) : (context.Exception.InnerException?.Message + context.Exception.InnerException?.StackTrace));
|
||||
|
||||
}
|
||||
|
||||
context.ExceptionHandled = true;//标记当前异常已经被处理过了
|
||||
|
||||
|
||||
//throw new Exception("test-result-exceptioin");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//继续
|
||||
}
|
||||
context.ExceptionHandled = true;//标记当前异常已经被处理过了
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Text.RegularExpressions;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||
|
||||
namespace IRaCIS.Core.Application.Filter
|
||||
@@ -14,37 +15,36 @@ namespace IRaCIS.Core.Application.Filter
|
||||
/// </summary>
|
||||
public class TrialResourceFilter : Attribute, IAsyncResourceFilter
|
||||
{
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IUserInfo _userInfo;
|
||||
|
||||
private readonly IFusionCache _fusionCache;
|
||||
public IStringLocalizer _localizer;
|
||||
private readonly List<string> _trialOptList=new List<string>();
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly List<string> _trialOptList = new List<string>();
|
||||
|
||||
|
||||
public TrialResourceFilter(IEasyCachingProvider provider, IStringLocalizer localizer , IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
|
||||
public TrialResourceFilter(IFusionCache fusionCache, IRepository<Trial> trialRepository, IStringLocalizer localizer, IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
|
||||
{
|
||||
_provider = provider;
|
||||
_fusionCache = fusionCache;
|
||||
_userInfo = userInfo;
|
||||
_localizer = localizer;
|
||||
//_trialOpt = trialOpt;
|
||||
_trialRepository = trialRepository;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt2)) _trialOptList.Add(trialOpt2.Trim());
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt3)) _trialOptList.Add(trialOpt3.Trim());
|
||||
|
||||
|
||||
}
|
||||
|
||||
//优先选择异步的方法
|
||||
public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
|
||||
{
|
||||
// var typeFilter = context.ActionDescriptor.EndpointMetadata.Where(t => t.GetType() == typeof(TypeFilterAttribute)).Select(t => (TypeFilterAttribute)t).ToList().FirstOrDefault();
|
||||
//var _trialOptList= typeFilter.Arguments.Select(t => t.ToString()).ToList();
|
||||
// var typeFilter = context.ActionDescriptor.EndpointMetadata.Where(t => t.GetType() == typeof(TypeFilterAttribute)).Select(t => (TypeFilterAttribute)t).ToList().FirstOrDefault();
|
||||
//var _trialOptList= typeFilter.Arguments.Select(t => t.ToString()).ToList();
|
||||
|
||||
#region 处理新的用户类型,不能操作项目相关接口
|
||||
|
||||
// 后期列举出具体的类型,其他任何用户类型,都不允许操作
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA && _userInfo.RequestUrl.ToLower()!= "TrialDocument/userConfirm".ToLower())
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA && _userInfo.RequestUrl.ToLower() != "TrialDocument/userConfirm".ToLower())
|
||||
{
|
||||
//---对不起,您的账户没有操作权限。
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_NoAccessPermission"]));
|
||||
@@ -85,7 +85,7 @@ namespace IRaCIS.Core.Application.Filter
|
||||
}
|
||||
else
|
||||
{
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
}
|
||||
|
||||
@@ -116,20 +116,20 @@ namespace IRaCIS.Core.Application.Filter
|
||||
if (matchResult.Success)
|
||||
{
|
||||
//有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下
|
||||
var cacheResultDic = _provider.GetAll<string>(new[] { matchResult.Value });
|
||||
|
||||
var trialStatusStr = cacheResultDic[matchResult.Value.ToLower()].Value;
|
||||
trialIdStr = matchResult.Value;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(trialStatusStr))
|
||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(trialStatusStr))
|
||||
{
|
||||
trialIdStr = matchResult.Value;
|
||||
//数据库 检查该项目Id不对
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
}
|
||||
|
||||
@@ -141,34 +141,12 @@ namespace IRaCIS.Core.Application.Filter
|
||||
}
|
||||
|
||||
//通过path 或者body 找到trialId 了
|
||||
if ( !string.IsNullOrWhiteSpace(trialIdStr))
|
||||
if (!string.IsNullOrWhiteSpace(trialIdStr))
|
||||
{
|
||||
|
||||
//如果没缓存数据,可能定时任务没执行或者缓存丢失 在此重新缓存
|
||||
if (_provider.GetCount() == 0)
|
||||
{
|
||||
|
||||
var _trialRepository = context.HttpContext.RequestServices.GetService(typeof(IRepository<Trial>)) as IRepository<Trial>;
|
||||
|
||||
var list = _trialRepository.IfNullThrowException().Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr })
|
||||
.ToList();
|
||||
|
||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
||||
}
|
||||
|
||||
var cacheResultDic = _provider.GetAll<string>(new[] { trialIdStr });
|
||||
|
||||
var trialStatusStr = cacheResultDic[trialIdStr].Value;
|
||||
|
||||
//意外 导致缓存过期,调整服务器时间,测试不想重启程序
|
||||
if (string.IsNullOrWhiteSpace(trialStatusStr))
|
||||
{
|
||||
var trialRepository = context.HttpContext.RequestServices.GetService(typeof(IRepository<Trial>)) as IRepository<Trial>;
|
||||
trialStatusStr = trialRepository?.Where(t => t.Id == Guid.Parse(trialIdStr)).Select(t => t.TrialStatusStr).FirstOrDefault();
|
||||
}
|
||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
// 这里是统一拦截 项目有关的操作允许情况(特殊的地方,比如项目配置(有的在多种状态(初始化,ongoing)都可以操作,有的仅仅在Initializing)还有 项目添加和更新,不走这里,特殊处理,不然在这里显得很乱,判断是哪个接口)
|
||||
if (trialStatusStr == StaticData.TrialState.TrialOngoing || _trialOptList.Any(t=>t== TrialOpt.BeforeOngoingCantOpt) )
|
||||
if (trialStatusStr == StaticData.TrialState.TrialOngoing || _trialOptList.Any(t => t == TrialOpt.BeforeOngoingCantOpt))
|
||||
{
|
||||
|
||||
await next.Invoke();
|
||||
@@ -177,14 +155,14 @@ namespace IRaCIS.Core.Application.Filter
|
||||
// 项目停止、或者完成 不允许操作
|
||||
else
|
||||
{
|
||||
//---本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改
|
||||
//---本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_InterceptedProjectStatusRule"]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//添加项目 签名系统文档的时候 不做拦截 但是更新项目 签名项目文档的时候需要拦截
|
||||
else if (_trialOptList.Any(t => t == TrialOpt.AddOrUpdateTrial ||t ==TrialOpt.SignSystemDocNoTrialId))
|
||||
else if (_trialOptList.Any(t => t == TrialOpt.AddOrUpdateTrial || t == TrialOpt.SignSystemDocNoTrialId))
|
||||
{
|
||||
await next.Invoke();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
|
||||
public static class CacheKeys
|
||||
{
|
||||
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
|
||||
|
||||
public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}";
|
||||
|
||||
public static string TrialStudyUidUploading(Guid trialId, string studyUid) => $"TrialStudyUid:{trialId}_{studyUid}";
|
||||
|
||||
public static string TrialStudyUidDBLock(Guid trialId, string studyUid) => $"TrialStudyUidDBLock:{trialId}_{studyUid}";
|
||||
|
||||
|
||||
|
||||
public static string SystemAnonymization => $"SystemAnonymization";
|
||||
|
||||
public static string FrontInternational => $"FrontInternationalList";
|
||||
|
||||
//登录挤账号
|
||||
public static string UserToken(Guid userId) => $"UserToken:{userId}";
|
||||
|
||||
//超时没请求接口自动退出
|
||||
public static string UserAutoLoginOut(Guid userId) => $"UserAutoLoginOut:{userId}";
|
||||
|
||||
// 你可以为其他实体和模块定义更多的键
|
||||
|
||||
/// <summary>
|
||||
/// 跳过阅片
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string SkipReadingCacheKey(Guid userId) => $"{userId}SkipReadingCache";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 开始阅片时间
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string StartReadingTimeKey(Guid userId) => $"{userId}StartReadingTime";
|
||||
|
||||
/// <summary>
|
||||
/// 开始休息时间
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string StartRestTime(Guid userId) => $"{userId}StartRestTime";
|
||||
|
||||
}
|
||||
|
||||
public static class CacheHelper
|
||||
{
|
||||
public static async Task<string?> GetTrialStatusAsync(Guid trialId, IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var statusStr = await _trialRepository.Where(t => t.Id == trialId, ignoreQueryFilters: true).Select(t => t.TrialStatusStr).FirstOrDefaultAsync();
|
||||
|
||||
return statusStr;
|
||||
}
|
||||
|
||||
public static async Task<List<SystemAnonymization>> GetSystemAnonymizationListAsync(IRepository<SystemAnonymization> _systemAnonymizationRepository)
|
||||
{
|
||||
var list = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@@ -14,6 +15,8 @@ using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
@@ -23,19 +26,13 @@ public static class ExcelExportHelper
|
||||
//MiniExcel_Export
|
||||
public static async Task<IActionResult> DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
//判断是否有字典翻译
|
||||
|
||||
object translateData = data;
|
||||
|
||||
if (_dictionaryService != null && translateType != null)
|
||||
{
|
||||
|
||||
////只标注单个的时候
|
||||
//var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||
// .Select(c => new { c.Name, DicParentCode = ((DictionaryTranslateAttribute?)c.GetCustomAttributes(typeof(DictionaryTranslateAttribute), false)[0])?.DicParentCode }).ToList();
|
||||
|
||||
|
||||
//一个值 对应不同的字典翻译
|
||||
var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||
.SelectMany(c =>
|
||||
@@ -62,12 +59,18 @@ public static class ExcelExportHelper
|
||||
var newObjList = new List<object>();
|
||||
var no = 1;
|
||||
|
||||
foreach (var item in dic[key] as IList )
|
||||
foreach (var item in dic[key] as IList)
|
||||
{
|
||||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
@@ -79,7 +82,7 @@ public static class ExcelExportHelper
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t=>data.IsEn_US?t.Value:t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
}
|
||||
//普通翻译 或者某一标准翻译
|
||||
@@ -88,7 +91,7 @@ public static class ExcelExportHelper
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => data.IsEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +107,7 @@ public static class ExcelExportHelper
|
||||
dic[key] = newObjList;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +143,7 @@ public static class ExcelExportHelper
|
||||
|
||||
if (sheetCount == 2)
|
||||
{
|
||||
if (data.IsEn_US)
|
||||
if (isEn_US)
|
||||
{
|
||||
workbook.RemoveSheetAt(0);
|
||||
}
|
||||
@@ -149,7 +153,7 @@ public static class ExcelExportHelper
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
workbook.Write(memoryStream2,true);
|
||||
workbook.Write(memoryStream2, true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
@@ -160,14 +164,9 @@ public static class ExcelExportHelper
|
||||
//fileNmae = workbook.GetSheetName(0);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region MiniExcel
|
||||
|
||||
var memoryStream = new MemoryStream();
|
||||
var memoryStream = new MemoryStream();
|
||||
|
||||
var config = new OpenXmlConfiguration()
|
||||
{
|
||||
@@ -181,29 +180,18 @@ public static class ExcelExportHelper
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{(string.IsNullOrEmpty(exportFileNamePrefix) ? "" : exportFileNamePrefix+ "_") }{Path.GetFileNameWithoutExtension(fileName) }_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
FileDownloadName = $"{(string.IsNullOrEmpty(exportFileNamePrefix) ? "" : exportFileNamePrefix + "_")}{Path.GetFileNameWithoutExtension(fileName)}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
#region Magicodes 模板规则不一样
|
||||
|
||||
////创建Excel导出对象
|
||||
//IExportFileByTemplate exporter = new ExcelExporter();
|
||||
|
||||
////根据模板导出
|
||||
//var result = await exporter.ExportBytesByTemplate(exportInfo, tplPath);
|
||||
|
||||
|
||||
//return new XlsxFileResult(bytes: result, fileDownloadName: $"{doc.Name}_{DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")}.xlsx");
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static async Task<(MemoryStream, string)> DataExport_NpoiTestAsync(string code, ExcelExportInfo data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
//判断是否有字典翻译
|
||||
|
||||
object translateData = data;
|
||||
@@ -211,11 +199,6 @@ public static class ExcelExportHelper
|
||||
if (_dictionaryService != null && translateType != null)
|
||||
{
|
||||
|
||||
////只标注单个的时候
|
||||
//var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||
// .Select(c => new { c.Name, DicParentCode = ((DictionaryTranslateAttribute?)c.GetCustomAttributes(typeof(DictionaryTranslateAttribute), false)[0])?.DicParentCode }).ToList();
|
||||
|
||||
|
||||
//一个值 对应不同的字典翻译
|
||||
var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||
.SelectMany(c =>
|
||||
@@ -247,6 +230,15 @@ public static class ExcelExportHelper
|
||||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
{
|
||||
//翻译的属性依赖其他属性
|
||||
@@ -256,7 +248,7 @@ public static class ExcelExportHelper
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => data.IsEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
}
|
||||
//普通翻译 或者某一标准翻译
|
||||
@@ -265,7 +257,7 @@ public static class ExcelExportHelper
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => data.IsEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +302,7 @@ public static class ExcelExportHelper
|
||||
|
||||
if (sheetCount == 2)
|
||||
{
|
||||
if (data.IsEn_US)
|
||||
if (isEn_US)
|
||||
{
|
||||
workbook.RemoveSheetAt(0);
|
||||
}
|
||||
@@ -320,7 +312,7 @@ public static class ExcelExportHelper
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
workbook.Write(memoryStream2,true);
|
||||
workbook.Write(memoryStream2, true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
@@ -355,4 +347,7 @@ public static class ExcelExportHelper
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public static class FileStoreHelper
|
||||
{
|
||||
var doc = await _commonDocumentRepository.FirstOrDefaultAsync(t => t.Code == code);
|
||||
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name!= "zh-CN";
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name!= StaticData.CultureInfo.zh_CN;
|
||||
if (doc == null)
|
||||
{
|
||||
//---数据库没有找到对应的数据模板文件,请联系系统运维人员。
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
|
||||
#region 对接模型
|
||||
public class HolidayCalendar
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string Generated { get; set; }
|
||||
public string Timezone { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string URL { get; set; }
|
||||
public Dictionary<string, List<HolidayYear>> Years { get; set; }
|
||||
}
|
||||
|
||||
public class HolidayYear
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public int Duration { get; set; }
|
||||
public List<DateTime> CompDays { get; set; }
|
||||
public string URL { get; set; }
|
||||
public string Memo { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
public class HolidayHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// github 链接:https://github.com/lanceliao/china-holiday-calender?tab=readme-ov-file
|
||||
/// 接口请求参考文档:https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage
|
||||
/// </summary>
|
||||
private static RestClient _client => new RestClient("https://www.shuyz.com/githubfiles/china-holiday-calender/master/holidayAPI.json");
|
||||
|
||||
private static HolidayCalendar _holidayCalendar { get; set; }
|
||||
|
||||
|
||||
private static List<DateTime> _holidays = new List<DateTime>();
|
||||
private static List<DateTime> _compensatedWorkdays = new List<DateTime>();
|
||||
|
||||
static HolidayHelper()
|
||||
{
|
||||
_holidayCalendar = _client.Get<HolidayCalendar>(new RestRequest()) ?? new HolidayCalendar();
|
||||
|
||||
foreach (var year in _holidayCalendar.Years.Values.SelectMany(x => x))
|
||||
{
|
||||
// 添加节假日到假日集合
|
||||
for (DateTime date = year.StartDate; date <= year.EndDate; date = date.AddDays(1))
|
||||
{
|
||||
_holidays.Add(date);
|
||||
}
|
||||
|
||||
// 添加补班日到补班日集合
|
||||
foreach (var compDay in year.CompDays)
|
||||
{
|
||||
_compensatedWorkdays.Add(compDay);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static TimeSpan GetChinaWorkTimeSpan(DateTime startDate, DateTime endDate)
|
||||
{
|
||||
if (startDate > endDate)
|
||||
{
|
||||
throw new ArgumentException("结束日期必须大于或等于开始日期");
|
||||
}
|
||||
|
||||
var diffTimeSpan = endDate - startDate;
|
||||
|
||||
// 初始化工作日数为0
|
||||
int workdays = 0;
|
||||
|
||||
// 找出在给定日期范围内的假期和补班日
|
||||
var filteredHolidays = _holidays.Where(d => d >= startDate && d <= endDate).ToList();
|
||||
var filteredCompensatedWorkdays = _compensatedWorkdays.Where(d => d >= startDate && d <= endDate).ToList();
|
||||
|
||||
// 遍历日期范围,计算工作日 注意 这里是小于
|
||||
for (DateTime date = startDate.Date; date < endDate.Date; date = date.AddDays(1))
|
||||
{
|
||||
// 判断是否为工作日
|
||||
bool isWeekend = date.DayOfWeek == DayOfWeek.Saturday || date.DayOfWeek == DayOfWeek.Sunday;
|
||||
bool isHoliday = filteredHolidays.Contains(date);
|
||||
bool isCompensatedWorkday = filteredCompensatedWorkdays.Contains(date);
|
||||
|
||||
// 如果是补班日,或是平日(非假期,非周末),则算作工作日
|
||||
if (isCompensatedWorkday || (!isWeekend && !isHoliday))
|
||||
{
|
||||
workdays++;
|
||||
}
|
||||
}
|
||||
|
||||
return new TimeSpan(workdays, diffTimeSpan.Hours, diffTimeSpan.Minutes, diffTimeSpan.Seconds);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,48 +14,72 @@ using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.Json.Serialization;
|
||||
using Minio.ApiEndpoints;
|
||||
using System.Reactive.Linq;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using static MassTransit.ValidationResultExtensions;
|
||||
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
||||
using Amazon.Runtime;
|
||||
using Amazon.S3;
|
||||
using Amazon.S3.Model;
|
||||
using MassTransit.Caching.Internals;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
#region 绑定和返回模型
|
||||
|
||||
[LowerCamelCaseJson]
|
||||
public class MinIOOptions : AWSOptions
|
||||
{
|
||||
public int port { get; set; }
|
||||
public int Port { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class AWSOptions
|
||||
{
|
||||
public string endPoint { get; set; }
|
||||
public bool useSSL { get; set; }
|
||||
public string accessKey { get; set; }
|
||||
public string secretKey { get; set; }
|
||||
public string bucketName { get; set; }
|
||||
public string viewEndpoint { get; set; }
|
||||
public string EndPoint { get; set; }
|
||||
public bool UseSSL { get; set; }
|
||||
public string AccessKeyId { get; set; }
|
||||
public string RoleArn { get; set; }
|
||||
public string SecretAccessKey { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
public string ViewEndpoint { get; set; }
|
||||
public int DurationSeconds { get; set; }
|
||||
public string Region { get; set; }
|
||||
}
|
||||
|
||||
public class AliyunOSSOptions
|
||||
{
|
||||
public string regionId { get; set; }
|
||||
public string accessKeyId { get; set; }
|
||||
public string accessKeySecret { get; set; }
|
||||
public string RegionId { get; set; }
|
||||
public string AccessKeyId { get; set; }
|
||||
public string AccessKeySecret { get; set; }
|
||||
|
||||
public string internalEndpoint { get; set; }
|
||||
public string InternalEndpoint { get; set; }
|
||||
|
||||
public string endPoint { get; set; }
|
||||
public string bucketName { get; set; }
|
||||
public string EndPoint { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
|
||||
public string roleArn { get; set; }
|
||||
public string RoleArn { get; set; }
|
||||
|
||||
public string Region { get; set; }
|
||||
|
||||
public string ViewEndpoint { get; set; }
|
||||
|
||||
public int DurationSeconds { get; set; }
|
||||
|
||||
public string region { get; set; }
|
||||
|
||||
public string viewEndpoint { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ObjectStoreServiceOptions
|
||||
{
|
||||
public string ObjectStoreUse { get; set; }
|
||||
|
||||
public AliyunOSSOptions AliyunOSS { get; set; }
|
||||
|
||||
|
||||
public MinIOOptions MinIO { get; set; }
|
||||
|
||||
public AWSOptions AWS { get; set; }
|
||||
@@ -66,27 +90,50 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public string ObjectStoreUse { get; set; }
|
||||
|
||||
public AliyunOSSOptions AliyunOSS { get; set; }
|
||||
|
||||
public AliyunOSSTempToken AliyunOSS { get; set; }
|
||||
|
||||
public MinIOOptions MinIO { get; set; }
|
||||
|
||||
public AWSOptions AWS { get; set; }
|
||||
public AWSTempToken AWS { get; set; }
|
||||
|
||||
}
|
||||
|
||||
[LowerCamelCaseJson]
|
||||
public class AliyunOSSTempToken
|
||||
{
|
||||
public string AccessKeyId { get; set; }
|
||||
public string AccessKeySecret { get; set; }
|
||||
|
||||
|
||||
public string EndPoint { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
|
||||
|
||||
public string Region { get; set; }
|
||||
|
||||
public string ViewEndpoint { get; set; }
|
||||
|
||||
|
||||
|
||||
public string SecurityToken { get; set; }
|
||||
public string Expiration { get; set; }
|
||||
|
||||
public string Region { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
public string ViewEndpoint { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
[LowerCamelCaseJson]
|
||||
public class AWSTempToken
|
||||
{
|
||||
public string Region { get; set; }
|
||||
public string SessionToken { get; set; }
|
||||
public string EndPoint { get; set; }
|
||||
public string AccessKeyId { get; set; }
|
||||
public string SecretAccessKey { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
public string ViewEndpoint { get; set; }
|
||||
public DateTime Expiration { get; set; }
|
||||
}
|
||||
|
||||
public enum ObjectStoreUse
|
||||
{
|
||||
@@ -95,6 +142,10 @@ namespace IRaCIS.Core.Application.Helper
|
||||
AWS = 2,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// aws 参考链接 https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3/S3/S3_Basics
|
||||
|
||||
public interface IOSSService
|
||||
{
|
||||
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true);
|
||||
@@ -106,6 +157,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
public Task<string> GetSignedUrl(string ossRelativePath);
|
||||
|
||||
public Task DeleteFromPrefix(string prefix);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +182,6 @@ namespace IRaCIS.Core.Application.Helper
|
||||
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true)
|
||||
{
|
||||
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}" : $"{oosFolderPath}/{fileRealName}";
|
||||
//var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
|
||||
//var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -148,12 +198,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.endPoint : aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, aliConfig.AccessKeyId, aliConfig.AccessKeySecret);
|
||||
|
||||
|
||||
|
||||
// 上传文件
|
||||
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, memoryStream);
|
||||
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, memoryStream);
|
||||
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||
@@ -161,12 +211,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithStreamData(memoryStream)
|
||||
.WithObjectSize(memoryStream.Length);
|
||||
@@ -175,20 +225,27 @@ namespace IRaCIS.Core.Application.Helper
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||
|
||||
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||
var credentials = new BasicAWSCredentials(awsConfig.AccessKeyId, awsConfig.SecretAccessKey);
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
.Build();
|
||||
//提供awsEndPoint(域名)进行访问配置
|
||||
var clientConfig = new AmazonS3Config
|
||||
{
|
||||
ServiceURL = awsConfig.EndPoint
|
||||
};
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithStreamData(memoryStream)
|
||||
.WithObjectSize(memoryStream.Length);
|
||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||
|
||||
await minioClient.PutObjectAsync(putObjectArgs);
|
||||
var putObjectRequest = new Amazon.S3.Model.PutObjectRequest()
|
||||
{
|
||||
BucketName = awsConfig.BucketName,
|
||||
InputStream = memoryStream,
|
||||
Key = ossRelativePath,
|
||||
};
|
||||
|
||||
await amazonS3Client.PutObjectAsync(putObjectRequest);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -216,6 +273,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
/// </summary>
|
||||
/// <param name="localFilePath"></param>
|
||||
/// <param name="oosFolderPath"></param>
|
||||
/// <param name="isFileNameAddGuid"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true)
|
||||
@@ -225,17 +283,14 @@ namespace IRaCIS.Core.Application.Helper
|
||||
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}";
|
||||
|
||||
|
||||
//var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||
|
||||
|
||||
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||
{
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)? aliConfig.endPoint: aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, aliConfig.AccessKeyId, aliConfig.AccessKeySecret);
|
||||
|
||||
// 上传文件
|
||||
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, localFilePath);
|
||||
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, localFilePath);
|
||||
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||
@@ -243,12 +298,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithFileName(localFilePath);
|
||||
|
||||
@@ -256,19 +311,28 @@ namespace IRaCIS.Core.Application.Helper
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||
|
||||
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||
var credentials = new BasicAWSCredentials(awsConfig.AccessKeyId, awsConfig.SecretAccessKey);
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
.Build();
|
||||
//提供awsEndPoint(域名)进行访问配置
|
||||
var clientConfig = new AmazonS3Config
|
||||
{
|
||||
ServiceURL = awsConfig.EndPoint
|
||||
};
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithFileName(localFilePath);
|
||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||
|
||||
var putObjectRequest = new Amazon.S3.Model.PutObjectRequest()
|
||||
{
|
||||
BucketName = awsConfig.BucketName,
|
||||
FilePath = localFilePath,
|
||||
Key = ossRelativePath,
|
||||
};
|
||||
|
||||
await amazonS3Client.PutObjectAsync(putObjectRequest);
|
||||
|
||||
await minioClient.PutObjectAsync(putObjectArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -281,7 +345,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
public async Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath)
|
||||
{
|
||||
|
||||
|
||||
ossRelativePath = ossRelativePath.TrimStart('/');
|
||||
try
|
||||
{
|
||||
@@ -291,10 +355,10 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.endPoint : aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, aliConfig.AccessKeyId, aliConfig.AccessKeySecret);
|
||||
|
||||
// 上传文件
|
||||
var result = _ossClient.GetObject(aliConfig.bucketName, ossRelativePath);
|
||||
var result = _ossClient.GetObject(aliConfig.BucketName, ossRelativePath);
|
||||
|
||||
// 将下载的文件流保存到本地文件
|
||||
using (var fs = File.OpenWrite(localFilePath))
|
||||
@@ -308,12 +372,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
var getObjectArgs = new GetObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithFile(localFilePath);
|
||||
|
||||
@@ -322,18 +386,29 @@ namespace IRaCIS.Core.Application.Helper
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
.Build();
|
||||
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||
var credentials = new BasicAWSCredentials(awsConfig.AccessKeyId, awsConfig.SecretAccessKey);
|
||||
|
||||
//提供awsEndPoint(域名)进行访问配置
|
||||
var clientConfig = new AmazonS3Config
|
||||
{
|
||||
ServiceURL = awsConfig.EndPoint
|
||||
};
|
||||
|
||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||
|
||||
var getObjectArgs = new Amazon.S3.Model.GetObjectRequest()
|
||||
{
|
||||
BucketName = awsConfig.BucketName,
|
||||
Key = ossRelativePath,
|
||||
};
|
||||
|
||||
|
||||
await (await amazonS3Client.GetObjectAsync(getObjectArgs)).WriteResponseStreamToFileAsync(localFilePath, true, CancellationToken.None);
|
||||
|
||||
var getObjectArgs = new GetObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithFile(localFilePath);
|
||||
|
||||
await minioClient.GetObjectAsync(getObjectArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -352,7 +427,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
}
|
||||
|
||||
public async Task<string> GetSignedUrl(string ossRelativePath)
|
||||
public async Task<string> GetSignedUrl(string ossRelativePath)
|
||||
{
|
||||
ossRelativePath = ossRelativePath.TrimStart('/');
|
||||
try
|
||||
@@ -363,10 +438,10 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.endPoint : aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, aliConfig.AccessKeyId, aliConfig.AccessKeySecret);
|
||||
|
||||
// 生成签名URL。
|
||||
var req = new GeneratePresignedUriRequest(aliConfig.bucketName, ossRelativePath, SignHttpMethod.Get)
|
||||
var req = new GeneratePresignedUriRequest(aliConfig.BucketName, ossRelativePath, SignHttpMethod.Get)
|
||||
{
|
||||
// 设置签名URL过期时间,默认值为3600秒。
|
||||
Expiration = DateTime.Now.AddHours(1),
|
||||
@@ -380,13 +455,13 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
|
||||
var args = new PresignedGetObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithExpiry(3600)
|
||||
/*.WithHeaders(reqParams)*/;
|
||||
@@ -405,12 +480,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
var args = new PresignedGetObjectArgs()
|
||||
.WithBucket(minIOConfig.bucketName)
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithExpiry(3600);
|
||||
|
||||
@@ -435,6 +510,147 @@ namespace IRaCIS.Core.Application.Helper
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除某个目录的文件
|
||||
/// </summary>
|
||||
/// <param name="prefix"></param>
|
||||
/// <returns></returns>
|
||||
public async Task DeleteFromPrefix(string prefix)
|
||||
{
|
||||
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||
{
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, aliConfig.AccessKeyId, aliConfig.AccessKeySecret);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
ObjectListing objectListing = null;
|
||||
string nextMarker = null;
|
||||
do
|
||||
{
|
||||
// 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
||||
objectListing = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName)
|
||||
{
|
||||
Prefix = prefix,
|
||||
MaxKeys = 1000,
|
||||
Marker = nextMarker
|
||||
});
|
||||
|
||||
List<string> keys = objectListing.ObjectSummaries.Select(t => t.Key).ToList();
|
||||
|
||||
// 删除获取到的文件
|
||||
if (keys.Count > 0)
|
||||
{
|
||||
_ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(aliConfig.BucketName, keys, false));
|
||||
}
|
||||
|
||||
// 设置 NextMarker 以获取下一页的数据
|
||||
nextMarker = objectListing.NextMarker;
|
||||
|
||||
} while (objectListing.IsTruncated);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error: {ex.Message}");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.Build();
|
||||
|
||||
|
||||
var listArgs = new ListObjectsArgs().WithBucket(minIOConfig.BucketName).WithPrefix(prefix).WithRecursive(true);
|
||||
|
||||
|
||||
|
||||
// 创建一个空列表用于存储对象键
|
||||
var objects = new List<string>();
|
||||
|
||||
// 使用 await foreach 来异步迭代对象列表
|
||||
await foreach (var item in minioClient.ListObjectsEnumAsync(listArgs))
|
||||
{
|
||||
objects.Add(item.Key);
|
||||
}
|
||||
|
||||
|
||||
if (objects.Count > 0)
|
||||
{
|
||||
var objArgs = new RemoveObjectsArgs()
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObjects(objects);
|
||||
|
||||
// 删除对象
|
||||
await minioClient.RemoveObjectsAsync(objArgs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||
{
|
||||
|
||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||
|
||||
|
||||
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||
var credentials = new BasicAWSCredentials(awsConfig.AccessKeyId, awsConfig.SecretAccessKey);
|
||||
|
||||
//提供awsEndPoint(域名)进行访问配置
|
||||
var clientConfig = new AmazonS3Config
|
||||
{
|
||||
ServiceURL = awsConfig.EndPoint
|
||||
};
|
||||
|
||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||
|
||||
// 列出指定前缀下的所有对象
|
||||
var listObjectsRequest = new ListObjectsV2Request
|
||||
{
|
||||
BucketName = awsConfig.BucketName,
|
||||
Prefix = prefix
|
||||
};
|
||||
|
||||
var listObjectsResponse = await amazonS3Client.ListObjectsV2Async(listObjectsRequest);
|
||||
|
||||
if (listObjectsResponse.S3Objects.Count > 0)
|
||||
{
|
||||
// 准备删除请求
|
||||
var deleteObjectsRequest = new Amazon.S3.Model.DeleteObjectsRequest
|
||||
{
|
||||
BucketName = awsConfig.BucketName,
|
||||
Objects = new List<KeyVersion>()
|
||||
};
|
||||
|
||||
foreach (var s3Object in listObjectsResponse.S3Objects)
|
||||
{
|
||||
deleteObjectsRequest.Objects.Add(new KeyVersion
|
||||
{
|
||||
Key = s3Object.Key
|
||||
});
|
||||
}
|
||||
|
||||
// 批量删除对象
|
||||
var deleteObjectsResponse = await amazonS3Client.DeleteObjectsAsync(deleteObjectsRequest);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,25 +58,22 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
|
||||
<PackageReference Include="AWSSDK.S3" Version="3.7.402.4" />
|
||||
<PackageReference Include="DocX" Version="3.0.1" />
|
||||
<PackageReference Include="FreeSpire.Doc" Version="12.2.0" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
|
||||
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
||||
<PackageReference Include="EasyCaching.Redis" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
|
||||
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||
<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.4" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.5" />
|
||||
<PackageReference Include="fo-dicom" Version="5.1.3" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.3" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.14.4" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.14.5" />
|
||||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="MimeKit" Version="4.2.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.32.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.34.1" />
|
||||
<PackageReference Include="Minio" Version="6.0.3" />
|
||||
<PackageReference Include="MiniWord" Version="0.8.0" />
|
||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
|
||||
@@ -84,9 +81,11 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="NPOI" Version="2.7.1" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.2" />
|
||||
<PackageReference Include="RestSharp" Version="112.0.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
|
||||
<PackageReference Include="WinSCP" Version="6.3.3" />
|
||||
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" />
|
||||
<PackageReference Include="ZiggyCreatures.FusionCache" Version="1.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.MassTransit.Command
|
||||
{
|
||||
public record ConsistenCheckCommand
|
||||
{
|
||||
public List<CheckViewModel> ETCList { get; set; } = new List<CheckViewModel>();
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public record ConsistenCheckResult
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class CheckDBModel : CheckViewModel
|
||||
{
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//[ExcelImporter(/*ImportResultFilter = typeof(ImportResultFilteTest),*/ IsLabelingError = true)]
|
||||
|
||||
public class CheckViewModel
|
||||
{
|
||||
//[Required(ErrorMessage = "中心编号不能为空")]
|
||||
//[ImporterHeader(Name = "Site ID", AutoTrim = true)]
|
||||
[ExcelColumnName("Site ID")]
|
||||
public string SiteCode { get; set; } = string.Empty;
|
||||
|
||||
|
||||
//[Required(ErrorMessage = "受试者筛选号不能为空")]
|
||||
//[ImporterHeader(Name = "Subject ID", AutoTrim = true)]
|
||||
[ExcelColumnName("Subject ID")]
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
//[Required(ErrorMessage = "访视名称不能为空")]
|
||||
//[ImporterHeader(Name = "Visit Name", AutoTrim = true)]
|
||||
[ExcelColumnName("Visit Name")]
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
//[Required(ErrorMessage = "检查日期不能为空")]
|
||||
[CanConvertToTime(ErrorMessage = "Does not conform to Study Date format")]
|
||||
|
||||
//[ImporterHeader(Name = "Study Date", AutoTrim = true)]
|
||||
[ExcelColumnName("Study Date")]
|
||||
public string StudyDate { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
//[Required(ErrorMessage = "Modality不能为空")]
|
||||
//[ImporterHeader(Name = "Modality", AutoTrim = true)]
|
||||
[ExcelColumnName("Modality")]
|
||||
public string Modality { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj == null) return false;
|
||||
|
||||
var checkModel = obj as CheckViewModel;
|
||||
|
||||
if (checkModel is not null)
|
||||
{
|
||||
return SiteCode == checkModel.SiteCode && SubjectCode == checkModel.SubjectCode && VisitName == checkModel.VisitName && StudyDate == checkModel.StudyDate && Modality == checkModel.Modality;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (SiteCode + SubjectCode + VisitName + StudyDate + Modality).GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+26
-15
@@ -1,16 +1,22 @@
|
||||
using AutoMapper;
|
||||
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MassTransit;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json;
|
||||
using MediatR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||
{
|
||||
public class ConsistencyVerificationHandler : IRequestHandler<ConsistencyVerificationRequest, string>
|
||||
public class ConsistencyCheckConsumer : IConsumer<ConsistenCheckCommand>
|
||||
{
|
||||
|
||||
private readonly IRepository<DicomStudy> _studyRepository;
|
||||
private readonly IUserInfo _userInfo;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
@@ -24,7 +30,7 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
/// 构造函数注入
|
||||
/// </summary>
|
||||
|
||||
public ConsistencyVerificationHandler(IRepository<DicomStudy> studyRepository, IUserInfo userInfo,
|
||||
public ConsistencyCheckConsumer(IRepository<DicomStudy> studyRepository, IUserInfo userInfo,
|
||||
IRepository<Subject> subjectRepository, IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<TrialSite> trialSiteRepository, IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
||||
IMapper mapper, IStringLocalizer localizer)
|
||||
@@ -39,19 +45,22 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
_localizer = localizer;
|
||||
}
|
||||
|
||||
async Task<string> IRequestHandler<ConsistencyVerificationRequest, string>.Handle(ConsistencyVerificationRequest request, CancellationToken cancellationToken)
|
||||
|
||||
|
||||
public async Task Consume(ConsumeContext<ConsistenCheckCommand> context)
|
||||
{
|
||||
var trialId = request.TrialId;
|
||||
|
||||
var trialId = context.Message.TrialId;
|
||||
|
||||
//处理Excel大小写
|
||||
request.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 = request.ETCList;
|
||||
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;
|
||||
|
||||
//Expression<Func<SubjectVisit, bool>> subjectVisitLambda2 = x => x.TrialId == request.TrialId;
|
||||
|
||||
//subjectVisitLambda2= subjectVisitLambda2.And(x => x.CheckState == CheckStateEnum.ToCheck && x.AuditState == AuditStateEnum.QCPassed || (x.CheckState == CheckStateEnum.CVIng && x.AuditState == AuditStateEnum.QCPassed));
|
||||
|
||||
Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == request.TrialId &&
|
||||
Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == trialId &&
|
||||
(x.CheckState == CheckStateEnum.ToCheck && x.AuditState == AuditStateEnum.QCPassed || (x.CheckState == CheckStateEnum.CVIng && x.AuditState == AuditStateEnum.QCPassed));
|
||||
|
||||
var dicomQuery = from sv in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
@@ -190,7 +199,7 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
dbSV.CheckUserId = _userInfo.Id;
|
||||
dbSV.CheckPassedTime = DateTime.Now;
|
||||
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.Closed;
|
||||
|
||||
|
||||
//---核对EDC数据,完全一致
|
||||
dbSV.CheckResult = _localizer["ConsistencyVerification_EDCB"];
|
||||
//---自动核查通过
|
||||
@@ -274,11 +283,13 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
|
||||
}
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
return "OK";
|
||||
|
||||
//await context.RespondAsync<ConsistenCheckResult>(new
|
||||
//{
|
||||
|
||||
//});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,593 +1,2 @@
|
||||
{
|
||||
"test{0}{1}": "英文本地化{0}{1}",
|
||||
"RequiredAttribute": "{0} is required",
|
||||
|
||||
// ------------------------------------------------------------_ServiceExtensions--------------------------------------------------------------------
|
||||
//ApiResponseHandler
|
||||
"ApiResponse_NoAccess": "You do not have access to this API",
|
||||
"ApiResponse_Permission": "You do not have permission to do this",
|
||||
|
||||
// ------------------------------------------------------------Controllers--------------------------------------------------------------------
|
||||
//FinancialChangeController
|
||||
"Financial_ChargeSettled": "Expenses have been settled and workload can not be reset.",
|
||||
"Financial_InvalidParameter": "Invalid parameter.",
|
||||
//UploadDownLoadController
|
||||
"UploadDownLoad_UnsupportedMedia": "Unsupported media type.",
|
||||
"UploadDownLoad_ArchiveInProgress": "Another user is uploading or archiving this study.",
|
||||
"UploadDownLoad_InvalidData": "Please ensure that the uploaded data conforms to the style of the template file and contains valid data.",
|
||||
"UploadDownLoad_RequestError": "Request error, please try again!",
|
||||
"UploadDownLoad_SupportedFormats": "Supports upload of .xlsx, .xls, and .csv formats.",
|
||||
|
||||
// ------------------------------------------------------------_MediatR--------------------------------------------------------------------
|
||||
//ConsistencyVerificationRequest
|
||||
"ConsistencyVerification_Tech": "Study Type",
|
||||
"ConsistencyVerification_Time": "Incorrect time format",
|
||||
//ConsistencyVerificationHandler
|
||||
"ConsistencyVerification_Img": "Hello, according to the automatic recognition of this system, the imaging study submitted by the subject in the current visit in the IRC system is as follows:",
|
||||
"ConsistencyVerification_Of": "Of",
|
||||
"ConsistencyVerification_ImgC": "Imaging study",
|
||||
"ConsistencyVerification_EDCA": "Check EDC data, completely consistent, approved",
|
||||
"ConsistencyVerification_EDCB": "Check EDC data, completely consistent",
|
||||
"ConsistencyVerification_Auto": "Automatically verified pass",
|
||||
"ConsistencyVerification_Prob": "The following problems exist:",
|
||||
"ConsistencyVerification_EdcL": "Image study (EDC missing)",
|
||||
"ConsistencyVerification_IrcL": "Image study (IRC missing)",
|
||||
"ConsistencyVerification_Desc": "Description: In order to efficiently solve all the above doubts, please verify the actual image study accurately. Please note that the image date may not be consistent with the actual study date, and multiple modalities of image studys (such as PET-CT) may exist at the same time. After accurate verification, please reply with the correct image study for this visit.",
|
||||
"ConsistencyVerification_Conf": "According to the imported consistency check data, please confirm the following inconsistent inspection item information of this visit:",
|
||||
"ConsistencyVerification_Edc": "EDC is lack of:",
|
||||
"ConsistencyVerification_IrcLi": "IRC is lack of:",
|
||||
|
||||
//-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
|
||||
//ClinicalDataSetService
|
||||
"ClinicalDataSet_Apply": "",
|
||||
"ClinicalDataSet_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||
//ClinicalQuestionService
|
||||
"ClinicalQuestion_Repeat": "",
|
||||
//ReadingClinicalDataService
|
||||
"ReadingClinicalData_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||
"ReadingClinicalData_Unchecked": "The current clinical data status is not verified and signing is not allowed!",
|
||||
//ReadingGlobalTaskService
|
||||
"ReadingGlobal_NotGlobal": "System call error. The current read is not a global review read.",
|
||||
//ReadingImageTaskService
|
||||
"ReadingImage_NotVisit": "System call error. The current read is not a timepoint read.",
|
||||
"ReadingImage_CantSplit": "The current read is a baseline read, and lesion split is not allowed.",
|
||||
"ReadingImage_BeSigned": "The current read has already been signed. Please do not submit it again.",
|
||||
"ReadingImage_Beinvalid": "The current read has already been invalidated, and reading is not allowed anymore.",
|
||||
"ReadingImage_PresenceReview": "The current subject has a re-read request that has not been processed and is not allowed to operate",
|
||||
"ReadingImage_NotaTask": "The coalesced lesions are not from the same timepoint.",
|
||||
"ReadingImage_DeleteError": "Other lesions have split from or coalesced into the current lesion. Deletion failed.",
|
||||
"ReadingImage_Idnotcorrespond": "Failed to add the lesion mark. The Instance ID and Series ID of the image do not match.",
|
||||
"ReadingImage_IsLymphNotbigger": "The short diameter of this nodal non-target lesion on the current visit is smaller than the value on the previous visit, and the state cannot be set to 'Unequivocal progression'.",
|
||||
"ReadingImage_NotLymphNotbigger": "The long diameter of this non-nodal non-target lesion on the current visit is smaller than the value on the previous visit, and the state cannot be set to 'Unequivocal progression'.",
|
||||
"ReadingImage_Twice": "System call error. Questions & answers submitted are duplicated.",
|
||||
"ReadingImage_MaxQuestion": "According to the imaging charter, the number of {0} cannot exceed {1}.",
|
||||
"ReadingImage_Maxlesion": "According to the imaging charter, the number of target lesions in the same organ cannot exceed {0}. Please confirm.",
|
||||
"ReadingImage_Maximum": "{0} can only be repeated {1} times, and it has been repeated {2} times so far.",
|
||||
"ReadingImage_PCWGMaximum": "According to the imaging charter, the number of baseline lesions at the same location should enter only {0} time. Please confirm.",
|
||||
"ReadingImage_NotNewFocus": "There should be no new lesions in the converted task",
|
||||
"ReadingImage_RequiredQuestion": "Before submission, please fill in {0}.",
|
||||
"ReadingImage_ClinicalRead": "The clinical data has not been read. Please confirm!",
|
||||
"ReadingImage_IDMust": "System call failed. When there is no Read ID, the standard ID must be passed.",
|
||||
"ReadingImage_TaskFinish": "Please note that all reads of the current subject have been completed.",
|
||||
"ReadingImage_NeedRest": "You have been continuously reading for {0} hours. Please take a break of {1} minutes before resumption.",
|
||||
//ReadingJudgeTaskService
|
||||
"ReadingJudge_SouceIdNull": "System call failed. The Source ID of the global review which is being adjudicated currently is 'null'.",
|
||||
//ReadingOncologyTaskService
|
||||
"ReadingOncology_TaskError": "System call error. The current read is not an oncology read.",
|
||||
"ReadingOncology_Abnormal": "System call exception. The result of adjudication is null",
|
||||
//ReadingCalculate
|
||||
"ReadingCalculate_Abnormal": "Configuration error of PCWG3 criteria. Data verification failed.",
|
||||
"ReadingCalculate_questionable": "Problems with the lesions are as follows:",
|
||||
"ReadingCalculate_NoMarker": "Lesion {0} lacks mark.",
|
||||
"ReadingCalculate_StatusIsEmpty": "The state of Lesion {0} is empty.",
|
||||
"ReadingCalculate_NoMarkerEmpty": "Lesion {0} is not marked, and its state is empty.",
|
||||
"ReadingCalculate_NoDeveloped": "Please note that the current standard automatic calculation has not been developed.",
|
||||
//ReadingMedicalReviewService
|
||||
"MedicalReview_invalid": "This medical review read has already been invalidated, and the operation failed.",
|
||||
"MedicalReview_SaveQuestion": "Unable to perform the current operation. Please save the medical review questions first.",
|
||||
"MedicalReview_NeedSave": "Unable to perform the current operation. Please save the medical review questions and conclusions first.",
|
||||
"MedicalReview_NotClosed": "Unable to perform the current operation. The current medical query conversation has not been closed.",
|
||||
"MedicalReview_Finish": "The current medical review is the last one.",
|
||||
//ReadingMedicineQuestionService
|
||||
"ReadingMed_QNumDup": "Current question number is repeated",
|
||||
"ReadingMed_HasSubQ": "This question has sub-question, please delete it first",
|
||||
"ReadingMed_NoMedQ": "Medical review question has not been added yet. Please add it first before confirming",
|
||||
"ReadingMed_MedQNumDup": "The display number of the medical imaging review question cannot be duplicated.",
|
||||
"ReadingMed_ParentNumSmall": "The display number of the parent question should be smaller than that of the child question, please confirm.",
|
||||
"ReadingMed_VisitQNotConfig": "This review criteria has no medical review questions for 'visit'",
|
||||
"ReadingMed_GlobalQNotConfig": "The global review read is enabled in the current criterion, but has not configured with medical review questions",
|
||||
"ReadingMed_ArbitrateQNotConfig": "Adjudication review reading is enabled in the current criterion, but has not configured with medical review questions",
|
||||
"ReadingMed_TumorQNotConfig": "Oncology reading is enabled in the current criterion, but the oncology medical review question has not been configured",
|
||||
//UserService
|
||||
"User_CheckNameOrPw": "Please check the username or password.",
|
||||
//Repository
|
||||
"Repository_UpdateError": "Updated data does not exist in the database. ",
|
||||
"Repository_DeleteError": "Deleted data does not exist in the database.",
|
||||
//OrganInfoService
|
||||
"OrganInfo_DuplicateData": "There are duplicate data, operation failed.",
|
||||
//ReadingCriterionService
|
||||
"ReadingCriterion_Referenced": "The current criterion has been referenced and cannot be deleted.",
|
||||
"ReadingCriterion_InUse": "This criterion has been used in the project and cannot be deleted.",
|
||||
"ReadingCriterion_ArbitratorWithoutJudgment": "There is no referee problem but there is an arbitration object, operation failed.",
|
||||
//ReadingQuestionService
|
||||
"ReadingQuestion_IdDup": "Duplicate problem ID.",
|
||||
"ReadingQuestion_ChildrenExist": "This problem has sub-problems, please delete the sub-problems first.",
|
||||
"ReadingQuestion_GroupReferenced": "This grouping has been referenced, please delete the referenced problems first.",
|
||||
"ReadingQuestion_JudgmentSet": "The current question already has a referee criterion set, modification failed.",
|
||||
"ReadingQuestion_ExcludeWithDependency": "The displayed dependent parent question and the required dependent question are the same, but the answers are mutually exclusive, operation failed.",
|
||||
"ReadingQuestion_CircularDependency": "Calculation dependency has looped!",
|
||||
//ReadingPeriodSetService
|
||||
"ReadingPeriodSet_NameDup": "Review period name duplicate, operation failed",
|
||||
"ReadingPeriodSet_Global": "Review period name cannot be Global",
|
||||
"ReadingPeriodSet_AlreadyAdded": "{0} has already added the review period, cannot set it effective.",
|
||||
"ReadingPeriodSet_TaskCompletedCannotRevoke": "The current criterion has generated reads and the reads have been completed, revoke failed.",
|
||||
"ReadingPeriodSet_LastVisit": "Last visit.",
|
||||
//ReadModuleService
|
||||
"ReadModule_AlreadyAdded": "The current visit has already added a review period.",
|
||||
"ReadModule_AddGlobalFirst": "Please add global review first.",
|
||||
"ReadModule_VisitNotFound": "No qualified visit was found.",
|
||||
"ReadModule_SignedDataCannotDelete": "Clinical data has been signed and cannot be deleted.",
|
||||
"ReadModule_TumorExists": "The current visit has a tumor review, please delete it first.",
|
||||
"ReadModule_TaskGenerated": "The current review has generated reads, operation failed.",
|
||||
//UserWLTemplateService
|
||||
"UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.",
|
||||
"UserWLTS_NameRepeated": "The template name is repeated",
|
||||
"UserWLTS_ContentRepeated": "The template content is repeated",
|
||||
|
||||
// ------------------------------------------------------------Allocation--------------------------------------------------------------------
|
||||
//TaskAllocationRuleService
|
||||
"TaskAllocation_DoctorIdNotFound": "Error, the doctor's account Id was not found in the enrollment table.",
|
||||
"TaskAllocation_DoctorConfigExists": "The doctor configuration is already available, and continued additions cannot be allowed.",
|
||||
"TaskAllocation_TaskAssigned": "A read has been assigned to the doctor and it cannot be deleted.",
|
||||
//TaskConsistentRuleService
|
||||
"TaskConsistent_ConsistencyConfigExists": "Please configure the doctor for consistency analysis.",
|
||||
"TaskConsistent_TaskGenerated": "The trial configuration is already available, and no continued additions are allowed.",
|
||||
"TaskConsistent_MedicalAuditTaskExists": "The criterion already has reads generated by the Subject, and configuration modification is not allowed.",
|
||||
"TaskConsistent_SignedTaskCannotBeInvalidated": "This criterion has generated a consistency analysis task and cannot be deleted.",
|
||||
//TaskMedicalReviewRuleService
|
||||
"TaskMedicalRule_TaskAlreadyAssigned": "The doctor configuration is already available, and continued additions cannot be allowed.",
|
||||
"TaskMedicalRule_TaskStarted": "A medical review task has been generated.",
|
||||
//TaskMedicalReviewService
|
||||
"TaskMedical_DirtyData": "Signed files cannot be set to invalid.",
|
||||
"TaskMedical_SubjectInOtherArm": "A task is currently assigned to someone else,and it cannot be assigned. Please refresh the list.",
|
||||
//VisitTaskService
|
||||
"VisitTask_VisitTask_TaskAlreadyApplied": "The trial has not confirmed any of the review criteria.",
|
||||
"VisitTask_DoctorConfigNotFound": "The current doctor has begun to do the task of this standard of subject, so assignment cannot be canceled.",
|
||||
"VisitTask_BackendDataError": "One of the reeads has been assigned to the doctor and is not allowed to be assigned.",
|
||||
"VisitTask_DirtyData": "Dirty data appears, and the task source field has no value.",
|
||||
"VisitTask_MissingTaskSource": "The subject had a visit and entered the return process, which has not been verified for consistency and is not allowed to be assigned.",
|
||||
"VisitTask_InconsistentSubjectStatus": "There is a subject that already has the doctor in another Arm group. It is not allowed to add the doctor to a new group.",
|
||||
"VisitTask_DuplicateDoctorInArm": "There is a subject that already has the doctor in another Arm group, so the futher assignment is not allowed. Please refresh the page to confirm whether the data on the page is expired.",
|
||||
"VisitTask_DoctorAlreadyInArm": "The assignment of a Subject task cannot be canceled because it has been applied.",
|
||||
"VisitTask_TaskAlreadyApplied": "The configured doctor cannot be found in the configuration table, and the binding cannot be applied. Please check the data.",
|
||||
"VisitTask_DoctorConfiguration": "Background data error",
|
||||
"VisitTask_BackendData": "Reads that have not been completed or have not been effective are not allowed to request re-reading.",
|
||||
"VisitTask_UnreadTask": "Reads that re-read has been applied or approved are not allowed to apply for re-reading.",
|
||||
"VisitTask_NoPMRecheck": "Additional review reads do not allow the PM to apply for re-reading",
|
||||
"VisitTask_Reapply": "PM is not allowed to apply for re-reading of consistency analysis reads.",
|
||||
"VisitTask_ConsistencyAnalysis": "PM is only allowed to apply for re-reading that the view type is visit.",
|
||||
"VisitTask_VisitTypeRestriction": "This is chronological read, and the subject has visit that has applied for re-read by PM, but has not been processed, so it cannot been applied for continuing re-read at this time.",
|
||||
"VisitTask_SequentialReading": "This is chronological read, and the subject has visit that has applied for re-read, but has not been processed, so it cannot been applied for re-read for now.",
|
||||
"VisitTask_ImageProblem": "This is chronological read, and there is something wrong with the image. PM has applied for returning, so it cannot been applied for re-reading now.",
|
||||
"VisitTask_LastReading": "This is chronological read, and only the request for re-readinng by the subject reader after completing the global task for the last time is allowed.",
|
||||
"VisitTask_LastOncologistRecheck": "This is chronological read, and the subject will only be allowed to re-read after IR completing the last oncology read ",
|
||||
"VisitTask_LastAdjudicatorRecheck": "This is chronological read, and the subject will only be allowed to re-read after IR completing the last adjudication read ",
|
||||
"VisitTask_IRGlobalRecheck": "This is random read, IR is only allowed to apply for re-reading global and visit reads",
|
||||
"VisitTask_IRReapply": "This is random read, IR is only allowed to apply for re-reading global and visit reads ",
|
||||
"VisitTask_InvalidReapplyStatus": "The current re-read status is not requested and cannot be processed. Please refresh the page.",
|
||||
"VisitTask_ReapplyStatusConflict": "The current re-read status has been affected by another re-read reads. The re-read review operation is not allowed for reads in this state",
|
||||
"VisitTask_ReReadTaskNotApplied": "Only reads with visit type are allowed to approve of re-read.",
|
||||
"VisitTask_ReReadTaskAlreadyAffected": "Do not conform to the PM request and SPM / CPM approve , or IR request and PM approve.",
|
||||
"VisitTask_TaskTypeNotApproved": "The current re-read status is not requested and cannot be processed. Please refresh the page.",
|
||||
"VisitTask_NoImageReturn": "Additional review reads do not allow PM to apply for re-reading",
|
||||
"VisitTask_NonEffectiveTaskCannotBeReturned": "Only effective and unfinished visit read can be returned. Please refresh the page data.",
|
||||
"VisitTask_NoFurtherReturn": "The current visit has been returned to image upload, so continuing to return is not allowed!",
|
||||
"VisitTask_ConsistencyTaskCannotBeReturned": "The consistency analysis read is not allowed to be set return back.",
|
||||
"VisitTask_PMOnlyAllowedForReturn": "Only PM can perform the return back.",
|
||||
"VisitTask_UnsupportedTaskType": "Re-read types are not supported.",
|
||||
"VisitTask_UndefinedList": "The current user view list is not defined.",
|
||||
"VisitTask_NoConsistencyReturn": "The conformance analysis read cannot be returned back",
|
||||
"VisitTask_VisitTypeTaskAllowedForPMOnly": "Only read with visit type can be returned by PM.",
|
||||
|
||||
// ------------------------------------------------------------Common--------------------------------------------------------------------
|
||||
//CommonDocumentService
|
||||
"Document_CodeDuplication": "The Code of the document cannot be repeated.",
|
||||
"Document_SingleTemplate": "Only one template file is allowed per scenario and standard.",
|
||||
"Document_ TemplateRead": "Failed to read the template content, please try saving the file as docx format!",
|
||||
//DictionaryService
|
||||
"Dictionary_DictionaryName": "There is already a dictionary with the name {0}.",
|
||||
"Dictionary_DictionaryDeletion": "The current dictionary is referenced in the standard and cannot be deleted!",
|
||||
"Dictionary_SubitemDeletion": "There is child data, direct deletion is not allowed!",
|
||||
"Dictionary_ResumeReference": "The current entry has been referenced in the reader resume.",
|
||||
"Dictionary_ProjectReference": "The current entry has been referenced in the trial information.",
|
||||
"Dictionary_StandardReference": "The current entry has been referenced in the review criteria.",
|
||||
//ExcelExportService
|
||||
"ExcelExport_UnsupportedExport": "Currently the criterion export is not supported.",
|
||||
//MailService
|
||||
"Mail_EmailResetReminder": "[From Extensive Imaging IRC] A reminder about resetting the email.",
|
||||
"Mail_Dear": "Dear {0},",
|
||||
"Mail_ResettingEmail": "You are resetting an email address.",
|
||||
"Mail_IRCResettingPassword ": "[From Extensive Imaging IRC] A reminder about resetting your password",
|
||||
"Mail_ResettingPassword ": "You are resetting the email password",
|
||||
"Mail_ImagingIRCReminder": "[From Extensive Imaging IRC] A reminder",
|
||||
"Mail_IRCProject": "You are participating in the Extensive Imaging IRC trial",
|
||||
"Mail_ProjectParticipationReminder": "[From Extensive Imaging IRC] [{0}] A reminder of the Site Survey",
|
||||
"Mail_CenterResearchReminder": "You are participating in the Site Survey of the Extensive Imaging IRC trial.",
|
||||
"Mail_AccountCreationReminder": "[From Extensive Imaging IRC] A reminder about creating an account",
|
||||
"Mail_AccountPasswordResetReminder": "[From Extensive Imaging IRC] A reminder about resetting account passwords",
|
||||
"Mail_InvitationEmail": "[From Extensive Imaging IRC][{0}]Invitation",
|
||||
//SystemMonitor
|
||||
"SysMon_JsonConfig": "Parsing the Json file configuration failed",
|
||||
|
||||
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
|
||||
//DoctorService
|
||||
"Doctor_DupPhoneOrEmail": "The current tel or email number already existed",
|
||||
"Doctor_DupPhone": "The current tel number already existed!",
|
||||
"Doctor_DupEmail": "The current email already existed!",
|
||||
"Doctor_StandardDuplicateFileTypeError": "This type of file has already been added to the current criterion.",
|
||||
"Doctor_RequiredDocumentsError": "Resume & Consultant Agreement must be upload",
|
||||
|
||||
// ------------------------------------------------------------Document--------------------------------------------------------------------
|
||||
//SystemDocumentService
|
||||
"SystemD_DuplicateFile": "A file with the same type and same name already exists in the system.",
|
||||
"SystemD_CannotDeleteSignedFile": "The file has already been read and signed by a user, and not allowed to be deleted.",
|
||||
//TrialDocumentService
|
||||
"TrialD_DuplicateFileInProject": "A file with the same type and same name already exists in this trial .",
|
||||
"TrialD_DocumentHasAlready": "The file has already been read and signed by a user, and not allowed to be deleted.",
|
||||
"TrialD_FileAlreadySigned": "The file has been signed.",
|
||||
"TrialD_ObsoleteFile": "The file has been revoked. Signature failed!",
|
||||
//TrialEmailNoticeConfigService
|
||||
"TrialEmailN_TaskNotSigned": "Before sending the email, the task must have been signed and triggered to complete the corresponding task generation.",
|
||||
"TrialEmailN_NoRecipient": "The message cannot be sent without the recipient.",
|
||||
"TrialEmailN_InvalidEmailConfig": "The configuration of the sender mail of the trial is wrong, please check.",
|
||||
"TrialEmailN_EmailTemplateNotFound": "The email template in the standard scenario of this trial cannot be found.",
|
||||
"TrialEmailN_EnrollmentConfirmation": "[Enrollment Confirmation Report] About {0} item {1}Subject",
|
||||
"TrialEmailN_Enrollment": "The attachment is the Enrollment Confirmation Report, please check.",
|
||||
"TrialEmailN_PDReport": "[PD Confirmation Report] About {0} item {1}Subject",
|
||||
"TrialEmailN_SubjectDiseaseProgression": "The attachment is the PD Confirmation Report, please check.",
|
||||
"TrialEmailN_SingleBlindedSet": "The configuration of the single and chronological read is incorrect (there should be no adjudicator configuration), please check!",
|
||||
"TrialEmailN_SingleBlindedSequenced": "The single and chronological read, should not enter the logic here, please contact the background developers to check!",
|
||||
"TrialEmailN_PDProgressEmailTask": "Send PD progress email found problem with the task data!",
|
||||
"TrialEmailN_DoubleBlindedError": "The double and chronological read does not defined the adjudication rule logic, please contact the developers to check!",
|
||||
"TrialEmailN_InCons": "The trial is not configured with the Enrollment Confirmation!",
|
||||
"TrialEmailN_NoBaseLine": "There is no baseline visit configured with Enrollment Confirmation and IR readed,so email failed to send",
|
||||
"TrialEmailN_IncompBase": "The baseline reads for enrollment confirmation has not been finished for IR!",
|
||||
"TrialEmailN_EmailFail": "Email failed to generate manually,please contact developer to verify the failure cause",
|
||||
"TrialEmailN_NoReader": "No IR has finished the baseline read at present!",
|
||||
"TrialEmailN_NoPDConfig": "The trial is not configured with PD Confirmation!",
|
||||
"TrialEmailN_NoPDTasks": "There is no baseline visit configured with “PD Confirmation” and IR readed,so email failed to send",
|
||||
"TrialEmailN_PDNotFinished": "The completion status of the latest PD interview and film reading task of the current subject does not meet the sending conditions",
|
||||
"TrialEmailN_PDNoImaging": "The trial is configured with review period adjudication, but the current subject' s latest visit marked 'PD' have no review period",
|
||||
"TrialEmailN_PDPhaseNotFinished": "The review period status of the current subject's latest PD visit does not meet the sending conditions",
|
||||
"TrialEmailN_NoRuleDefined": "The sending logic for adjudication rule is not defined! ",
|
||||
"TrialEmailN_NoDoubleOrder": "The current trial is not double and chronological read, so the sending condition is not met",
|
||||
"TrialEmailN_NoSendLogicDefined": "The current trial is not defined sending logic",
|
||||
"TrialEmailN_BlindedSequencedReading": "The configuration of the chronological read is wrong (should be single or double reading), please check!",
|
||||
"TrialEmailN_UnblindedSequencedReading": "The configuration of random read is wrong (should be single read without adjudication, or double read with adjudication for visiting ), please check!",
|
||||
"TrialEmailN_InvalidTaskTypeForEmailSending": "Do not send emails for other type except visit, adjudication and global read. Please check the logic.",
|
||||
"TrialEmailN_PDLogicNotDefined": "Reads for this criterion has not yet defined the PD logic, please supplement it after consultation with the developer.",
|
||||
"TrialEmailN_MailboxWrong": "The configuration of the sender mailbox of the trial is wrong, please check it.",
|
||||
"TrialEmailN_InvalidRecipient": "The trial does not have a valid recipient, so the message cannot be sent.",
|
||||
"TrialEmailN_EmailTestMessage": "Trial mail test",
|
||||
"TrialEmailN_ConfigurationCorrect": "If this email is received, the email configuration is correct.",
|
||||
"TrialEmailN_InvalidSenderEmailConfig": "The sender configuration is incorrect. Please check whether the server address or authorization code is correct or not.",
|
||||
|
||||
// ------------------------------------------------------------Financial--------------------------------------------------------------------
|
||||
//CalculateService
|
||||
"Cal_VolDataErr": "Volume reward data error.",
|
||||
//ExchangeRateService
|
||||
"ExR_SameMthExist": "The exchange rate of the same month already existed.",
|
||||
"ExR_MthPymtRate": "The exchange rate has been used in monthly payment",
|
||||
//PaymentAdjustmentService
|
||||
"PayAdj_DocPymtLock": "Doctor payment has confirmed lock",
|
||||
//RankPriceService
|
||||
"RP_TitleUsedByRev": "This title has been used by reviewer payment information",
|
||||
//TrialRevenuesPriceService
|
||||
"TRP_AddMeaningful": "Please add meaningful data",
|
||||
|
||||
// ------------------------------------------------------------ImageAndDoc--------------------------------------------------------------------
|
||||
//DicomArchiveService
|
||||
"DAS_NoAnonCacheData": "The cache data for anonymous config is not obtained, and the upload stops. Please contact the developer to verify.",
|
||||
//ImageShareService
|
||||
"ISS_NoImgToShare": "There are no images to share for the current study.",
|
||||
"ISS_ResNotExists": "The request resource wasn’t found.",
|
||||
"ISS_SharePwdError": "The shared password is incorrect.",
|
||||
"ISS_ShareExpiration": "Resource sharing expires.",
|
||||
//StudyService
|
||||
"Study_VisitBeforePrevError": "The current visit check time {0} cannot be earlier than the previous visit check time {1}. Please check whether the check data is correct.",
|
||||
"Study_VisitAfterSubseqError": "The current visit check time {0} cannot be later than the visit check time {1} .Please check whether the check data is correct.",
|
||||
"Study_UploadArchiving": "Someone is currently uploading and archiving this visit!",
|
||||
"Study_VisitEndedNotAllowed": "Subject visit is over, and uploading is not allowed!",
|
||||
"Study_ImgAlreadyUploaded": "Uploading is not allowed above here.The current image check has been uploaded to {1} of subject {0}",
|
||||
|
||||
// ------------------------------------------------------------Inspection--------------------------------------------------------------------
|
||||
//FrontAuditConfigService
|
||||
"FrontAudit_IdDup": "The identifier is duplicated.",
|
||||
"FrontAudit_NameDup": "The name is duplicated .",
|
||||
"FrontAudit_CannotDelSub": "Subclasses exist, cannot delete.",
|
||||
//InspectionService
|
||||
"Inspection_UserDisabled": "The current user has been disabled.",
|
||||
|
||||
// ------------------------------------------------------------Institution--------------------------------------------------------------------
|
||||
//CROService
|
||||
"CRO_DupName": "CRO with the same name already exists. Please confirm.",
|
||||
"CRO_InProject": "The CRO has participated in the trial and cannot be deleted.",
|
||||
//HospitalService
|
||||
"Hospital_DupName": "Hospital with the same name already exists. Please confirm.",
|
||||
"Hospital_SiteAdded": "The current Site has been added to another Hospital.",
|
||||
"Hospital_HasDoctors": "There are already doctors registered under the hospital's account and cannot be deleted.",
|
||||
//SiteService
|
||||
"Site_DupName": "Site with the same name already exists. Please confirm.",
|
||||
"Site_InProject": "This site has been added to the project and cannot be deleted.",
|
||||
//SponsorService
|
||||
"Sponsor_DupName": "Sponsor with the same name already exists. Please confirm.",
|
||||
"Sponsor_InProject": "The sponsor has been added to the trial and it is not allowed to delete.",
|
||||
|
||||
// ------------------------------------------------------------Management--------------------------------------------------------------------
|
||||
//MenuService
|
||||
"Menu_ParentDupChild": "A child node with the same name already exists under the parent node.",
|
||||
"Menu_ChildExist": "Child nodes already exists under this node . Delete the child nodes before deleting the node.",
|
||||
//UserService
|
||||
"User_UsernameExist": "The user name already exists.",
|
||||
"User_PhoneDup": "A user with the same phone number already exists in this user type.",
|
||||
"User_EmailDup": "A user with the same email already exists in this user type.",
|
||||
"User_NewOldPwdSame": "The new password is the same as the old one.",
|
||||
"User_OldPwdInvalid": "Failed to verify the old password.",
|
||||
"User_LegalEmail": "Please input a legal email.",
|
||||
"User_VerificationCodeError": "The verification code is wrong.",
|
||||
"User_VerificationCodeExpired": "The verification code has expired.",
|
||||
"User_CreateFailed": "Check the email address or contact maintainers. The email fails to be sent and the account cannot be created.",
|
||||
"User_InvalidEmail": "Please enter a correct E-mail address.",
|
||||
"User_EmailError": "The email adress is wrong.",
|
||||
"User_InProject": "The user has participated in the trial and cannot be deleted.",
|
||||
"User_Disabled": "The user has been disabled.",
|
||||
//UserTypeService
|
||||
"UserType_InUse": "User already exists in that user type, and it cannot be deleted.",
|
||||
|
||||
// ------------------------------------------------------------QC--------------------------------------------------------------------
|
||||
//QCCommon
|
||||
"QCCommon_CannotOperate": "CRC has submitted the image. Operation is not allowed.",
|
||||
"QCCommon_NoPermission": "You are not the current recipient of the image QC. No operation authority!",
|
||||
"QCCommon_CheckTimeEarly": "The current visit study time {0} cannot be earlier than the previous visit study time {1}. Please check whether the study data is correct.",
|
||||
"QCCommon_CheckTimeLate": "The current visit study time {0} cannot be later than the visit study time {1} .Please check whether the study data is correct.",
|
||||
//QCOperationService
|
||||
"QCOperation_CheckFirst": "Please check the image first and save review questions before query.",
|
||||
"QCOperation_QuestionExist": "The unclosed query of the current visit has been set to approve CRC reupload. After CRC has reuploaded image, please close the original query first and then add a new query.",
|
||||
"QCOperation_QuestionCannotClose": "CRC has applied for reuploading or QC has agreed to reupload. To close the query is not allowed. Please do not close the query until the QC rejects or the CRC reuploads the image.",
|
||||
"QCOperation_CloseReason": "Reason for closing:",
|
||||
"QCOperation_QuestionReplied": "The QC query has been answered.",
|
||||
"QCOperation_NoPermissionReply": "You do not have permission to reply to the data reconciliation conversation.",
|
||||
"QCOperation_CannotClose": "The current visit status is CRC request re-upload. The query is not allowed to be closed.",
|
||||
"QCOperation_Reason": "Notes:",
|
||||
"QCOperation_CannotPass": "The current visit is in the return status, and the data reconciliation cannot be set.",
|
||||
"QCOperation_PassAfterClose": "Please close the data reconciliation query first, and then set the data reconciliation pass.",
|
||||
"QCOperation_Cannotback": "The current visit has passed the consistency check and cannot be applied for re-upload.",
|
||||
"QCOperation_CRCRollback": "CRC apples for re-upload.",
|
||||
"QCOperation_OtherCRC": "Other CRCs have applied for processing. Please refresh the page.",
|
||||
"QCOperation_PMReject": "PM/APM rejected the data reconciliation return.",
|
||||
"QCOperation_NoPermission": "You do not have operation permission.",
|
||||
"QCOperation_CannotRollback": "If the current visit has not do reconciliation or has passed, setbacks are not allowed.",
|
||||
"QCOperation_PMAPMConsistency": "PM/APM agrees to the data reconciliation rollback.",
|
||||
"QCOperation_NoModifyAfterSubmit": "Once submitted, no modifications are allowed.",
|
||||
"QCOperation_UnresolvedQCQuery": "Image query of the current visit is not closed. This operation is not allowed.",
|
||||
"QCOperation_CrcNoDelete": "The CRC has been committed and cannot be deleted.",
|
||||
"QCOperation_NoRecipient": "You are not the current recipient of the quality control task, no operation authority!",
|
||||
"QCOperation_QCImageTaskAlreadyReleased": "The image QC of the current visit has been released by the original recipient. You can get it by 'claime'.",
|
||||
"QCOperation_QCTaskNoAccess": "The image quality control task of the current visit has been claimed by other QC, so it is not allowed to claim.",
|
||||
"QCOperation_QCConfigFirst": "Please configure the image QC questions before claiming any image QC work.",
|
||||
"QCOperation_NoQC": "The trial configuration of image QC was not check, and the QC Task was not be claimed.",
|
||||
"QCOperation_InitialAuditPassed": "The first review has passed, continue to receive can not be allowed.",
|
||||
"QCOperation_NoSingleAudit": "The trial is configured with single image QC , does not meet Submmit State: Submitted or Audit State: pending QC/ in QC, not allowed to collect.Please refresh the page.",
|
||||
"QCOperation_NoSameReviewer": "The secondary QC cannot be the same person as the primary QC.",
|
||||
"QCOperation_NoSecondaryAudit": "The trial is configured withr double image QC , does not meet Submmit State: Submitted or Audit State: pending review/ in QC, not allowed to collect.Please refresh the page.",
|
||||
"QCOperation_NoTaskAccess": "You are not the current recipient of the quality control task, no operation authority!",
|
||||
"QCOperation_NoQCFunction": "The project configuration of image QC process was not check, so there is no need to cancel the task function.",
|
||||
"QCOperation_NoTaskOwner": "The current visiting image QC has not been claimed by anyone, and cannot been released.",
|
||||
"QCOperation_DiseaseProgressConfirmation": "Current visit required PD Confirmation. Please process the unsubmitted prior visit before submitting the current visit: {0}.",
|
||||
"QCOperation_UnsubmittedVisits": "After submitting the current visit, please submit any prior visits which have not been submitted as soon as possible. ({0})",
|
||||
"QCOperation_NoBaselineData": "No clinical data at baseline. Confirm to submit?",
|
||||
"QCOperation_NoImageData": "Dicom/ Non-dicom image data has not been uploaded. Submission is not allowed.",
|
||||
"QCOperation_ImagesSubmitted": "The image data of the current visit has been submitted by another CRC.",
|
||||
"QCOperation_BatchImagesSubmitted": "The visit image data is currently submitted in batches, part of which has been submitted by other CRCs.",
|
||||
"QCOperation_MissingBaselineDate": "The trial is configured with the visit start date, but the visit start date for the subject is not filled. Submittion is not allowed.",
|
||||
"QCOperation_RemoveItem": "You have been removed from the trial and have no operation rights.",
|
||||
"QCOperation_QCNotClosed": "The QC query has not been closed for the current visit. This operation cannot be performed.",
|
||||
"QCOperation_NoQCNeeded": "The trial configuration of image QC was no. No need to set image QC as pass.",
|
||||
"QCOperation_QCNotSaved": "Image QC question is not saved. This operation is not allowed.",
|
||||
"QCOperation_NotChangePass": "The trial configuration of image QC process was double check, so the current image QC task cannot change from the current state to pass.",
|
||||
"QCOperation_CannotChangeToPass": "The trial configuration of image QC process was double check. The current audit state is {0}, which cannot be changed to approved.",
|
||||
"QCOperation_NoQCNeededNotEnd": "The trial configuration of image QC process was not check, and setting image quality control termination is not allowed.",
|
||||
"QCOperation_CannotChangeToStop": "The trial configuration of image QC process was single check, and the current review state is not In Primary QC and cannot be changed to the QC termination.",
|
||||
"QCOperation_CannotChangeStop": "The trial configuration of image QC process was double check, and the current review state is {0} and cannot be changed to the QC termination.",
|
||||
"QCOperation_InvalidResend": "The current reupload state is not QC agree, so reuploading is not allowed.",
|
||||
"QCOperation_NoResendNeeded": "No check operation, there will be no need to reupload!",
|
||||
"QCOperation_InvalidAgreeResend": "The current re-upload- status is not CRC requested and the approve of reuploading cannot be set.",
|
||||
"QCOperation_CannotAgreeResend": "At the current visit, there is an unclosed query that QC set to agree to reupload, CRC has not uploaded, currently is not allowed to set again.",
|
||||
"QCOperation_AgreeResend": "QC agrees to re-upload.",
|
||||
"QCOperation_InvalidCompleteResend": "The current reupload status is not QC approved, setting reuploading completion is not allowed.",
|
||||
"QCOperation_NoImageNotAllowed": "No image is currently available. Setting reuploaded is not allowed.",
|
||||
"QCOperation_CRCTransferCompleted": "CRC reuploading has been completed. ",
|
||||
"QCOperation_InvalidTransferStatus": "The current query re-upload status is not the initial| CRC re-uploaded. Application for re-uploading is not allowed",
|
||||
"QCOperation_CRCTransfer": "CRC requests to reupload/upload images.",
|
||||
"QCOperation_CannotModifyConfirmation": "The visit has been submitted, and the enrollment confirmation state cannot be modified.",
|
||||
"QCOperation_CannotModifyPDStatus": "This visit status is return back. Modification of PD Confirmation status is not allowed.",
|
||||
"QCOperation_ForwardingFailed": "Failed to forward the image:",
|
||||
//QCQuestionService
|
||||
"QCQuestion_DuplicateIndexFailed": "Operation failed because the serial number is repeated.",
|
||||
"QCQuestion_HasChildQuestion": "The current task has a sub-question. Deletion failed.",
|
||||
//TrialQCQuestionService
|
||||
"TrialQCQuestion_TemplateConfirmed": "Image QC question template has been confirmed. No operation is allowed.",
|
||||
"TrialQCQuestion_DuplicateIndexFailed": "Operation failed because the serial number is repeated.",
|
||||
"TrialQCQuestion_DeleteChildFirst": "Before deleting the parent question, delete the child question that references the parent question.",
|
||||
"TrialQCQuestion_ReferencedByQCProcess": "This review question has been cited by the image QC. Deletion is not allowed.",
|
||||
|
||||
// ------------------------------------------------------------QC--------------------------------------------------------------------
|
||||
|
||||
// ------------------------------------------------------------SiteSurvey--------------------------------------------------------------------
|
||||
//TrialSiteEquipmentSurveyService
|
||||
"TrialSiteEquipment_Locked": "Locked and operation is not allowed.",
|
||||
//TrialSiteSurveyService
|
||||
"TrialSiteSurvey_InvalidEmail": "Please enter the correct email address.",
|
||||
"TrialSiteSurvey_WrongVerificationCode": "The verification code is incorrect.",
|
||||
"TrialSiteSurvey_ExpiredVerificationCode": "The verification code has expired.",
|
||||
"TrialSiteSurvey_NoRecordToUpdate": "The site does not have a site survey record for the transferor , so it is not allowed to choose to update.",
|
||||
"TrialSiteSurvey_RecordUnderReview": "Your site survey record is in review and cannot be updated. If you need to update, please do so after rejection.",
|
||||
"TrialSiteSurvey_LockedByCurrentUser": "In the current site, the submitted survey record has been locked. Updation of other people's email survey records is not allowed.",
|
||||
"TrialSiteSurvey_LockedByOtherUsers": "The submitted survey record of the current site has been locked. Currently, the survey record submitted by other personnel is not locked. Updation of the survey submitted before is not allowed.",
|
||||
"TrialSiteSurvey_UnlockedRecordsExist": "The current site has unlocked survey records. Locked survey records cannot be updated.",
|
||||
"TrialSiteSurvey_NonLatestLockedRecord": "The site survey corresponding to the mailbox {0} is not the latest. Updation is not allowed",
|
||||
"TrialSiteSurvey_AlreadyFilledByOtherUsers": "There are already survey filled out by other users under this site. You are not allowed to fill them out",
|
||||
"TrialSiteSurvey_Locked": "The site survey has been locked, and no operation is allowed.",
|
||||
"TrialSiteSurvey_IRCNotification": "[from Extensive Imaging IRC] A reminder about the site survey approval.",
|
||||
"TrialSiteSurvey_CancelUnsubmittedRecord": "Only unsubmitted records are allowed to be repealed.",
|
||||
"TrialSiteSurvey_NoAdminAcces": "The operation is not allowed by the administrator.",
|
||||
"TrialSiteSurvey_FailedToGenerateAccountId": "If no value is obtained for the generated account Id. Please check.",
|
||||
"TrialSiteSurvey_IRCInvitation": "[from Extensive Imaging IRC][{0}] Invitation letter",
|
||||
"TrialSiteSurvey_IRCInvitationContent": "Hello, as the IRC supplier of experiment plan No. {0} trial, Extensive Imaging sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.",
|
||||
"TrialSiteSurvey_ViewAndConfirm": "Check and confirm",
|
||||
//TrialSiteUserSurveyService
|
||||
"TrialSiteUser_Locked": "Locked and not allowed to operate.",
|
||||
"TrialSiteUser_InconsistentInfo": "The corresponding user of this email address is {0}, and the phone number is {1}. Please modify the inputted information and make it consistent with that already in the system, and then save.",
|
||||
"TrialSiteUser_NoTestUserForFormal": "Formal and training triala are not allowed to add test users.",
|
||||
"TrialSiteUser_NoFormalUserForTest": "It is the test project that regular users are not allowed in.",
|
||||
|
||||
// ------------------------------------------------------------Stat--------------------------------------------------------------------
|
||||
|
||||
// ------------------------------------------------------------TrialSiteUser--------------------------------------------------------------------
|
||||
//TrialConfigService
|
||||
"TrialConfig_JudgeTaskFail": "There are adjudication questions that the conditions for generating adjudication review read are not configured. Operation failed!",
|
||||
"TrialConfig_StdConfigMissing": "Questions are not configured under the current criterion.",
|
||||
"TrialConfig_AddEvalReq": "Selected additional assessment, must check additional assessment type",
|
||||
"TrialConfig_SignTemplateMissing": "This operation requires electronic signature confirmation, but the signature template for this scenario is not found in the system.",
|
||||
"TrialConfig_ProjectEnded": "The trial has ended or stopped. Configuration changes are not allowed.",
|
||||
"TrialConfig_NoImageAuditQuestion": "No image QC question is currently added. Please add the image QC questions first, and then confirm.",
|
||||
"TrialConfig_DuplicateAuditQuestionId": "Image QC question display number cannot be repeated.",
|
||||
"TrialConfig_InvalidParentQuestionId": "Make sure that the display sequence number of the parent question is smaller than that of the child.",
|
||||
"TrialConfig_AuditQuestionConfirmed": "The image QC questions have been confirmed by other personnel. Cofirmation again is not allowed. ",
|
||||
"TrialConfig_ProjectNotInitialized": "The current trial status is not initialized. This operation is not allowed.",
|
||||
"TrialConfig_UnconfirmedConfiguration": "This trial’s project configuration, & visit management have not been finished, and its status cannot be changed to “Ongoing”.",
|
||||
"TrialConfig_UnconfirmedUNACKD": "This trial’s project configuration, & visit management have not been all confirmed, and its status cannot be changed",
|
||||
"TrialConfig_ProjectNotStarted": "This trial status is not “Ongoing”, and cannot be set to Stoped or Completed.",
|
||||
//TrialExternalUserService
|
||||
"TrialExternalUser_Inconsistency": "The corresponding user of this email address is {0}, and the phone number is {1}. Please modify the inputted information and make it consistent with that already in the system, and then save.",
|
||||
"TrialExternalUser_EmailTypeDuplicate": "Please confirm that the system already has an account with the same email address and user type as the one entered in the list.",
|
||||
"TrialExternalUser_TestUserNotAllowed": "Formal and training trials are not allowed to add test users.",
|
||||
"TrialExternalUser_FormalUserNotAllowed": "It is a training trial that regular users are not allowed in.",
|
||||
"TrialExternalUser_NotEditable": "Staff information cannot be edited. Please delete it and add it again.",
|
||||
"TrialExternalUser_CannotDelete": "The current user has participated in the trial and cannot be deleted.",
|
||||
"TrialExternalUser_IRCInvitation": "Hello, as the IRC supplier of experiment plan No. {0} trial, Extensive Imaging sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.",
|
||||
"TrialExternalUser_ViewAndConfirm": "Check and confirm",
|
||||
"TrialExternalUser_InvitationExpired": "The invitation time has expired. You can only confirm it after you are invited again.",
|
||||
"TrialExternalUser_AccountInfo": "[from Extensive Imaging IRC][{0}] account information",
|
||||
"TrialExternalUser_Welcome": "Hello, welcome to participate in the relevant work of trial scheme No. {0}IRC of the project. This trial adopts electronic workflow. The system and your account information are as follows:",
|
||||
"TrialExternalUser_ProjectNumber": "Trial ID: {0}",
|
||||
"TrialExternalUser_ExperimentPlanNumber": "Protocol ID: {0}",
|
||||
"TrialExternalUser_ExperimentName": "Study Name: {0}",
|
||||
"TrialExternalUser_Username": "User name: {0}",
|
||||
"TrialExternalUser_Password": "Password: {0}(Please modify it after login): ***(You already have your account. If you forget your password, please find it by email)",
|
||||
"TrialExternalUser_Role": "User role: {0}",
|
||||
"TrialExternalUser_LoginUrl": "System login address: {0} ",
|
||||
"TrialExternalUser_ReinvitationRequired": "The invitation time has expired. You can only confirm it after you are invited again.",
|
||||
"TrialExternalUser_UserIdStorageProblem": "There is a problem with the system user Id storage of the survey table. ",
|
||||
"TrialExternalUser_IRCAccountInfo": "[from Extensive Imaging IRC][{0}] account information",
|
||||
//TrialMaintenanceService
|
||||
"TrialMaint_PersonnelJoined": "Participant has participated in site maintenance",
|
||||
//TrialService
|
||||
"Trial_PMApmPermission": "Only PM/APM has the operation permission!",
|
||||
"Trial_TestUserCreateOnlyNonFormal": "Test users can only create informal projects",
|
||||
"Trial_DuplicateProjectNumber": "The same project ID already exists.",
|
||||
"Trial_InvalidProjectStatus": "Operations are allowed only when the project state is: initializing or ongoing.",
|
||||
"Trial_CannotDeleteProject": "Deleting project data is not allowed in the current running environment.",
|
||||
//TrialSiteService
|
||||
"TrialSite_ParticipantJoined": "The subjects has been added to this site, and couldn't be disable.",
|
||||
"TrialSite_CodeDuplicate": "Code is not allowed to be repeated",
|
||||
"TrialSite_CannotDeleteAssociatedCRC": "The site has been associated with CRC, and couldn't be deleted.",
|
||||
"TrialSite_CannotDeleteAssociatedSubject": "The subjects has been added, and couldn't be deleted.",
|
||||
"TrialSite_CannotDeleteUploadedData": "The site has been uploaded survey, and couldn't be deleted.",
|
||||
|
||||
// ------------------------------------------------------------Visit--------------------------------------------------------------------
|
||||
//SubjectService
|
||||
"Subject_NoConfirmedPlan": "The visit plan of the trial is not confirmed. Please contact PM to confirm the visit plan before adding subjects.",
|
||||
"Subject_DuplicateSubjectNum": "Subjects with the relevant subject ID already exists.",
|
||||
"Subject_UploadedVisitNoDelete": "The subject has visit that has uploaded the image. Deletion is not allowed.",
|
||||
//SubjectVisitService
|
||||
"Visit_DuplicateVisitNo": "The subject's visit schedule already includes a visit with the same visit ID.",
|
||||
"Visit_LastVisitNoChange": "The subject has already had a visit set as the last, and the current visit cannot be set as the last visit.",
|
||||
"Visit_DuplicateVisitName": "The subject's visit schedule already includes a visit with the same visit name.",
|
||||
"Visit_NoExtraVisitAfterLast": "Unplanned visits cannot be added after the last assessment is set.",
|
||||
"Visit_FinishedTasksNoAdd": "The subject has reads completed in follow-up visit ( chronological read ) , which is not allowed to be added here. If necessary, please return.",
|
||||
"Visit_NoPDStatusChangeAfterSubmission": "The PD Confirmation status cannot be modified after the current visit image is submitted.",
|
||||
"Visit_UploadedNoLost": "The current visit has already uploaded images and cannot be set as visit lost to follow-up.",
|
||||
"Visit_UploadedNoDelete": "The current visit has already uploaded images and deletion is not allowed.",
|
||||
"Visit_PlanVisitNoDelete": "Planned visits are not allowed to be deleted.",
|
||||
"Visit_PreviousVisitNoDelete": "The current visit has been set to the previous visit of another visit and cannot be deleted.",
|
||||
//VisitPlanService
|
||||
"VisitPlan_OnlyInitOrOngoing": "Can be operated only when the trial state is: Initialized or ongoing.",
|
||||
"VisitPlan_LargerVisitNumLargerInterval": "In the visit plan, the interval between visits with a large number should also be larger than that of a visit with a smaller number.",
|
||||
"VisitPlan_LargerPlanNumLargerInterval": "In the visit plan, the planned visit with a large number should also have a larger interval than the planned visit with a smaller event number.",
|
||||
"VisitPlan_ExistNameOrNumTemplate": "A plan visit template with visit name or visit ID of trial already exists in the visit plan.",
|
||||
"VisitPlan_ExistBaseline": "A baseline already exists in the visit plan.",
|
||||
"VisitPlan_ExistBaselineImgNoModify": "The subjects’ baseline image data has been uploaded, so modification of baseline visits is not allowed.",
|
||||
"VisitPlan_OnlyInitOrOngoingModifyConfirm": "Modification confirmation is allowed only when the trial is initialized or ongoing.",
|
||||
"VisitPlan_NoBaselineNotConfirm": "No baseline, no confirmation allowed.",
|
||||
"VisitPlan_ConfigNotConfirmNotConfirm": "If the trial configuration is not confirmed, the visit plan cannot be confirmed.",
|
||||
"VisitPlan_BaselineNotMinDayNotConfirm": "Baseline's VisitDay is not minimal. Confirmation is not allowed.",
|
||||
"VisitPlan_CheckExport": "Study export _{0}.xlsx",
|
||||
"VisitPlan_Assigned": "The visit plan has been assigned to the subjects and executed.",
|
||||
|
||||
// ------------------------------------------------------------WorkLoad--------------------------------------------------------------------
|
||||
//DoctorWorkloadService
|
||||
"DoctorWorkload_AssignType": "A task has been assigned and does not allow you to reduce the reading type.",
|
||||
"DoctorWorkload_Unique": "This type of data can only have one",
|
||||
"DoctorWorkload_FeeSettled": "Expenses have been settled and workload cannot be modified.",
|
||||
//EnrollService
|
||||
"Enroll_NotFound": "Cannot find trial {0}",
|
||||
"Enroll_EmailFormat": "The {0} mailbox format is faulty.",
|
||||
"Enroll_CannotRollback": "Reviewers with workload cannot go back",
|
||||
|
||||
// ------------------------------------------------------------Triggers--------------------------------------------------------------------
|
||||
//AddlTrialUserTrigger
|
||||
"AddlTrialUser_NoTestUser": "Formal and training trials are not allowed to be added test users.",
|
||||
"AddlTrialUser_NoFormalUser": "It is a training trial that regular users are not allowed in.",
|
||||
//SubjectStateTrigger
|
||||
"SubjectState_CannotSetCurrentAsLastVisit": "The subject has already had a visit set as the last, and the current visit cannot be set as the last.",
|
||||
"SubjectState_CannotSetAsLastVisitWithImage": "The image of the subject's visit after the current visit has been uploaded, and the current visit is not allowed to be set as the last visit.",
|
||||
//SubjectVisitFinalVisitTrigger
|
||||
"SubjectVisit_CannotSetAsLastVisit": "The subject's follow-up visits has uploaded images or submitted , and the current visit is not allowed to be set as the last visit.",
|
||||
|
||||
// ------------------------------------------------------------BusinessFilter--------------------------------------------------------------------
|
||||
//LimitUserRequestAuthorization
|
||||
"LimitUser_AuthTokenMissing": "User token was not retrieved from Header/URL, please contact developer",
|
||||
"LimitUser_AccountLoggedInElsewhere": "User token was not retrieved from Header/URL, please contact developer",
|
||||
//ModelActionFilter
|
||||
"ModelAction_InvalidAPIParameter": "Invalid parameters provided for the API.",
|
||||
//ProjectExceptionFilter
|
||||
"ProjectException_ConcurrentUpdateNotAllowed": "Concurrent update, operation not allowed at this time.",
|
||||
"Project_ExceptionContactDeveloper": "Program exception, please contact developer.",
|
||||
//TrialResourceFilter
|
||||
"TrialResource_NoAccessPermission": "Sorry, your account does not have operation permissions.",
|
||||
"TrialResource_ReferTrialIdFailed": "Regular expression failed to fetch trialId from request Refer, please contact developer to check",
|
||||
"TrialResource_InterceptedProjectStatusRule": "This request was blocked by configured rules: only operations allowed when project status is in progress, please contact developer if this logic is incorrect and needs to be modified",
|
||||
"TrialResource_MissingProjectNumber": "Project number not passed in the API parameters, please verify.",
|
||||
//UnifiedApiResultFilter
|
||||
"UnifiedAPI_ProgramError": "Program error, please contact developer.",
|
||||
|
||||
// ------------------------------------------------------------Helper--------------------------------------------------------------------
|
||||
//FileStoreHelper
|
||||
"FileStore_TemplateFileNotFound": "Database did not find the corresponding data template file for FileStoreHelper, please contact system maintenance personnel.",
|
||||
"FileStore_TemplateFileStoragePathInvalid": "File doesn’t exist. Please contact the system administrator!",
|
||||
//SendEmailHelper
|
||||
"SendEmail_SendFail": "Failed to send email in SendEmailHelper. Your operation was unsuccessful, please check your email or contact maintenance personnel.",
|
||||
"SendEmail_NoRecipient": "No recipient in SendEmailHelper.",
|
||||
|
||||
// ------------------------------------------------------------IRaCIS.Core.Domain--------------------------------------------------------------------
|
||||
//Trial
|
||||
"Trial_number": "Subject ID is composed of 5 digits. The first 2 are the Site ID, and the following 3 are the order number. Please ensure it is identical to the ID from the EDC system. ",
|
||||
|
||||
// ------------------------------------------------------------IRaCIS.Core.Infrastructure--------------------------------------------------------------------
|
||||
//ResponseOutput
|
||||
"RO_BizObjNotExistsOrParamIncorrect": "The business object{0} does not exist in the database, or was deleted by someone else, or an incorrect parameter query caused",
|
||||
"RO_ExpectChangeButNoEffect": "Expect a change, but the database data has not changed",
|
||||
"RO_SaveFailed": "Saved failed"
|
||||
|
||||
}
|
||||
|
||||
@@ -1,593 +1,2 @@
|
||||
{
|
||||
"test{0}{1}": "中文本地化{0}{1}",
|
||||
"RequiredAttribute": "{0} 字段是必须的",
|
||||
|
||||
// ------------------------------------------------------------_ServiceExtensions--------------------------------------------------------------------
|
||||
//ApiResponseHandler
|
||||
"ApiResponse_NoAccess": "您无权访问该接口",
|
||||
"ApiResponse_Permission": "您的权限不允许进行该操作",
|
||||
|
||||
// ------------------------------------------------------------Controllers--------------------------------------------------------------------
|
||||
//FinancialChangeController
|
||||
"Financial_ChargeSettled": "费用已经结算,无法重置工作量",
|
||||
"Financial_InvalidParameter": "无效的参数。",
|
||||
//UploadDownLoadController
|
||||
"UploadDownLoad_UnsupportedMedia": "不支持的MediaType",
|
||||
"UploadDownLoad_ArchiveInProgress": "当前已有人正在上传和归档该检查!",
|
||||
"UploadDownLoad_InvalidData": "请保证上传数据符合模板文件中的样式,且存在有效数据。",
|
||||
"UploadDownLoad_RequestError": "请求异常,请重试!",
|
||||
"UploadDownLoad_SupportedFormats": "支持.xlsx、.xls、.csv格式的文件上传。",
|
||||
|
||||
// ------------------------------------------------------------_MediatR--------------------------------------------------------------------
|
||||
//ConsistencyVerificationRequest
|
||||
"ConsistencyVerification_Tech": "检查技术",
|
||||
"ConsistencyVerification_Time": "时间格式不对",
|
||||
//ConsistencyVerificationHandler
|
||||
"ConsistencyVerification_Img": "您好,根据本系统自动识别,该受试者当前访视在IRC系统中已提交的影像检查情况如下:",
|
||||
"ConsistencyVerification_Of": "的",
|
||||
"ConsistencyVerification_ImgC": "影像检查",
|
||||
"ConsistencyVerification_EDCA": "核对EDC数据,完全一致, 审核通过",
|
||||
"ConsistencyVerification_EDCB": "核对EDC数据,完全一致",
|
||||
"ConsistencyVerification_Auto": "自动核查通过",
|
||||
"ConsistencyVerification_Prob": "存在问题如下:",
|
||||
"ConsistencyVerification_EdcL": "影像检查(EDC 缺少)",
|
||||
"ConsistencyVerification_IrcL": "影像检查(IRC 缺少)",
|
||||
"ConsistencyVerification_Desc": "说明:为高效解决/处理以上全部质疑问题,麻烦您准确核实实际影像检查情况。请注意影像日期与实际检查的日期可能会不一致,部分检查(如PET -CT)可能同时存在多种模态影像。准确核实后,请回复该访视正确的影像检查情况。",
|
||||
"ConsistencyVerification_Conf": "根据导入的一致性核查数据,请确认本访视以下不一致检查项信息:",
|
||||
"ConsistencyVerification_Edc": "EDC 缺少:",
|
||||
"ConsistencyVerification_IrcLi": "IRC 缺少:",
|
||||
|
||||
// ------------------------------------------------------------Reading--------------------------------------------------------------------
|
||||
//ClinicalDataSetService
|
||||
"ClinicalDataSet_Apply": "当前临床数据需要配置一个检查日期才能应用",
|
||||
"ClinicalDataSet_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||
//ClinicalQuestionService
|
||||
"ClinicalQuestion_Repeat": "存在相同的问题名称!",
|
||||
//ReadingClinicalDataService
|
||||
"ReadingClinicalData_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||
"ReadingClinicalData_Unchecked": "当前临床数据状态不是已核查状态,不允许签名!",
|
||||
//ReadingGlobalTaskService
|
||||
"ReadingGlobal_NotGlobal": "系统调用错误,当前任务不是全局阅片任务。",
|
||||
//ReadingImageTaskService
|
||||
"ReadingImage_NotVisit": "系统调用错误,当前任务不是访视任务。",
|
||||
"ReadingImage_CantSplit": "当前任务是基线任务,不能执行分裂病灶的操作。",
|
||||
"ReadingImage_BeSigned": "当前任务已经签名,请勿重复提交。",
|
||||
"ReadingImage_Beinvalid": "当前任务已失效,不能执行阅片。",
|
||||
"ReadingImage_PresenceReview": "当前受试者存在重阅申请还未处理,不允许操作",
|
||||
"ReadingImage_NotaTask": "合并的病灶并非同一个访视任务",
|
||||
"ReadingImage_DeleteError": "当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败。",
|
||||
"ReadingImage_Idnotcorrespond": "病灶标记添加失败,影像的Instance ID和Series ID不对应。",
|
||||
"ReadingImage_IsLymphNotbigger": "当前访视该淋巴结非靶病灶的短径小于上一访视的值,不能设置为显著增大。",
|
||||
"ReadingImage_NotLymphNotbigger": "当前访视该非淋巴结非靶病灶的长径小于上一访视的值,不能设置为显著增大。",
|
||||
"ReadingImage_Twice": "系统调用错误,提交的问题及答案重复。",
|
||||
"ReadingImage_MaxQuestion": "按照《独立影像评估章程》的相关规则,当前{0}的病灶数量不能超过{1}个。",
|
||||
"ReadingImage_Maxlesion": "按照《独立影像评估章程》的相关规则,同一器官的靶病灶数量不能超过{0}个,请确认",
|
||||
"ReadingImage_Maximum": "{0}的重复次数限制为{1},目前已重复{2}次。",
|
||||
"ReadingImage_PCWGMaximum": "按照《独立影像评估章程》的相关规则,同一部位的基线病灶只需录入{0}次,请确认。",
|
||||
"ReadingImage_NotNewFocus": "转换后的任务不应该存在新病灶",
|
||||
"ReadingImage_RequiredQuestion": "提交前,请完成{0}",
|
||||
"ReadingImage_ClinicalRead": "临床数据未阅读,请确认!",
|
||||
"ReadingImage_IDMust": "系统调用失败,当没有任务ID的时候,标准ID必传。",
|
||||
"ReadingImage_TaskFinish": "当前受试者所有阅片任务已完成,请知悉。",
|
||||
"ReadingImage_NeedRest": "您已连续阅片{0}个小时,请休息{1}分钟后,再继续阅片。",
|
||||
//ReadingJudgeTaskService
|
||||
"ReadingJudge_SouceIdNull": "系统调用失败,当前裁判的全局任务的SouceId为null。",
|
||||
//ReadingOncologyTaskService
|
||||
"ReadingOncology_TaskError": "系统调用错误,当前任务不是肿瘤学任务。",
|
||||
"ReadingOncology_Abnormal": "系统调用异常,裁判结果为null。",
|
||||
//ReadingCalculate
|
||||
"ReadingCalculate_Abnormal": "PCWG3标准配置错误,数据验证失败。",
|
||||
"ReadingCalculate_questionable": "病灶存在以下问题:",
|
||||
"ReadingCalculate_NoMarker": "病灶{0}缺少标记",
|
||||
"ReadingCalculate_StatusIsEmpty": "病灶{0}状态为空",
|
||||
"ReadingCalculate_NoMarkerEmpty": "病灶{0}未做标记,且状态为空",
|
||||
"ReadingCalculate_NoDeveloped": "当前标准自动计算未完成开发,请知悉。",
|
||||
//ReadingMedicalReviewService
|
||||
"MedicalReview_invalid": "该医学审核任务已失效,操作失败。",
|
||||
"MedicalReview_SaveQuestion": "无法执行当前操作,请先保存医学审核问题。",
|
||||
"MedicalReview_NeedSave": "无法执行当前操作,请先保存医学审核问题和结论。",
|
||||
"MedicalReview_NotClosed": "无法执行当前操作,当前医学质询对话未关闭。",
|
||||
"MedicalReview_Finish": "当前医学审核任务为最后一个任务。",
|
||||
//ReadingMedicineQuestionService
|
||||
"ReadingMed_QNumDup": "当前问题序号存在重复",
|
||||
"ReadingMed_HasSubQ": "此问题存在子问题,请先删除子问题",
|
||||
"ReadingMed_NoMedQ": "当前未添加医学审核问题。请先添加医学审核问题,再进行确认。",
|
||||
"ReadingMed_MedQNumDup": "影像医学审核问题显示序号不能重复。",
|
||||
"ReadingMed_ParentNumSmall": "父问题的显示序号要比子问题的显示序号小,请确认。",
|
||||
"ReadingMed_VisitQNotConfig": "当前标准未配置访视医学审核问题。",
|
||||
"ReadingMed_GlobalQNotConfig": "当前标准启用了全局阅片,但未配置全局医学审核问题",
|
||||
"ReadingMed_ArbitrateQNotConfig": "当前标准启用了仲裁阅片,但未配置仲裁医学审核问题",
|
||||
"ReadingMed_TumorQNotConfig": "当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题",
|
||||
//UserService
|
||||
"User_CheckNameOrPw": "请检查用户名或者密码。",
|
||||
//Repository
|
||||
"Repository_UpdateError": "修改的数据在数据库不存在。",
|
||||
"Repository_DeleteError": "删除的数据在数据库不存在。",
|
||||
//OrganInfoService
|
||||
"OrganInfo_DuplicateData": "存在相同的数据,操作失败",
|
||||
//ReadingCriterionService
|
||||
"ReadingCriterion_Referenced": "当前标准被引用过了,不可以删除",
|
||||
"ReadingCriterion_InUse": "此标准在项目里面已被使用,操作失败",
|
||||
"ReadingCriterion_ArbitratorWithoutJudgment": "无裁判问题却有仲裁对象,操作失败",
|
||||
//ReadingQuestionService
|
||||
"ReadingQuestion_IdDup": "问题编号重复",
|
||||
"ReadingQuestion_ChildrenExist": "此问题存在子问题,请先删除子问题",
|
||||
"ReadingQuestion_GroupReferenced": "此分组已被引用,请先删除被引用的问题",
|
||||
"ReadingQuestion_JudgmentSet": "当前问题已经设置了裁判标准了,修改失败",
|
||||
"ReadingQuestion_ExcludeWithDependency": "显示依赖父问题和必填依赖的问题为同一个,但答案互斥,操作失败",
|
||||
"ReadingQuestion_CircularDependency": "计算依赖循环了!",
|
||||
//ReadingPeriodSetService
|
||||
"ReadingPeriodSet_NameDup": "阅片期名称重复,操作失败",
|
||||
"ReadingPeriodSet_Global": "阅片期名称不能为Global",
|
||||
"ReadingPeriodSet_AlreadyAdded": "{0}已经添加过阅片期,无法设置生效",
|
||||
"ReadingPeriodSet_TaskCompletedCannotRevoke": "当前标准阅片已生成任务并且阅片完成,撤销失败。",
|
||||
"ReadingPeriodSet_LastVisit": "末次访视",
|
||||
//ReadModuleService
|
||||
"ReadModule_AlreadyAdded": "当前访视已经添加过阅片期",
|
||||
"ReadModule_AddGlobalFirst": "请先添加全局阅片",
|
||||
"ReadModule_VisitNotFound": "未找到符合要求的访视",
|
||||
"ReadModule_SignedDataCannotDelete": "临床资料已签名,不允许删除",
|
||||
"ReadModule_TumorExists": "当前访视存在肿瘤学阅片,请先删除肿瘤学阅片",
|
||||
"ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。",
|
||||
//UserWLTemplateService
|
||||
"UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板",
|
||||
"UserWLTS_NameRepeated": "模板名称存在重复",
|
||||
"UserWLTS_ContentRepeated": "模板内容存在重复",
|
||||
|
||||
// ------------------------------------------------------------Allocation--------------------------------------------------------------------
|
||||
//TaskAllocationRuleService
|
||||
"TaskAllocation_DoctorIdNotFound": "错误,未在入组表中找到该医生的账号Id",
|
||||
"TaskAllocation_DoctorConfigExists": "已有该医生配置,不允许继续增加",
|
||||
"TaskAllocation_TaskAssigned": "已分配任务给该医生,不允许删除",
|
||||
//TaskConsistentRuleService
|
||||
"TaskConsistent_ConsistencyConfigExists": "请配置一致性分析的医生",
|
||||
"TaskConsistent_TaskGenerated": "已有该项目配置,不允许继续增加",
|
||||
"TaskConsistent_MedicalAuditTaskExists": "该标准已有Subject 生成了任务,不允许修改配置",
|
||||
"TaskConsistent_SignedTaskCannotBeInvalidated": "该标准已产生一致性分析任务,不允许删除",
|
||||
//TaskMedicalReviewRuleService
|
||||
"TaskMedicalRule_TaskAlreadyAssigned": "已有该医生配置,不允许继续增加",
|
||||
"TaskMedicalRule_TaskStarted": "已产生医学审核任务",
|
||||
//TaskMedicalReviewService
|
||||
"TaskMedical_DirtyData": "已签名的不允许设置为失效",
|
||||
"TaskMedical_SubjectInOtherArm": "当前有任务已分配给其他人,不允许分配,请刷新列表",
|
||||
//VisitTaskService
|
||||
"VisitTask_VisitTask_TaskAlreadyApplied": "该项目还未确认任何一个阅片标准",
|
||||
"VisitTask_DoctorConfigNotFound": "当前医生已开始做该Subject 该标准的任务,不允许取消分配",
|
||||
"VisitTask_BackendDataError": "其中一个任务已分配给该医生,不允许分配",
|
||||
"VisitTask_DirtyData": "出现脏数据 任务来源字段没有值",
|
||||
"VisitTask_MissingTaskSource": "该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配",
|
||||
"VisitTask_InconsistentSubjectStatus": "有Subject 在其他Arm组已有该医生,不允许在新的组添加该医生",
|
||||
"VisitTask_DuplicateDoctorInArm": "有Subject 已有该Arm组的医生,不允许继续分配,请刷新页面,确认页面数据是否过期",
|
||||
"VisitTask_DoctorAlreadyInArm": "有Subject任务已应用,不允许取消分配",
|
||||
"VisitTask_TaskAlreadyApplied": "在配置表中未找到配置的医生,无法应用绑定,请核对数据",
|
||||
"VisitTask_DoctorConfiguration": "后台数据有错误",
|
||||
"VisitTask_BackendData": "未阅片完成,或者未生效的任务不允许申请重阅",
|
||||
"VisitTask_UnreadTask": "重阅已申请,或者重阅已同意状态下不允许申请重阅",
|
||||
"VisitTask_NoPMRecheck": "附加评估标准任务不允许PM 申请影像重阅",
|
||||
"VisitTask_Reapply": "PM 不允许对一致性分析任务进行申请重阅",
|
||||
"VisitTask_ConsistencyAnalysis": "PM 仅仅允许对访视类型的任务申请重阅",
|
||||
"VisitTask_VisitTypeRestriction": "当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅",
|
||||
"VisitTask_SequentialReading": "当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅",
|
||||
"VisitTask_ImageProblem": "当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅",
|
||||
"VisitTask_LastReading": "有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅",
|
||||
"VisitTask_LastOncologistRecheck": "有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅",
|
||||
"VisitTask_LastAdjudicatorRecheck": "有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅",
|
||||
"VisitTask_IRGlobalRecheck": "无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅",
|
||||
"VisitTask_IRReapply": "无序阅片,仅仅允许IR申请全局和访视类型类别的任务进行重阅",
|
||||
"VisitTask_InvalidReapplyStatus": "当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面",
|
||||
"VisitTask_ReapplyStatusConflict": "当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作",
|
||||
"VisitTask_ReReadTaskNotApplied": "仅允许同意访视类型的任务重阅",
|
||||
"VisitTask_ReReadTaskAlreadyAffected": "不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批 ",
|
||||
"VisitTask_TaskTypeNotApproved": "当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面",
|
||||
"VisitTask_NoImageReturn": "附加评估标准任务不允许在此入口影像退回",
|
||||
"VisitTask_NonEffectiveTaskCannotBeReturned": "仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据",
|
||||
"VisitTask_NoFurtherReturn": "当前访视已回退到影像上传,不允许继续回退!",
|
||||
"VisitTask_ConsistencyTaskCannotBeReturned": "一致性分析的任务,不允许设置退回",
|
||||
"VisitTask_PMOnlyAllowedForReturn": "仅PM 可以进行回退操作",
|
||||
"VisitTask_UnsupportedTaskType": "不支持重阅的任务类型",
|
||||
"VisitTask_UndefinedList": "当前用户查看列表未定义",
|
||||
"VisitTask_NoConsistencyReturn": "不允许退回一致性分析任务",
|
||||
"VisitTask_VisitTypeTaskAllowedForPMOnly": "仅仅访视类型的任务支持PM退回",
|
||||
|
||||
// ------------------------------------------------------------Common--------------------------------------------------------------------
|
||||
//CommonDocumentService
|
||||
"Document_CodeDuplication": "文档的Code不能够重复。",
|
||||
"Document_SingleTemplate": "一个场景一个标准只允许有一个模板文档",
|
||||
"Document_ TemplateRead": "读取模板内容失败, 请将文件另存为docx格式尝试!",
|
||||
//DictionaryService
|
||||
"Dictionary_DictionaryName": "已有{0}名称的字典",
|
||||
"Dictionary_DictionaryDeletion": "当前字典在标准中被引用,不允许删除!",
|
||||
"Dictionary_SubitemDeletion": "有子项数据,不允许直接删除!",
|
||||
"Dictionary_ResumeReference": "当前条目已经在阅片人的简历中被引用。",
|
||||
"Dictionary_ProjectReference": "当前条目已经在项目信息中被引用。",
|
||||
"Dictionary_StandardReference": "当前条目已经在阅片标准中被引用。",
|
||||
//ExcelExportService
|
||||
"ExcelExport_UnsupportedExport": "当前标准导出还未支持",
|
||||
//MailService
|
||||
"Mail_EmailResetReminder": "[来自展影IRC] 关于重置邮箱的提醒",
|
||||
"Mail_Dear": " 尊敬的 {0} , ",
|
||||
"Mail_ResettingEmail": "您正在进行邮箱重置操作",
|
||||
"Mail_IRCResettingPassword ": "[来自展影IRC] 关于重置密码的提醒",
|
||||
"Mail_ResettingPassword ": "您正在进行邮箱重置密码操作",
|
||||
"Mail_ImagingIRCReminder": "[来自展影IRC]的提醒",
|
||||
"Mail_IRCProject": "您正在参与展影医疗IRC项目",
|
||||
"Mail_ProjectParticipationReminder": "[来自展影IRC] [{0}] 关于中心调研的提醒",
|
||||
"Mail_CenterResearchReminder": "您正在参与展影医疗IRC项目中心调研工作",
|
||||
"Mail_AccountCreationReminder": "[来自展影IRC] 关于创建账户的提醒",
|
||||
"Mail_AccountPasswordResetReminder": "[来自展影IRC] 关于重置账户密码的提醒",
|
||||
"Mail_InvitationEmail": "[来自展影IRC] [{0}]邀请信",
|
||||
//SystemMonitor
|
||||
"SysMon_JsonConfig": "解析Json文件配置出现问题",
|
||||
|
||||
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
|
||||
//DoctorService
|
||||
"Doctor_DupPhoneOrEmail": "当前的电话或电子邮件号码已经存在",
|
||||
"Doctor_DupPhone": "当前的电话号码已经存在!",
|
||||
"Doctor_DupEmail": "当前的邮箱已经存在!",
|
||||
"Doctor_StandardDuplicateFileTypeError": "当前标准已添加过此类型文件",
|
||||
"Doctor_RequiredDocumentsError": "简历及顾问协议必须上传",
|
||||
|
||||
// ------------------------------------------------------------Document--------------------------------------------------------------------
|
||||
//SystemDocumentService
|
||||
"SystemD_DuplicateFile": "系统中已存在同类型的同名文件。",
|
||||
"SystemD_CannotDeleteSignedFile": "已有用户阅读该文档,并签名,不允许删除。",
|
||||
//TrialDocumentService
|
||||
"TrialD_DuplicateFileInProject": "该项目中已经存在同类型的同名文件。",
|
||||
"TrialD_DocumentHasAlready": "已有用户阅读该文档,并签名,不允许删除。",
|
||||
"TrialD_FileAlreadySigned": "该文件已经签名",
|
||||
"TrialD_ObsoleteFile": "文件已废除,签署失败!",
|
||||
//TrialEmailNoticeConfigService
|
||||
"TrialEmailN_TaskNotSigned": "进行邮件发送前,该任务必须已签名完成并已经触发完成相应的任务生成",
|
||||
"TrialEmailN_NoRecipient": "没有收件人,无法发送邮件",
|
||||
"TrialEmailN_InvalidEmailConfig": "项目发件邮箱配置有误,请核实",
|
||||
"TrialEmailN_EmailTemplateNotFound": "找不到该项目标准场景下邮件模板",
|
||||
"TrialEmailN_EnrollmentConfirmation": "【入组确认报告】关于{0}项目{1}受试者",
|
||||
"TrialEmailN_Enrollment": " 附件为入组确认报告,请查收",
|
||||
"TrialEmailN_PDReport": "【疾病进展确认报告】关于{0}项目{1}受试者",
|
||||
"TrialEmailN_SubjectDiseaseProgression": " 附件为疾病进展确认报告,请查收 ",
|
||||
"TrialEmailN_SingleBlindedSet": "单重有序阅片配置有误(不应该有仲裁对象配置),请核查!",
|
||||
"TrialEmailN_SingleBlindedSequenced": "单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查!",
|
||||
"TrialEmailN_PDProgressEmailTask": "发送PD 进展邮件中发现任务数据有问题!",
|
||||
"TrialEmailN_DoubleBlindedError": "双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查!",
|
||||
"TrialEmailN_InCons": "项目未配置入组确认!",
|
||||
"TrialEmailN_NoBaseLine": "不存在配置了入组确认的并且已阅的基线访视",
|
||||
"TrialEmailN_IncompBase": "做入组确认的阅片人基线任务没有阅片完!",
|
||||
"TrialEmailN_EmailFail": "邮件手动生成失败,请联系开发核实该场景失败原因",
|
||||
"TrialEmailN_NoReader": "当前未有阅片人读完基线任务!",
|
||||
"TrialEmailN_NoPDConfig": "项目未配置PD进展!",
|
||||
"TrialEmailN_NoPDTasks": "不存在配置了PD进展的并且已阅的访视",
|
||||
"TrialEmailN_PDNotFinished": "当前受试者最新PD访视阅片任务完成状态不符合发送条件",
|
||||
"TrialEmailN_PDNoImaging": "项目配置了阅片期仲裁,但是当前受试者最新PD访视没有影像学阅片期",
|
||||
"TrialEmailN_PDPhaseNotFinished": "当前受试者最新PD访视阅片期任务完成状态不符合发送条件",
|
||||
"TrialEmailN_NoRuleDefined": "未定义该仲裁规则发送业务逻辑!",
|
||||
"TrialEmailN_NoDoubleOrder": "当前项目配置,不满足双重有序阅片,不满足发送条件!",
|
||||
"TrialEmailN_NoSendLogicDefined": "当前项目配置,未定义发送业务逻辑!",
|
||||
"TrialEmailN_BlindedSequencedReading": "有序阅片配置有误(应为单重或者双重阅片),请核查!",
|
||||
"TrialEmailN_UnblindedSequencedReading": "无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查!",
|
||||
"TrialEmailN_InvalidTaskTypeForEmailSending": "不应有除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑",
|
||||
"TrialEmailN_PDLogicNotDefined": "该标准任务还未定义PD获取逻辑,联系业务和后台开发协商后补充",
|
||||
"TrialEmailN_MailboxWrong": "项目发件邮箱配置有误,请核实",
|
||||
"TrialEmailN_InvalidRecipient": "项目没有有效的收件人,无法发送邮件",
|
||||
"TrialEmailN_EmailTestMessage": "项目邮件测试",
|
||||
"TrialEmailN_ConfigurationCorrect": " 收到此邮件,代表邮件配置正确",
|
||||
"TrialEmailN_InvalidSenderEmailConfig": "发件人配置错误,请核对服务器地址或者授权码是否填写有误",
|
||||
|
||||
// ------------------------------------------------------------Financial--------------------------------------------------------------------
|
||||
//CalculateService
|
||||
"Cal_VolDataErr": "体积数据错误",
|
||||
//ExchangeRateService
|
||||
"ExR_SameMthExist": "同月的汇率已存在",
|
||||
"ExR_MthPymtRate": "按月付款采用汇率",
|
||||
//PaymentAdjustmentService
|
||||
"PayAdj_DocPymtLock": "医生付款已确认锁定",
|
||||
//RankPriceService
|
||||
"RP_TitleUsedByRev": "此标题已被审稿人付款信息所使用",
|
||||
//TrialRevenuesPriceService
|
||||
"TRP_AddMeaningful": "请添加有意义的数据",
|
||||
|
||||
// ------------------------------------------------------------ImageAndDoc--------------------------------------------------------------------
|
||||
//DicomArchiveService
|
||||
"DAS_NoAnonCacheData": "未取到缓存匿名化配置数据,上传停止,请联系开发人员核实",
|
||||
//ImageShareService
|
||||
"ISS_NoImgToShare": "当前检查没有影像可以分享。 ",
|
||||
"ISS_ResNotExists": "资源不存在。",
|
||||
"ISS_SharePwdError": "分享密码错误。",
|
||||
"ISS_ShareExpiration": "资源分享过期。",
|
||||
//StudyService
|
||||
"Study_VisitBeforePrevError": "当前访视检查时间{0}不能早于前序访视检查时间{1},请核对检查数据是否有误",
|
||||
"Study_VisitAfterSubseqError": "当前访视检查时间{0}不能晚于该访视之后的检查时间{1},请核对检查数据是否有误",
|
||||
"Study_UploadArchiving": "当前有人正在上传归档该检查!",
|
||||
"Study_VisitEndedNotAllowed": "受试者访视结束,不允许上传!",
|
||||
"Study_ImgAlreadyUploaded": "此处不可以上传。当前影像检查已经上传给受试者{0}的{1}",
|
||||
|
||||
// ------------------------------------------------------------Inspection--------------------------------------------------------------------
|
||||
//FrontAuditConfigService
|
||||
"FrontAudit_IdDup": "标识重复",
|
||||
"FrontAudit_NameDup": "名称重复",
|
||||
"FrontAudit_CannotDelSub": "存在子类 不能删除",
|
||||
//InspectionService
|
||||
"Inspection_UserDisabled": "当前用户已被禁用。",
|
||||
|
||||
// ------------------------------------------------------------Institution--------------------------------------------------------------------
|
||||
//CROService
|
||||
"CRO_DupName": "已经存在同名的CRO,请确认。",
|
||||
"CRO_InProject": "该CRO已经参与项目,不能被删除。",
|
||||
//HospitalService
|
||||
"Hospital_DupName": "已经存在同名的医院,请确认。",
|
||||
"Hospital_SiteAdded": "当前Site已经添加到其他Hospital了。",
|
||||
"Hospital_HasDoctors": "该医院下已经注册有医生,不可以删除。",
|
||||
//SiteService
|
||||
"Site_DupName": "已经存在同名的中心,请确认。",
|
||||
"Site_InProject": "该中心已经加入项目,不可以被删除。",
|
||||
//SponsorService
|
||||
"Sponsor_DupName": "已经存在同名的申办方,请确认。",
|
||||
"Sponsor_InProject": "该申办方已经加入项目,不允许删除。",
|
||||
|
||||
// ------------------------------------------------------------Management--------------------------------------------------------------------
|
||||
//MenuService
|
||||
"Menu_ParentDupChild": "该父节点下已经存在同名的子节点。",
|
||||
"Menu_ChildExist": "该节点存在子节点,请在删除子节点后,再删除该节点。",
|
||||
//UserService
|
||||
"User_UsernameExist": "用户名已经存在。",
|
||||
"User_PhoneDup": "该用户类型中已存在具有相同的电话的用户。",
|
||||
"User_EmailDup": "该用户类型中已存在具有相同邮箱的用户。",
|
||||
"User_NewOldPwdSame": "新密码与旧密码相同。",
|
||||
"User_OldPwdInvalid": "旧密码验证失败。",
|
||||
"User_LegalEmail": "请输入合法的电子邮件。",
|
||||
"User_VerificationCodeError": "验证码错误。",
|
||||
"User_VerificationCodeExpired": "验证码已经过期。",
|
||||
"User_CreateFailed": "请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功。",
|
||||
"User_InvalidEmail": "请输入一个正确的邮箱。",
|
||||
"User_EmailError": "邮箱错误。",
|
||||
"User_InProject": "该用户已经参加项目,不能够删除。",
|
||||
"User_Disabled": "该用户已经被禁用。",
|
||||
//UserTypeService
|
||||
"UserType_InUse": "该用户类型中已存在用户,不能删除。",
|
||||
|
||||
// ------------------------------------------------------------QC--------------------------------------------------------------------
|
||||
//QCCommon
|
||||
"QCCommon_CannotOperate": "CRC已提交影像,不能进行操作。",
|
||||
"QCCommon_NoPermission": "您不是该质控任务当前领取人,没有操作权限!",
|
||||
"QCCommon_CheckTimeEarly": "当前访视检查时间{0}不能早于前序访视检查时间{1},请核对检查数据是否有误",
|
||||
"QCCommon_CheckTimeLate": "当前访视检查时间{0}不能晚于该访视之后的检查时间{1},请核对检查数据是否有误",
|
||||
//QCOperationService
|
||||
"QCOperation_CheckFirst": "请先核查图像,并保存审核问题,然后再发质疑。",
|
||||
"QCOperation_QuestionExist": "当前访视未关闭的质疑已设置了同意CRC重传影像。请在CRC完成影像重传后,先关闭原质疑,再添加新的质疑。",
|
||||
"QCOperation_QuestionCannotClose": "CRC已申请重传或者QC同意重传,不允许关闭该质疑。请在QC拒绝重传申请或者CRC设置重传影像后,再关闭质疑。",
|
||||
"QCOperation_CloseReason": "关闭原因: ",
|
||||
"QCOperation_QuestionReplied": "当前QC质疑已经回复。",
|
||||
"QCOperation_NoPermissionReply": "您没有权限回复一致性核查对话。",
|
||||
"QCOperation_CannotClose": "当前访视处于申请重传状态, 不允许关闭质疑。",
|
||||
"QCOperation_Reason": "原因:",
|
||||
"QCOperation_CannotPass": "当前访视处于回退状态,不允许设置一致性核查通过",
|
||||
"QCOperation_PassAfterClose": "请先关闭一致性核查质疑后,再设置一致性核查通过。",
|
||||
"QCOperation_Cannotback": "当前访视已通过一致性核查,不允许申请重传",
|
||||
"QCOperation_CRCRollback": "CRC申请重传",
|
||||
"QCOperation_OtherCRC": "其他CRC已申请处理,请刷新页面",
|
||||
"QCOperation_PMReject": "PM/APM拒绝一致性核查回退",
|
||||
"QCOperation_NoPermission": "您不具备操作权限。",
|
||||
"QCOperation_CannotRollback": "当前访视还未进行核查或者核查已通过,不允许设置回退。",
|
||||
"QCOperation_PMAPMConsistency": "PM/APM同意一致性核查回退。",
|
||||
"QCOperation_NoModifyAfterSubmit": "提交之后,不允许修改!",
|
||||
"QCOperation_UnresolvedQCQuery": "当前访视有质疑未关闭,不允许该操作",
|
||||
"QCOperation_CrcNoDelete": "CRC已经提交,不允许删除。",
|
||||
"QCOperation_NoRecipient": "您不是该质控任务当前领取人,没有操作权限!",
|
||||
"QCOperation_QCImageTaskAlreadyReleased": "当前访视的影像质控任务已被原领取人释放。您可以通过“领取”获得",
|
||||
"QCOperation_QCTaskNoAccess": "当前访视的影像质控任务已被其他QC领取,不允许领取",
|
||||
"QCOperation_QCConfigFirst": "请先配置影像质控审核问题,再领取影像质控任务",
|
||||
"QCOperation_NoQC": "项目配置为不审,没有领取QC Task",
|
||||
"QCOperation_InitialAuditPassed": "初审已通过,不能继续领取",
|
||||
"QCOperation_NoSingleAudit": "项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面",
|
||||
"QCOperation_NoSameReviewer": "复审不能和初审是同一个人",
|
||||
"QCOperation_NoSecondaryAudit": "项目配置为复审,不满足提交状态:已提交或者审核状态:待审核/QC中, 不允许领取,请刷新界面",
|
||||
"QCOperation_NoTaskAccess": "您不是该质控任务当前领取人,没有操作权限!",
|
||||
"QCOperation_NoQCFunction": "项目配置影像质控为不审,不需要取消任务功能",
|
||||
"QCOperation_NoTaskOwner": "当前访视影像质控任务没有当前领取人,不能释放。",
|
||||
"QCOperation_DiseaseProgressConfirmation": "当前访视要求进行疾病进展确认。请在提交当前访视前,先处理未提交的前序访视:{0}。",
|
||||
"QCOperation_UnsubmittedVisits": "在提交当前访视后,请尽快处理尚未提交的前序访视:{0}。",
|
||||
"QCOperation_NoBaselineData": "基线没有临床数据,确认提交?",
|
||||
"QCOperation_NoImageData": "有访视未上传任何Dicom/非Dicom影像数据,不允许提交",
|
||||
"QCOperation_ImagesSubmitted": "当前访视的影像数据,已经由其他CRC提交。",
|
||||
"QCOperation_BatchImagesSubmitted": "当前批量提交访视的影像数据,其中部分已由其他CRC提交。",
|
||||
"QCOperation_MissingBaselineDate": "项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交",
|
||||
"QCOperation_RemoveItem": "您已经被移出项目,没有操作权限。",
|
||||
"QCOperation_QCNotClosed": "当前访视有影像质控质疑未关闭,不能进行此操作。",
|
||||
"QCOperation_NoQCNeeded": "项目配置影像质控为不审,不需要设置为影像质控通过。",
|
||||
"QCOperation_QCNotSaved": "影像质控审核问题没有保存,不能进行此操作。",
|
||||
"QCOperation_NotChangePass": "项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。",
|
||||
"QCOperation_CannotChangeToPass": "项目配置影像质控为双审。当前审核状态为 {0},不能变更到 审核通过。",
|
||||
"QCOperation_NoQCNeededNotEnd": "项目配置影像质控为不审,不允许设置影像质控终止。",
|
||||
"QCOperation_CannotChangeToStop": "项目配置影像质控为单审,当前审核状态不为 In Primary QC,不能变更到 审核终止",
|
||||
"QCOperation_CannotChangeStop": "项目配置影像质控为双审,当前审核状态为 {0},不能变更到 审核终止",
|
||||
"QCOperation_InvalidResend": "当前重传状态不为QC同意重传,不允许重传",
|
||||
"QCOperation_NoResendNeeded": "不审操作,不会有需要重传的操作!",
|
||||
"QCOperation_InvalidAgreeResend": "当前重传状态不为CRC申请重传,不允许设置同意重传",
|
||||
"QCOperation_CannotAgreeResend": "当前访视,有一个未关闭的质疑 QC设置了同意重传,CRC还未完成上传,当前不允许再次设置",
|
||||
"QCOperation_AgreeResend": "QC同意重传",
|
||||
"QCOperation_InvalidCompleteResend": "当前重传状态不为QC同意重传,不允许设置重传完成",
|
||||
"QCOperation_NoImageNotAllowed": "当前没有影像,不允许设置重传完成",
|
||||
"QCOperation_CRCTransferCompleted": "CRC已重传完成",
|
||||
"QCOperation_InvalidTransferStatus": "当前质疑重传状态不为初始状态|CRC重传完成状态,不允许申请重传",
|
||||
"QCOperation_CRCTransfer": "CRC申请重传/上传影像",
|
||||
"QCOperation_CannotModifyConfirmation": "该访视已提交,不能修改入组确认状态",
|
||||
"QCOperation_CannotModifyPDStatus": "该访视为回退访视,不允许修改PD确认状态",
|
||||
"QCOperation_ForwardingFailed": "转发影像失败。",
|
||||
//QCQuestionService
|
||||
"QCQuestion_DuplicateIndexFailed": "序号重复,操作失败",
|
||||
"QCQuestion_HasChildQuestion": "当前任务存在子问题,删除失败",
|
||||
//TrialQCQuestionService
|
||||
"TrialQCQuestion_TemplateConfirmed": "影像质控审核问题模板已经确认,不允许操作。",
|
||||
"TrialQCQuestion_DuplicateIndexFailed": "序号重复,操作失败",
|
||||
"TrialQCQuestion_DeleteChildFirst": "请在删除父问题前,请先删除引用该父问题的子问题。",
|
||||
"TrialQCQuestion_ReferencedByQCProcess": "该审核问题已被影像质控过程引用,不允许删除",
|
||||
|
||||
// ------------------------------------------------------------QC--------------------------------------------------------------------
|
||||
|
||||
// ------------------------------------------------------------SiteSurvey--------------------------------------------------------------------
|
||||
//TrialSiteEquipmentSurveyService
|
||||
"TrialSiteEquipment_Locked": "已锁定,不允许操作",
|
||||
//TrialSiteSurveyService
|
||||
"TrialSiteSurvey_InvalidEmail": "请输入正确的邮箱地址。",
|
||||
"TrialSiteSurvey_WrongVerificationCode": "验证码错误。",
|
||||
"TrialSiteSurvey_ExpiredVerificationCode": "验证码已经过期。",
|
||||
"TrialSiteSurvey_NoRecordToUpdate": "该中心不存在该交接人的中心调研记录表,不允许选择更新。",
|
||||
"TrialSiteSurvey_RecordUnderReview": "您的中心调研记录正在审核中,不允许进行更新操作。若需要更新,请在驳回后进行操作。",
|
||||
"TrialSiteSurvey_LockedByCurrentUser": "当前中心中,您提交调研记录表已锁定,不允许更新其他人邮箱调研记录。",
|
||||
"TrialSiteSurvey_LockedByOtherUsers": "当前中心,您提交的调研记录表已锁定。当前存在其他人员提交的调研记录表未锁定,不允许更新您之前提交的调研记录。",
|
||||
"TrialSiteSurvey_UnlockedRecordsExist": "当前中心存在未锁定的调研记录,不允许更新已锁定的调研记录。",
|
||||
"TrialSiteSurvey_NonLatestLockedRecord": "该邮箱{0}对应的调查表不是最新锁定的记录,不允许更新!",
|
||||
"TrialSiteSurvey_AlreadyFilledByOtherUsers": "该中心下已经有其他用户已填写的调研表,您不被允许继续填写",
|
||||
"TrialSiteSurvey_Locked": "中心调研已锁定,不允许操作。",
|
||||
"TrialSiteSurvey_IRCNotification": "[来自展影IRC] [{0}] 关于中心调研审批的提醒",
|
||||
"TrialSiteSurvey_CancelUnsubmittedRecord": "只允许废除未提交的记录。",
|
||||
"TrialSiteSurvey_NoAdminAcces": "不允许管理员操作。",
|
||||
"TrialSiteSurvey_FailedToGenerateAccountId": "生成账户Id 未取到值,请排查",
|
||||
"TrialSiteSurvey_IRCInvitation": "[来自展影IRC] [{0}] 邀请信",
|
||||
"TrialSiteSurvey_IRCInvitationContent": " 您好,展影医疗作为 实验方案号:{0} 项目的IRC供应商,诚邀您参加该项目IRC相关工作,欢迎您提供指导和建议,非常感谢!",
|
||||
"TrialSiteSurvey_ViewAndConfirm": "查看并确认",
|
||||
//TrialSiteUserSurveyService
|
||||
"TrialSiteUser_Locked": "已锁定,不允许操作",
|
||||
"TrialSiteUser_InconsistentInfo": "该邮件地址在系统中所对应的用户为 {0}, 电话号码是 {1}。请将所输入的信息修改为与系统一致后,再保存。",
|
||||
"TrialSiteUser_NoTestUserForFormal": "正式类型 、培训类型的项目 不允许加入测试用户",
|
||||
"TrialSiteUser_NoFormalUserForTest": "测试项目 不允许加入正式用户",
|
||||
|
||||
// ------------------------------------------------------------Stat--------------------------------------------------------------------
|
||||
|
||||
// ------------------------------------------------------------TrialSiteUser--------------------------------------------------------------------
|
||||
//TrialConfigService
|
||||
"TrialConfig_JudgeTaskFail": "有裁判问题未配置产生裁判阅片任务的条件,操作失败!",
|
||||
"TrialConfig_StdConfigMissing": "当前标准下未配置问题",
|
||||
"TrialConfig_AddEvalReq": "选择了附加评估,必须勾选附加评估类型",
|
||||
"TrialConfig_SignTemplateMissing": "该操作需要电子签名确认,但未在系统中找到该场景的签名模板。",
|
||||
"TrialConfig_ProjectEnded": "该项目已结束或停止,不允许修改配置。",
|
||||
"TrialConfig_NoImageAuditQuestion": "当前未添加影像质控审核问题。请先添加影像质控审核问题,再进行确认。",
|
||||
"TrialConfig_DuplicateAuditQuestionId": "影像质控审核问题显示序号不能重复。",
|
||||
"TrialConfig_InvalidParentQuestionId": "父问题的显示序号要比子问题的显示序号小,请确认。",
|
||||
"TrialConfig_AuditQuestionConfirmed": "影像质控审核问题已被其他人员确认,不允许再次确认。",
|
||||
"TrialConfig_ProjectNotInitialized": "该项目当前状态不是初始化,不允许进行该操作。",
|
||||
"TrialConfig_UnconfirmedConfiguration": "该项目的项目配置、访视管理尚未完成,无法将项目状态设为”启动”。",
|
||||
"TrialConfig_UnconfirmedUNACKD": "该项目的项目配置、访视管理中,有未确认项,无法变更项目状态。",
|
||||
"TrialConfig_ProjectNotStarted": "项目没有进入启动状态,不能设置为停止或完成状态",
|
||||
//TrialExternalUserService
|
||||
"TrialExternalUser_Inconsistency": "该邮件地址在系统中所对应的用户为 {0}, 电话号码是 {1}。请将所输入的信息修改为与系统一致后,再保存。",
|
||||
"TrialExternalUser_EmailTypeDuplicate": "系统已经存在与列表中填写的邮箱和用户类型相同的账户,请确认。",
|
||||
"TrialExternalUser_TestUserNotAllowed": "正式类型 、培训类型的项目 不允许加入测试用户 ",
|
||||
"TrialExternalUser_FormalUserNotAllowed": "测试项目 不允许加入正式用户 ",
|
||||
"TrialExternalUser_NotEditable": "人员信息不支持编辑,请删除后重新添加。",
|
||||
"TrialExternalUser_CannotDelete": "当前用户已参与到项目,不允许删除",
|
||||
"TrialExternalUser_IRCInvitation": " 您好,展影医疗作为 实验方案号:{0} 项目的IRC供应商,诚邀您参加该项目IRC相关工作,欢迎您提供指导和建议,非常感谢!",
|
||||
"TrialExternalUser_ViewAndConfirm": "查看并确认",
|
||||
"TrialExternalUser_InvitationExpired": "邀请加入时间已过期,重新被邀请后才可以进行确认操作",
|
||||
"TrialExternalUser_AccountInfo": "[来自展影IRC] [{0}] 账户信息",
|
||||
"TrialExternalUser_Welcome": "您好,欢迎您参加项目 实验方案号:{0}IRC相关工作。该项目采用电子化工作流,系统及您的账号信息如下:",
|
||||
"TrialExternalUser_ProjectNumber": "项目编号: {0}",
|
||||
"TrialExternalUser_ExperimentPlanNumber": "试验方案号: {0}",
|
||||
"TrialExternalUser_ExperimentName": "试验名称: {0}",
|
||||
"TrialExternalUser_Username": "用户名: {0}",
|
||||
"TrialExternalUser_Password": "密码: ({0})(请在登录后进行修改) : ***(您已有账号, 若忘记密码, 请通过邮箱找回)",
|
||||
"TrialExternalUser_Role": "角色: {0}",
|
||||
"TrialExternalUser_LoginUrl": "系统登录地址: {0} ",
|
||||
"TrialExternalUser_ReinvitationRequired": "邀请加入时间已过期,重新被邀请后才可以进行确认操作",
|
||||
"TrialExternalUser_UserIdStorageProblem": "调研表系统用户Id 存储有问题",
|
||||
"TrialExternalUser_IRCAccountInfo": "[来自展影IRC] [{0}] 账户信息",
|
||||
//TrialMaintenanceService
|
||||
"TrialMaint_PersonnelJoined": "人员已加入现场维护",
|
||||
//TrialService
|
||||
"Trial_PMApmPermission": "只有PM/APM拥有操作权限!",
|
||||
"Trial_TestUserCreateOnlyNonFormal": "测试用户 只能创建非正式项目",
|
||||
"Trial_DuplicateProjectNumber": "已经存在相同的项目编号。",
|
||||
"Trial_InvalidProjectStatus": "项目状态只有处于:初始化或者进行中时,才允许操作。",
|
||||
"Trial_CannotDeleteProject": "当前运行环境下,不允许删除项目数据。",
|
||||
//TrialSiteService
|
||||
"TrialSite_ParticipantJoined": "已有受试者加入中心,无法禁用",
|
||||
"TrialSite_CodeDuplicate": "代码不能重复",
|
||||
"TrialSite_CannotDeleteAssociatedCRC": "中心已经和CRC关联,不能删除",
|
||||
"TrialSite_CannotDeleteAssociatedSubject": "受试者已经添加,不能删除",
|
||||
"TrialSite_CannotDeleteUploadedData": "中心已经上传调研,无法删除",
|
||||
|
||||
// ------------------------------------------------------------Visit--------------------------------------------------------------------
|
||||
//SubjectService
|
||||
"Subject_NoConfirmedPlan": "项目访视计划没有确认。请联系项目经理确认项目访视计划后,再添加受试者。",
|
||||
"Subject_DuplicateSubjectNum": "已存在具有相关受试者编号的受试者。",
|
||||
"Subject_UploadedVisitNoDelete": "该受试者已经有访视已经上传影像,不允许删除。",
|
||||
//SubjectVisitService
|
||||
"Visit_DuplicateVisitNo": "该受试者的访视计划中已经包含一个具有相同访视号的访视。",
|
||||
"Visit_LastVisitNoChange": "该受试者已经有访视设置为末次访视,不允许将当前访视设置为末次访视。",
|
||||
"Visit_DuplicateVisitName": "该受试者的访视计划中已经包含一个具有相同访视名称的访视。",
|
||||
"Visit_NoExtraVisitAfterLast": "设置末次评估后,不允许添加计划外访视。",
|
||||
"Visit_FinishedTasksNoAdd": "该受试者后续访视已有任务完成阅片(有序阅片标准),不允许在此添加,如果确实需要,请回退",
|
||||
"Visit_NoPDStatusChangeAfterSubmission": "当前访视影像提交后,不允许修改PD确认状态。",
|
||||
"Visit_UploadedNoLost": "当前访视已经有影像上传,不允许设置为失访。",
|
||||
"Visit_UploadedNoDelete": "当前访视已经有影像上传,不允许删除。",
|
||||
"Visit_PlanVisitNoDelete": "计划内的访视不允许删除。",
|
||||
"Visit_PreviousVisitNoDelete": "当前访视已经被设置为另一访视的上一访视,不允许删除。",
|
||||
//VisitPlanService
|
||||
"VisitPlan_OnlyInitOrOngoing": "只有当项目状态为:初始化或进行中时,可以操作。",
|
||||
"VisitPlan_LargerVisitNumLargerInterval": "访视计划中,访视号大的访视,其访视间隔也应该比访视号小的访视大。",
|
||||
"VisitPlan_LargerPlanNumLargerInterval": "访视计划中,访视号大的计划访视,其访视间隔也应该比访视号小的计划访视大。",
|
||||
"VisitPlan_ExistNameOrNumTemplate": "访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。",
|
||||
"VisitPlan_ExistBaseline": "访视计划中已经存在基线。",
|
||||
"VisitPlan_ExistBaselineImgNoModify": "有受试者的基线已经上传了影像数据,不允许修改基线访视。",
|
||||
"VisitPlan_OnlyInitOrOngoingModifyConfirm": "仅仅在项目初始化或者进行中时,才允许修改确认",
|
||||
"VisitPlan_NoBaselineNotConfirm": "没有基线,不允许确认",
|
||||
"VisitPlan_ConfigNotConfirmNotConfirm": "项目配置未确认,不允许确认访视计划",
|
||||
"VisitPlan_BaselineNotMinDayNotConfirm": "基线VisitDay 不是最小的, 不允许确认",
|
||||
"VisitPlan_CheckExport": "检查导出_{0}.xlsx",
|
||||
"VisitPlan_Assigned": "访问计划已分配给受试者并已执行",
|
||||
|
||||
// ------------------------------------------------------------WorkLoad--------------------------------------------------------------------
|
||||
//DoctorWorkloadService
|
||||
"DoctorWorkload_AssignType": "已分配任务,不允许减少阅片类型",
|
||||
"DoctorWorkload_Unique": "此类数据唯一",
|
||||
"DoctorWorkload_FeeSettled": "费用已结算,工作量无法修改",
|
||||
//EnrollService
|
||||
"Enroll_NotFound": "无法找到项目{0}",
|
||||
"Enroll_EmailFormat": "{0}邮箱格式存在问题",
|
||||
"Enroll_CannotRollback": "已有分配的审核人员不能回退",
|
||||
|
||||
// ------------------------------------------------------------Triggers--------------------------------------------------------------------
|
||||
//AddlTrialUserTrigger
|
||||
"AddlTrialUser_NoTestUser": "正式类型 、培训类型的项目 不允许加入测试用户",
|
||||
"AddlTrialUser_NoFormalUser": "测试项目不允许加入正式用户",
|
||||
//SubjectStateTrigger
|
||||
"SubjectState_CannotSetCurrentAsLastVisit": "该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。",
|
||||
"SubjectState_CannotSetAsLastVisitWithImage": "该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。",
|
||||
//SubjectVisitFinalVisitTrigger
|
||||
"SubjectVisit_CannotSetAsLastVisit": "该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。",
|
||||
|
||||
// ------------------------------------------------------------BusinessFilter--------------------------------------------------------------------
|
||||
//LimitUserRequestAuthorization
|
||||
"LimitUser_AuthTokenMissing": "当前请求未从Header/Url取到用户Token,请联系开发者",
|
||||
"LimitUser_AccountLoggedInElsewhere": "您的账户在其他地方已登陆,您被迫下线。",
|
||||
//ModelActionFilter
|
||||
"ModelAction_InvalidAPIParameter": "提供给接口的参数无效。",
|
||||
//ProjectExceptionFilter
|
||||
"ProjectException_ConcurrentUpdateNotAllowed": "并发更新,当前不允许该操作",
|
||||
"Project_ExceptionContactDeveloper": "程序异常,请联系开发人员。 ",
|
||||
//TrialResourceFilter
|
||||
"TrialResource_NoAccessPermission": "对不起,您的账户没有操作权限。",
|
||||
"TrialResource_ReferTrialIdFailed": "正则取请求Refer 中trialId 失败,请联系开发人员核查",
|
||||
"TrialResource_InterceptedProjectStatusRule": "本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改",
|
||||
"TrialResource_MissingProjectNumber": "该接口参数中,没有传递项目编号,请核对。",
|
||||
//UnifiedApiResultFilter
|
||||
"UnifiedAPI_ProgramError": "程序错误,请联系开发人员。",
|
||||
|
||||
// ------------------------------------------------------------Helper--------------------------------------------------------------------
|
||||
//FileStoreHelper
|
||||
"FileStore_TemplateFileNotFound": "数据库没有找到对应的数据模板文件,请联系系统运维人员。",
|
||||
"FileStore_TemplateFileStoragePathInvalid": "文件不存在,请联系系统管理员!",
|
||||
//SendEmailHelper
|
||||
"SendEmail_SendFail": "邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员",
|
||||
"SendEmail_NoRecipient": "没有收件人",
|
||||
|
||||
// ------------------------------------------------------------IRaCIS.Core.Domain--------------------------------------------------------------------
|
||||
//Trial
|
||||
"Trial_number": "编号由5位数字组成,前2位为中心编号,后3位为顺序号,请与EDC录入的编号保持一致",
|
||||
|
||||
// ------------------------------------------------------------IRaCIS.Core.Infrastructure--------------------------------------------------------------------
|
||||
//ResponseOutput
|
||||
"RO_BizObjNotExistsOrParamIncorrect": "业务对象{0}在数据库中不存在,或被他人删除,或参数查询不正确导致",
|
||||
"RO_ExpectChangeButNoEffect": "期望发生更改,但数据库数据没有更改",
|
||||
"RO_SaveFailed": "保存失败"
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,13 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public bool IsUrgent { get; set; }
|
||||
|
||||
public bool? IsSelfAnalysis { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是一致性分析产生
|
||||
/// </summary>
|
||||
public bool IsAnalysisCreate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 加急类型
|
||||
/// </summary>
|
||||
@@ -203,6 +210,11 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
|
||||
public bool IsHaveFeedBack { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否手动生成
|
||||
/// </summary>
|
||||
public bool IsManualGeneration { get; set; }
|
||||
//public bool IsAfterConvertedTask { get; set; }
|
||||
}
|
||||
|
||||
@@ -258,6 +270,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
//产生重阅的根任务Id
|
||||
public Guid RootReReadingTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是一致性分析产生
|
||||
/// </summary>
|
||||
public bool IsAnalysisCreate { get; set; }
|
||||
|
||||
public bool? IsSelfAnalysis { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,27 +18,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 分配规则
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskAllocationRuleService : BaseService, ITaskAllocationRuleService
|
||||
public class TaskAllocationRuleService(
|
||||
IRepository<TaskAllocationRule> _taskAllocationRuleRepository,
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository) : BaseService, ITaskAllocationRuleService
|
||||
{
|
||||
|
||||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
private readonly IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository;
|
||||
|
||||
|
||||
|
||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository, IRepository<SubjectCanceDoctor> subjectCanceDoctorRepository)
|
||||
{
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_userRepository = userRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_subjectCanceDoctorRepository = subjectCanceDoctorRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -52,7 +39,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//所有标准都是一样 后台只返回任意一个标准的就好了
|
||||
var trialTaskConfig = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
var trialTaskConfig = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
return (list, trialTaskConfig);
|
||||
}
|
||||
@@ -68,7 +55,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
//冗余 存
|
||||
|
||||
var enrollId = _repository.Where<Enroll>(t => t.TrialId == addOrEditTaskAllocationRule.TrialId && t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId).Select(t => t.Id).FirstOrDefault();
|
||||
var enrollId = _enrollRepository.Where(t => t.TrialId == addOrEditTaskAllocationRule.TrialId && t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId).Select(t => t.Id).FirstOrDefault();
|
||||
|
||||
if (enrollId == Guid.Empty)
|
||||
{
|
||||
|
||||
@@ -28,51 +28,22 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 一致性分析配置表
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskConsistentRuleService : BaseService, ITaskConsistentRuleService
|
||||
public class TaskConsistentRuleService(
|
||||
IRepository<TaskConsistentRule> _taskConsistentRuleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
IReadingClinicalDataService _readingClinicalDataService,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<TrialVirtualSiteCodeUpdate> _trialVirtualSiteCodeUpdateRepository,
|
||||
IVisitTaskHelpeService _visitTaskCommonService) : BaseService, ITaskConsistentRuleService
|
||||
{
|
||||
|
||||
private readonly IRepository<TaskConsistentRule> _taskConsistentRuleRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository;
|
||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||
private readonly IRepository<SubjectUser> _subjectUserRepository;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialSite> _trialSiteRepository;
|
||||
|
||||
private readonly IRepository<TrialVirtualSiteCodeUpdate> _trialVirtualSiteCodeUpdateRepository;
|
||||
|
||||
private readonly IVisitTaskHelpeService _visitTaskCommonService;
|
||||
|
||||
|
||||
public TaskConsistentRuleService(IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<ReadingConsistentClinicalData> readingConsistentClinicalDataRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository,
|
||||
IReadingClinicalDataService readingClinicalDataService,
|
||||
IRepository<Enroll> enrollRepository, IRepository<TaskConsistentRule> taskConsistentRuleRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Subject> subjectRepository, IDistributedLockProvider distributedLockProvider,
|
||||
IRepository<Trial> trialRepository, IRepository<TrialSite> trialSiteRepository, IRepository<TrialVirtualSiteCodeUpdate> trialVirtualSiteCodeUpdateRepository, IVisitTaskHelpeService visitTaskCommonService)
|
||||
{
|
||||
_taskConsistentRuleRepository = taskConsistentRuleRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
this._readingConsistentClinicalDataRepository = readingConsistentClinicalDataRepository;
|
||||
this._trialReadingCriterionRepository = trialReadingCriterionRepository;
|
||||
this._readingClinicalDataService = readingClinicalDataService;
|
||||
_subjectUserRepository = subjectUserRepository;
|
||||
_subjectRepository = subjectRepository;
|
||||
_enrollRepository = enrollRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
|
||||
_trialRepository = trialRepository;
|
||||
|
||||
_trialSiteRepository = trialSiteRepository;
|
||||
|
||||
_trialVirtualSiteCodeUpdateRepository = trialVirtualSiteCodeUpdateRepository;
|
||||
|
||||
_visitTaskCommonService = visitTaskCommonService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置一致性分析任务失效
|
||||
@@ -96,38 +67,38 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <summary>
|
||||
/// 一致性分析列表 (自身 组内 最后勾选 产生的任务)
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.IsAnalysisCreate)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => /*(t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) ||*/ (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) /*&& t.IsAnalysisCreate == false*/))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => ((t.Subject.Code.Contains(queryVisitTask.SubjectCode) || t.Subject.MedicalNo.Contains(queryVisitTask.SubjectCode)) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime >= queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime <= queryVisitTask.EndAllocateDate)
|
||||
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime >= queryVisitTask.BeginSignTime)
|
||||
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime <= queryVisitTask.EndSignTime)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
.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.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => /*(t.BlindTrialSiteCode.Contains(queryVisitTask.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.Subject.MedicalNo.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)
|
||||
.ProjectTo<AnalysisTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
#region 统计一致性分析临床数据数量
|
||||
|
||||
foreach (var item in pageList.CurrentPageData)
|
||||
@@ -143,7 +114,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
#endregion
|
||||
|
||||
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
||||
|
||||
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
||||
}
|
||||
@@ -159,7 +130,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.Id == inQuery.TaskConsistentRuleId);
|
||||
|
||||
var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, inQuery.DoctorUserId).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
|
||||
var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, inQuery.DoctorUserId).ToPagedListAsync(inQuery, nameof(DoctorSelfConsistentSubjectView.SubjectCode));
|
||||
|
||||
return pagedList;
|
||||
}
|
||||
@@ -278,7 +249,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
TaskName = lastTask.TaskName + "_Global",
|
||||
TaskBlindName = lastTask.TaskBlindName + "_Global",
|
||||
TrialReadingCriterionId = trialReadingCriterionId,
|
||||
VisitTaskNum= lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]
|
||||
VisitTaskNum = lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]
|
||||
};
|
||||
|
||||
var afterGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum > lastTask.VisitTaskNum).ProjectTo<VisitTaskSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
@@ -347,7 +318,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var query = await GetGroupConsistentQueryAsync(filterObj);
|
||||
|
||||
|
||||
var pagedList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
|
||||
var pagedList = await query.ToPagedListAsync(inQuery, nameof(DoctorSelfConsistentSubjectView.SubjectCode));
|
||||
|
||||
var rule = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == false && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo<TaskConsistentRuleBasic>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
@@ -404,9 +375,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var subjectList = query.ToList();
|
||||
|
||||
var doctorUserIdQuery = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId).Where(t => t.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(c => c.ReadingCategory == ReadingCategory.Global || c.ReadingCategory == ReadingCategory.Visit))
|
||||
var doctorUserIdQuery = from enroll in _enrollRepository.Where(t => t.TrialId == trialId).Where(t => t.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(c => c.ReadingCategory == ReadingCategory.Global || c.ReadingCategory == ReadingCategory.Visit))
|
||||
.Where(t => t.EnrollReadingCriteriaList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsJoinAnalysis == true))
|
||||
join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId
|
||||
join user in _userRepository.Where() on enroll.DoctorId equals user.DoctorId
|
||||
select user.Id;
|
||||
|
||||
var configDoctorUserIdList = await doctorUserIdQuery.ToListAsync();
|
||||
@@ -627,7 +598,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
IsReReadingOrBackInfluenceAnalysis = t.IsReReadingOrBackInfluenceAnalysis,
|
||||
|
||||
FirstGlobalVisitName= t.ReadModuleList.Where(c=>c.TrialReadingCriterionId== trialReadingCriterionId && c.ModuleType== ModuleTypeEnum.Global).OrderBy(k=>k.SubjectVisit.VisitNum).Select(u=>u.SubjectVisit.VisitName).FirstOrDefault(),
|
||||
FirstGlobalVisitName = t.ReadModuleList.Where(c => c.TrialReadingCriterionId == trialReadingCriterionId && c.ModuleType == ModuleTypeEnum.Global).OrderBy(k => k.SubjectVisit.VisitNum).Select(u => u.SubjectVisit.VisitName).FirstOrDefault(),
|
||||
|
||||
BlindSubjectCode = t.SubjectVisitTaskList.Where(t => t.IsAnalysisCreate && t.TrialReadingCriterionId == trialReadingCriterionId).OrderByDescending(t => t.BlindSubjectCode).Select(t => t.BlindSubjectCode).FirstOrDefault(),
|
||||
|
||||
@@ -819,10 +790,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
Expression<Func<VisitTask, bool>> visitTaskFilter = comonTaskFilter.And(t => t.ReadingCategory == ReadingCategory.Visit);
|
||||
|
||||
|
||||
var taskConsistentRuleQueryable = from enroll in _repository.Where<Enroll>(t => t.TrialId == trialId && t.EnrollStatus == EnrollStatus.ConfirmIntoGroup
|
||||
var taskConsistentRuleQueryable = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus == EnrollStatus.ConfirmIntoGroup
|
||||
&& t.EnrollReadingCriteriaList.Any(c => c.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && c.IsJoinAnalysis))
|
||||
join user in _repository.Where<User>() on enroll.DoctorUserId equals user.Id
|
||||
join taskConsistentRule in _repository.Where<TaskConsistentRule>(t => t.TrialId == trialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.IsSelfAnalysis) on enroll.TrialId equals taskConsistentRule.TrialId
|
||||
join user in _userRepository.Where() on enroll.DoctorUserId equals user.Id
|
||||
join taskConsistentRule in _taskConsistentRuleRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.IsSelfAnalysis) on enroll.TrialId equals taskConsistentRule.TrialId
|
||||
select new TaskConsistentRuleView()
|
||||
{
|
||||
Id = taskConsistentRule.Id,
|
||||
|
||||
@@ -16,17 +16,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 医学审核生成规则 废弃
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskMedicalReviewRuleService : BaseService, ITaskMedicalReviewRuleService
|
||||
public class TaskMedicalReviewRuleService(
|
||||
IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository,
|
||||
IRepository<TrialUser> _trialUserRepository) : BaseService, ITaskMedicalReviewRuleService
|
||||
{
|
||||
|
||||
private readonly IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository;
|
||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||
public TaskMedicalReviewRuleService(IRepository<TaskMedicalReviewRule> taskMedicalReviewRuleRepository,IRepository<TaskMedicalReview> taskMedicalReviewRepository)
|
||||
{
|
||||
_taskMedicalReviewRuleRepository = taskMedicalReviewRuleRepository;
|
||||
_taskMedicalReviewRepository = taskMedicalReviewRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<(List<TaskMedicalReviewRuleView>,object)> GetTaskMedicalReviewRuleList(TaskMedicalReviewRuleQuery inQuery)
|
||||
@@ -36,7 +31,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var taskTaskMedicalReviewRuleQueryable = _taskMedicalReviewRuleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var isHaveMIM = await _repository.AnyAsync<TrialUser>(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId==inQuery.TrialId);
|
||||
var isHaveMIM = await _trialUserRepository.AnyAsync(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId==inQuery.TrialId);
|
||||
|
||||
return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(),new {IsHaveMIM=isHaveMIM});
|
||||
}
|
||||
|
||||
@@ -19,31 +19,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 任务医学审核
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskMedicalReviewService : BaseService, ITaskMedicalReviewService
|
||||
public class TaskMedicalReviewService(
|
||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<TrialUser> _trialUserRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository) : BaseService, ITaskMedicalReviewService
|
||||
{
|
||||
|
||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialUser> _trialUserRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository;
|
||||
|
||||
public TaskMedicalReviewService(IRepository<TaskMedicalReview> taskMedicalReviewRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<TrialUser> trialUserRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<TaskMedicalReviewRule> taskMedicalReviewRuleRepository)
|
||||
{
|
||||
_taskMedicalReviewRepository = taskMedicalReviewRepository;
|
||||
this._trialRepository = trialRepository;
|
||||
_trialUserRepository = trialUserRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
_taskMedicalReviewRuleRepository = taskMedicalReviewRuleRepository;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PM 医学审核(挑选任务生成后的列表)
|
||||
@@ -84,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -120,7 +103,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ProjectTo<GenerateMedicalReviewTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(GenerateMedicalReviewTaskView.IsUrgent) + " desc", nameof(GenerateMedicalReviewTaskView.SubjectId) };
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
return pageList;
|
||||
@@ -257,7 +240,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return ResponseOutput.Ok(pageList, new
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using AutoMapper;
|
||||
@@ -18,6 +17,8 @@ using System.Linq.Expressions;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using System.Runtime.InteropServices;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -27,74 +28,23 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 访视读片任务
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class VisitTaskHelpeService : BaseService, IVisitTaskHelpeService
|
||||
public class VisitTaskHelpeService(
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository,
|
||||
IRepository<SubjectUser> _subjectUserRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
|
||||
IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository,
|
||||
|
||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
IRepository<ClinicalDataTrialSet> _trialClinicalDataSetRepository,
|
||||
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
||||
IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository) : BaseService, IVisitTaskHelpeService
|
||||
{
|
||||
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository;
|
||||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<SubjectUser> _subjectUserRepository;
|
||||
private readonly IRepository<ReadModule> _readModuleRepository;
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||
private readonly IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IUserInfo _userInfo;
|
||||
private readonly IRepository<VisitTaskReReading> _visitTaskReReadingRepository;
|
||||
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository;
|
||||
|
||||
private readonly IRepository<ClinicalDataTrialSet> _trialClinicalDataSetRepository;
|
||||
private readonly IRepository<ReadingClinicalData> _readingClinicalDataRepository;
|
||||
private readonly IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository;
|
||||
|
||||
private readonly IRepository<SubjectCriteriaEvaluation> _subjectCriteriaEvaluationRepository;
|
||||
|
||||
|
||||
public VisitTaskHelpeService(IRepository<VisitTask> visitTaskRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Trial> trialRepository, IEasyCachingProvider provider,
|
||||
IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<ReadModule> readModuleRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<ReadingOncologyTaskInfo> ReadingOncologyTaskInfoRepository,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
|
||||
IRepository<TaskAllocationRule> taskAllocationRuleRepository, IMapper mapper, IUserInfo userInfo, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository, IRepository<ClinicalDataTrialSet> trialClinicalDataSetRepository, IRepository<ReadingClinicalData> readingClinicalDataRepository,
|
||||
IRepository<SubjectCriteriaEvaluation> subjectCriteriaEvaluationRepository, IRepository<ReadingConsistentClinicalData> readingConsistentClinicalDataRepository)
|
||||
{
|
||||
_readingConsistentClinicalDataRepository = readingConsistentClinicalDataRepository;
|
||||
_readingClinicalDataRepository = readingClinicalDataRepository;
|
||||
_trialClinicalDataSetRepository = trialClinicalDataSetRepository;
|
||||
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
_trialRepository = trialRepository;
|
||||
this._readModuleRepository = readModuleRepository;
|
||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
_readingOncologyTaskInfoRepository = ReadingOncologyTaskInfoRepository;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
_provider = provider;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
this._readingJudgeInfoRepository = readingJudgeInfoRepository;
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_subjectUserRepository = subjectUserRepository;
|
||||
_mapper = mapper;
|
||||
_userInfo = userInfo;
|
||||
_visitTaskReReadingRepository = visitTaskReReadingRepository;
|
||||
_subjectCriteriaEvaluationRepository = subjectCriteriaEvaluationRepository;
|
||||
_trialReadingCriterionRepository = trialReadingCriterionRepository;
|
||||
}
|
||||
|
||||
|
||||
//查询列表的时候,一致性核查通过未产生任务的 自动产生任务 如果是一致性核查,那么还会自动分配
|
||||
public async Task GenerateVisitTaskAsync(Guid trialId, List<Guid> subjectVisitIdList, bool isAssignSubjectToDoctor = false)
|
||||
@@ -186,7 +136,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
var cacheMaxCodeInt = _provider.Get<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}").Value;
|
||||
var cacheMaxCodeInt =_fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
|
||||
|
||||
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
||||
|
||||
@@ -318,7 +268,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
|
||||
|
||||
@@ -379,7 +329,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
|
||||
|
||||
@@ -625,7 +575,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
var cacheMaxCodeInt = _provider.Get<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}").Value;
|
||||
var cacheMaxCodeInt =_fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
|
||||
|
||||
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
||||
|
||||
@@ -782,7 +732,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
|
||||
#region 分配
|
||||
@@ -955,7 +905,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1023,7 +973,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1106,7 +1056,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
#region 分配
|
||||
|
||||
@@ -1234,7 +1184,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1423,7 +1373,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
//}
|
||||
|
||||
@@ -1524,7 +1474,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1571,7 +1521,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1609,7 +1559,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _visitTaskRepository.AddAsync(visitTask);
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask()
|
||||
{
|
||||
@@ -1670,7 +1620,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
});
|
||||
|
||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1740,7 +1690,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialId = originalTaskInfo.TrialId
|
||||
});
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -30,57 +30,33 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// 访视读片任务
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class VisitTaskService : BaseService, IVisitTaskService
|
||||
public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<TaskAllocationRule> _taskAllocationRuleRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IRepository<SubjectUser> _subjectUserRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
|
||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<ReadingClinicalData> _readingClinicalDataReposiotry,
|
||||
IRepository<SubjectCriteriaEvaluation> _subjectCriteriaEvaluationRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitFilter> _subjectCriteriaEvaluationVisitFilterRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||
IRepository<DicomSeries> _dicomSeriesRepository,
|
||||
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository,
|
||||
IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingCustomTag> _readingCustomTagRepository,
|
||||
IRepository<TaskInfluence> _taskInfluenceRepository,
|
||||
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitStudyFilter> _subjectCriteriaEvaluationVisitStudyFilterRepository) : BaseService, IVisitTaskService
|
||||
{
|
||||
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IRepository<SubjectUser> _subjectUserRepository;
|
||||
private readonly IRepository<ReadModule> _readModuleRepository;
|
||||
|
||||
private readonly IRepository<VisitTaskReReading> _visitTaskReReadingRepository;
|
||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||
|
||||
private readonly IRepository<ReadingClinicalData> _readingClinicalDataReposiotry;
|
||||
private readonly IRepository<SubjectCriteriaEvaluation> _subjectCriteriaEvaluationRepository;
|
||||
private readonly IRepository<SubjectCriteriaEvaluationVisitFilter> _subjectCriteriaEvaluationVisitFilterRepository;
|
||||
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository;
|
||||
private readonly IRepository<SubjectCriteriaEvaluationVisitStudyFilter> _subjectCriteriaEvaluationVisitStudyFilterRepository;
|
||||
|
||||
public VisitTaskService(IRepository<SubjectVisit> subjectVisitRepository, IRepository<VisitTask> visitTaskRepository, IRepository<Trial> trialRepository,
|
||||
IRepository<Subject> subjectRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository,
|
||||
IRepository<ReadModule> readModuleRepository, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
|
||||
IRepository<TaskMedicalReview> taskMedicalReviewRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
||||
, IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository,
|
||||
IRepository<ReadingClinicalData> readingClinicalDataReposiotry,
|
||||
IRepository<SubjectCriteriaEvaluation> subjectCriteriaEvaluationRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitFilter> subjectCriteriaEvaluationVisitFilterRepository,
|
||||
IRepository<SubjectCriteriaEvaluationVisitStudyFilter> subjectCriteriaEvaluationVisitStudyFilterRepository
|
||||
)
|
||||
{
|
||||
_readingClinicalDataReposiotry = readingClinicalDataReposiotry;
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
_subjectRepository = subjectRepository;
|
||||
_subjectUserRepository = subjectUserRepository;
|
||||
_readModuleRepository = readModuleRepository;
|
||||
_visitTaskReReadingRepository = visitTaskReReadingRepository;
|
||||
_taskMedicalReviewRepository = taskMedicalReviewRepository;
|
||||
_readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
|
||||
_trialReadingCriterionRepository = trialReadingCriterionRepository;
|
||||
_subjectCriteriaEvaluationRepository = subjectCriteriaEvaluationRepository;
|
||||
_subjectCriteriaEvaluationVisitFilterRepository = subjectCriteriaEvaluationVisitFilterRepository;
|
||||
_subjectCriteriaEvaluationVisitStudyFilterRepository = subjectCriteriaEvaluationVisitStudyFilterRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置任务加急
|
||||
@@ -97,13 +73,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
TaskUrgentRemake = inDto.TaskUrgentRemake,
|
||||
|
||||
});
|
||||
|
||||
|
||||
return await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null)
|
||||
{
|
||||
var list = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm)
|
||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
||||
|
||||
.OrderBy(t => t.ShowOrder)
|
||||
.Select(t => new TrialReadingCriterionDto()
|
||||
@@ -145,35 +121,35 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<SubjectAssignStat>>> GetSubjectAssignAndTaskStatList(SubjectAssignStatQuery querySubjectAssign)
|
||||
public async Task<IResponseOutput<PageOutput<SubjectAssignStat>>> GetSubjectAssignAndTaskStatList(SubjectAssignStatQuery inQuery)
|
||||
{
|
||||
|
||||
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == querySubjectAssign.TrialReadingCriterionId && t.IsAutoCreate == false);
|
||||
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == inQuery.TrialReadingCriterionId && t.IsAutoCreate == false);
|
||||
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId && t.SubjectVisitTaskList.Any())
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
.WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
.WhereIf(!string.IsNullOrEmpty(querySubjectAssign.SubjectCode), t => t.Code.Contains(querySubjectAssign.SubjectCode))
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId && t.SubjectVisitTaskList.Any())
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.Id == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == inQuery.DoctorUserId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Code.Contains(inQuery.SubjectCode))
|
||||
//未分配
|
||||
.WhereIf(querySubjectAssign.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
.WhereIf(inQuery.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
|
||||
//已分配
|
||||
.WhereIf(querySubjectAssign.SubjectAllocateState == 1, t => t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
.WhereIf(inQuery.SubjectAllocateState == 1, t => t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
|
||||
|
||||
.WhereIf(querySubjectAssign.ArmList.Count > 0, t => !querySubjectAssign.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any())
|
||||
.WhereIf(inQuery.ArmList.Count > 0, t => !inQuery.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any())
|
||||
|
||||
|
||||
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
|
||||
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
|
||||
|
||||
|
||||
.ProjectTo<SubjectAssignStat>(_mapper.ConfigurationProvider, new { trialReadingCriterionId = querySubjectAssign.TrialReadingCriterionId });
|
||||
.ProjectTo<SubjectAssignStat>(_mapper.ConfigurationProvider, new { trialReadingCriterionId = inQuery.TrialReadingCriterionId });
|
||||
|
||||
|
||||
var pageList = await subjectQuery.ToPagedListAsync(querySubjectAssign.PageIndex, querySubjectAssign.PageSize, string.IsNullOrWhiteSpace(querySubjectAssign.SortField) ? nameof(querySubjectAssign.SubjectId) : querySubjectAssign.SortField, querySubjectAssign.Asc);
|
||||
var pageList = await subjectQuery.ToPagedListAsync(inQuery,nameof(SubjectAssignStat.SubjectId));
|
||||
|
||||
|
||||
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == querySubjectAssign.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsArbitrationReading, x.IsOncologyReading, x.IsGlobalReading }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsArbitrationReading, x.IsOncologyReading, x.IsGlobalReading }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
return ResponseOutput.Ok(pageList, criterionConfig);
|
||||
}
|
||||
@@ -290,7 +266,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
foreach (var command in cancelCommand.CancelList.Where(t => t.IsCancelAssign))
|
||||
{
|
||||
if (await _visitTaskRepository.AnyAsync(t => t.TaskState==TaskState.Effect && t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading))
|
||||
if (await _visitTaskRepository.AnyAsync(t => t.TaskState == TaskState.Effect && t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading))
|
||||
{
|
||||
//---当前医生已开始做该Subject 该标准的任务,不允许取消分配
|
||||
throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorConfigNotFound"]);
|
||||
@@ -309,7 +285,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var subjectId = cancelCommand.CancelList.First().SubjectId;
|
||||
|
||||
await _repository.AddAsync(new SubjectCanceDoctor() { SubjectId = subjectId, Note = cancelCommand.Note, TrialReadingCriterionId = cancelCommand.TrialReadingCriterionId });
|
||||
await _subjectCanceDoctorRepository.AddAsync(new SubjectCanceDoctor() { SubjectId = subjectId, Note = cancelCommand.Note, TrialReadingCriterionId = cancelCommand.TrialReadingCriterionId });
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
@@ -418,32 +394,32 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SubjectAssignView>> GetSubjectAssignList(SubjectAssignQuery querySubjectAssign)
|
||||
public async Task<PageOutput<SubjectAssignView>> GetSubjectAssignList(SubjectAssignQuery inQuery)
|
||||
{
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId)
|
||||
.WhereIf(querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(inQuery.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.Id == inQuery.SubjectId)
|
||||
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == false && querySubjectAssign.IsJudgeDoctor == false, t => !t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == false && querySubjectAssign.IsJudgeDoctor, t => !t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == true && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == true && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == false && inQuery.IsJudgeDoctor == false, t => !t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == false && inQuery.IsJudgeDoctor, t => !t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
|
||||
|
||||
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).All(u => u.IsConfirmed))
|
||||
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == true && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).All(u => u.IsConfirmed))
|
||||
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == true && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).All(u => u.IsConfirmed))
|
||||
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == true && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).All(u => u.IsConfirmed))
|
||||
|
||||
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == false && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(u => u.IsConfirmed == false))
|
||||
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == false && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(u => u.IsConfirmed == false))
|
||||
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == false && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(u => u.IsConfirmed == false))
|
||||
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == false && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(u => u.IsConfirmed == false))
|
||||
|
||||
.WhereIf(querySubjectAssign.DoctorUserId != null && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId))
|
||||
.WhereIf(querySubjectAssign.DoctorUserId != null && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId))
|
||||
.ProjectTo<SubjectAssignView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = querySubjectAssign.IsJudgeDoctor });
|
||||
.WhereIf(inQuery.DoctorUserId != null && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(t => t.DoctorUserId == inQuery.DoctorUserId))
|
||||
.WhereIf(inQuery.DoctorUserId != null && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(t => t.DoctorUserId == inQuery.DoctorUserId))
|
||||
.ProjectTo<SubjectAssignView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = inQuery.IsJudgeDoctor });
|
||||
|
||||
var pageList = await subjectQuery.ToPagedListAsync(querySubjectAssign.PageIndex, querySubjectAssign.PageSize, string.IsNullOrWhiteSpace(querySubjectAssign.SortField) ? nameof(querySubjectAssign.SubjectId) : querySubjectAssign.SortField, querySubjectAssign.Asc);
|
||||
var pageList = await subjectQuery.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -669,43 +645,43 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <summary>
|
||||
/// 访视任务
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_visitTaskCommonService"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<VisitTaskView>> GetVisitTaskList(VisitTaskQuery queryVisitTask, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
|
||||
public async Task<PageOutput<VisitTaskView>> GetVisitTaskList(VisitTaskQuery inQuery, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
|
||||
{
|
||||
//以前访视未产生任务的,在查询这里要产生
|
||||
var svIdList = await _subjectVisitRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.CheckState == CheckStateEnum.CVPassed && t.IsVisitTaskGenerated == false).Select(t => t.Id).ToListAsync();
|
||||
var svIdList = await _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId && t.CheckState == CheckStateEnum.CVPassed && t.IsVisitTaskGenerated == false).Select(t => t.Id).ToListAsync();
|
||||
|
||||
//之前没有生成任务的逻辑 但是现在加了,任务要自动生成
|
||||
await _visitTaskCommonService.GenerateVisitTaskAsync(queryVisitTask.TrialId, svIdList);
|
||||
await _visitTaskCommonService.GenerateVisitTaskAsync(inQuery.TrialId, svIdList);
|
||||
|
||||
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.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.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.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(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.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!.Value.AddDays(1))
|
||||
.ProjectTo<VisitTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
return pageList;
|
||||
@@ -716,35 +692,35 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <summary>
|
||||
/// 裁判任务
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<JudgeVisitTaskView>/*, object)*/> GetJudgeVisitTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<PageOutput<JudgeVisitTaskView>/*, object)*/> GetJudgeVisitTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||
.Where(t => t.ReadingCategory == ReadingCategory.Judge)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.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.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.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!.Value.AddDays(1))
|
||||
.ProjectTo<JudgeVisitTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTaskView.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
@@ -756,45 +732,45 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <summary>
|
||||
/// PM阅片跟踪
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<ReadingTaskView>>> GetReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<IResponseOutput<PageOutput<ReadingTaskView>>> GetReadingTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
|
||||
.WhereIf(queryVisitTask.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
.WhereIf(queryVisitTask.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||
.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(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.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(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
|
||||
.WhereIf(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
|
||||
.WhereIf(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate)
|
||||
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime > queryVisitTask.BeginSignTime)
|
||||
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime < queryVisitTask.EndSignTime)
|
||||
.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)
|
||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
||||
}
|
||||
@@ -853,7 +829,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -862,43 +838,43 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <summary>
|
||||
/// 获取IR 重阅影像阅片列表
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
|
||||
var visitTaskQueryable = _visitTaskReReadingRepository
|
||||
.Where(t => t.RequestReReadingType == RequestReReadingType.DocotorApply)
|
||||
.Where(t => t.OriginalReReadingTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId)
|
||||
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == inQuery.RequestReReadingResultEnum)
|
||||
.WhereIf(inQuery.RootReReadingTaskId != null, t => t.RootReReadingTaskId == inQuery.RootReReadingTaskId || t.OriginalReReadingTaskId == inQuery.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(inQuery.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(inQuery.TaskCode!))
|
||||
.WhereIf(inQuery.TaskState != null, t => t.OriginalReReadingTask.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == inQuery.ReReadingApplyState)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(queryVisitTask.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
||||
var defalutSortArray = new string[] { nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.IsUrgent) + " desc", nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.SubjectId), nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -906,34 +882,34 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
//SPM 能看到项目组申请记录
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReReadingTaskView>> GetSPMReReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<PageOutput<ReReadingTaskView>> GetSPMReReadingTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
var visitTaskQueryable = _visitTaskReReadingRepository.Where(t => t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.OriginalReReadingTask.IsAnalysisCreate == false)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.RootReReadingTaskId != null, t => t.RootReReadingTaskId == inQuery.RootReReadingTaskId || t.OriginalReReadingTaskId == inQuery.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(inQuery.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(inQuery.TaskCode!))
|
||||
.WhereIf(inQuery.TaskState != null, t => t.OriginalReReadingTask.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(queryVisitTask.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(ReReadingTaskView.RequestReReadingTime) };
|
||||
|
||||
//var defalutSortArray = new string[] { nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.IsUrgent) + " desc", nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.SubjectId), nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -1230,7 +1206,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.ToList()
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||
|
||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc);
|
||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery, nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) );
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -1241,36 +1217,36 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <summary>
|
||||
/// IR 已阅片任务
|
||||
/// </summary>
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
|
||||
{
|
||||
|
||||
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState == ReadingTaskState.HaveSigned)//该医生 已经签名的数据
|
||||
|
||||
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.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.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
.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!.Value.AddDays(1))
|
||||
.ProjectTo<IRHaveReadView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -1463,7 +1439,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]);
|
||||
}
|
||||
|
||||
if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology && t.ReadingTaskState==ReadingTaskState.HaveSigned)))
|
||||
if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology && t.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||
{
|
||||
//---有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅
|
||||
throw new BusinessValidationFailedException(_localizer["VisitTask_LastOncologistRecheck"]);
|
||||
@@ -1484,8 +1460,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var originalTask = pmApply.OriginalReReadingTask;
|
||||
|
||||
//PM 无序影响列表
|
||||
if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId )
|
||||
.Where(t=>t.Id==originalTask.Id||t.Id==originalTask.JudgeVisitTaskId)
|
||||
if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId)
|
||||
.Where(t => t.Id == originalTask.Id || t.Id == originalTask.JudgeVisitTaskId)
|
||||
.AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum))
|
||||
{
|
||||
//---当前为无序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅
|
||||
@@ -1587,9 +1563,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <returns></returns>
|
||||
private async Task PMReReadingConfirmOrBackInfluenceAnalysisAsync(Guid subjectId)
|
||||
{
|
||||
if (await _repository.AnyAsync<VisitTask>(t => t.IsAnalysisCreate && t.SubjectId == subjectId))
|
||||
if (await _visitTaskRepository.AnyAsync(t => t.IsAnalysisCreate && t.SubjectId == subjectId))
|
||||
{
|
||||
await _repository.UpdatePartialFromQueryAsync<Subject>(t => t.Id == subjectId, u => new Subject() { IsReReadingOrBackInfluenceAnalysis = true });
|
||||
await _subjectRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectId, u => new Subject() { IsReReadingOrBackInfluenceAnalysis = true });
|
||||
|
||||
}
|
||||
|
||||
@@ -1629,7 +1605,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new VisitTaskReReading() { RequestReReadingConfirmUserId = _userInfo.Id, RequestReReadingResultEnum = RequestReReadingResult.Invalid });
|
||||
|
||||
//---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作
|
||||
return ResponseOutput.Ok(string.Empty, msg:_localizer["VisitTask_ReapplyStatusConflict"]);
|
||||
return ResponseOutput.Ok(string.Empty, msg: _localizer["VisitTask_ReapplyStatusConflict"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -2184,7 +2160,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
||||
//自定义
|
||||
var readingCustomTagList = _repository.Where<ReadingCustomTag>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
var readingCustomTagList = _readingCustomTagRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingCustomTagList)
|
||||
{
|
||||
@@ -2192,10 +2168,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingCustomTagList).Result;
|
||||
_ = _readingCustomTagRepository.AddRangeAsync(readingCustomTagList).Result;
|
||||
|
||||
|
||||
var readingTaskQuestionMarkList = _repository.Where<ReadingTaskQuestionMark>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
var readingTaskQuestionMarkList = _readingTaskQuestionMarkRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingTaskQuestionMarkList)
|
||||
{
|
||||
@@ -2203,21 +2179,21 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingTaskQuestionMarkList).Result;
|
||||
_ = _readingTaskQuestionMarkRepository.AddRangeAsync(readingTaskQuestionMarkList).Result;
|
||||
|
||||
var readingTaskQuestionAnswerList = _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
var readingTaskQuestionAnswerList = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingTaskQuestionAnswerList)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
_ = _repository.AddRangeAsync(readingTaskQuestionAnswerList).Result;
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskQuestionAnswerList).Result;
|
||||
|
||||
|
||||
|
||||
//ReadingTableAnswerRowInfo ReadingTableQuestionAnswer 一起加
|
||||
var readingTableAnswerRowInfoList = _repository.Where<ReadingTableAnswerRowInfo>(t => t.VisitTaskId == origenalTask.Id).Include(t => t.LesionAnswerList).ToList();
|
||||
var readingTableAnswerRowInfoList = _readingTableAnswerRowInfoRepository.Where(t => t.VisitTaskId == origenalTask.Id).Include(t => t.LesionAnswerList).ToList();
|
||||
|
||||
foreach (var item in readingTableAnswerRowInfoList)
|
||||
{
|
||||
@@ -2240,7 +2216,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
}
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingTableAnswerRowInfoList).Result;
|
||||
_ = _readingTableAnswerRowInfoRepository.AddRangeAsync(readingTableAnswerRowInfoList).Result;
|
||||
|
||||
|
||||
|
||||
@@ -2569,9 +2545,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
//await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = "PM/APM同意一致性核查回退。", UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt });
|
||||
|
||||
await _repository.BatchDeleteAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId);
|
||||
await _repository.BatchDeleteAsync<DicomInstance>(t => t.DicomSerie.IsDeleted);
|
||||
await _repository.BatchDeleteAsync<DicomSeries>(t => t.IsDeleted);
|
||||
await _trialQCQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisitId == subjectVisitId);
|
||||
await _dicomInstanceRepository.BatchDeleteNoTrackingAsync(t => t.DicomSerie.IsDeleted);
|
||||
await _dicomSeriesRepository.BatchDeleteNoTrackingAsync(t => t.IsDeleted);
|
||||
|
||||
var success = await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
@@ -2580,7 +2556,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
private bool IsPMOrAPm()
|
||||
{
|
||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM;
|
||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM;
|
||||
}
|
||||
|
||||
private bool IsSpmOrCPM()
|
||||
@@ -2619,7 +2595,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
||||
// IR 申请 PM 同意
|
||||
if ((( IsPMOrAPm() && applyId != null && await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.IndependentReviewer))
|
||||
if (((IsPMOrAPm() && applyId != null && await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.IndependentReviewer))
|
||||
|| (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null)))
|
||||
{
|
||||
|
||||
@@ -2904,7 +2880,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <returns></returns>
|
||||
public async Task<List<InfluenceTaskInfo>> GetInfluencedTaskList(Guid taskId)
|
||||
{
|
||||
var list = await _repository.Where<TaskInfluence>(t => t.OriginalTaskId == taskId)/*.Select(t => t.InfluenceTask)*/.ProjectTo<InfluenceTaskInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var list = await _taskInfluenceRepository.Where(t => t.OriginalTaskId == taskId)/*.Select(t => t.InfluenceTask)*/.ProjectTo<InfluenceTaskInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList));
|
||||
|
||||
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
|
||||
.ForMember(o=>o.IsManualGeneration,t=> t.MapFrom(u => !u.TrialReadingCriterion.IsAutoCreate))
|
||||
.ForMember(o => o.IsHaveFeedBack, t => t.MapFrom(u => u.UserFeedBackList.Any(t=>t.State==0)))
|
||||
;
|
||||
|
||||
|
||||
@@ -17,17 +17,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// 系统模板文档配置表
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class CommonDocumentService : BaseService, ICommonDocumentService
|
||||
public class CommonDocumentService(IRepository<CommonDocument> _commonDocumentRepository) : BaseService, ICommonDocumentService
|
||||
{
|
||||
|
||||
private readonly IRepository<CommonDocument> _commonDocumentRepository;
|
||||
|
||||
public CommonDocumentService(IRepository<CommonDocument> commonDocumentRepository)
|
||||
{
|
||||
_commonDocumentRepository = commonDocumentRepository;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<CommonDocumentView>> GetCommonDocumentList(CommonDocumentQuery queryCommonDocument)
|
||||
{
|
||||
@@ -37,11 +29,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
.WhereIf(queryCommonDocument.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryCommonDocument.CriterionTypeEnum)
|
||||
.WhereIf(queryCommonDocument.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryCommonDocument.BusinessScenarioEnum)
|
||||
.WhereIf(string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code))
|
||||
.WhereIf(string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name))
|
||||
.ProjectTo<CommonDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
|
||||
return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument.PageIndex, queryCommonDocument.PageSize, String.IsNullOrEmpty(queryCommonDocument.SortField) ? nameof(CommonDocument.Code) : queryCommonDocument.SortField, queryCommonDocument.Asc); ;
|
||||
return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -150,6 +150,11 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 字段的英文值
|
||||
/// </summary>
|
||||
public string CodeEn { get; set; } = string.Empty;
|
||||
public Guid? ParentId { get; set; }
|
||||
public bool IsEnable { get; set; }
|
||||
public Guid? ModuleTypeId { get; set; }
|
||||
@@ -220,6 +225,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public string ChildDataLabel { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前端渲染数组 数组名 和数组值 英文名称
|
||||
/// </summary>
|
||||
public string ChildDataEnLabel { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 子数据Value
|
||||
/// </summary>
|
||||
@@ -268,6 +279,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public string ForeignKeyText { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 英文的翻译
|
||||
/// </summary>
|
||||
public string ForeignKeyEnText { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 接口名
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 开始时候一些帮助 比如根据配置的字典生成枚举
|
||||
/// </summary>
|
||||
/// <param name="_dictionaryRepository"></param>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class DevelopService(IRepository<Dictionary> _dictionaryRepository) : BaseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据配置的字典名生成后端枚举
|
||||
/// </summary>
|
||||
/// <param name="dicName"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> BackDicGenerateEnum(string dicName)
|
||||
{
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,48 +13,21 @@ namespace IRaCIS.Application.Services
|
||||
/// </summary>
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class DictionaryService : BaseService, IDictionaryService
|
||||
public class DictionaryService (IRepository<Dictionary> _dicRepository,
|
||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||
IRepository<TrialDictionary> _trialDictionaryRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository,
|
||||
IRepository<TrialCriterionDictionaryCode> _trialCriterionDictionaryCodeRepository,
|
||||
IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> _readingSystemCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystem,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial
|
||||
) : BaseService, IDictionaryService
|
||||
{
|
||||
private readonly IRepository<Dictionary> _dicRepository;
|
||||
private readonly IRepository<DoctorDictionary> _doctorDictionaryRepository;
|
||||
private readonly IRepository<TrialDictionary> _trialDictionaryRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository;
|
||||
private readonly IRepository<TrialCriterionDictionaryCode> _trialCriterionDictionaryCodeRepository;
|
||||
private readonly IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingSystemCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystem;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
||||
|
||||
public DictionaryService(IRepository<Dictionary> sysDicRepository, IRepository<DoctorDictionary> doctorDictionaryRepository, IRepository<TrialDictionary> trialDictionaryRepository,
|
||||
IRepository<Doctor> doctorRepository, IRepository<Trial> trialRepository,
|
||||
|
||||
IRepository<SystemCriterionDictionaryCode> systemCriterionDictionaryCodeRepository,
|
||||
IRepository<TrialCriterionDictionaryCode> trialCriterionDictionaryCodeRepository,
|
||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> readingSystemCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystem,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial
|
||||
|
||||
|
||||
)
|
||||
{
|
||||
_dicRepository = sysDicRepository;
|
||||
_doctorDictionaryRepository = doctorDictionaryRepository;
|
||||
_trialDictionaryRepository = trialDictionaryRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_trialRepository = trialRepository;
|
||||
this._systemCriterionDictionaryCodeRepository = systemCriterionDictionaryCodeRepository;
|
||||
this._trialCriterionDictionaryCodeRepository = trialCriterionDictionaryCodeRepository;
|
||||
this._readingTrialCriterionDictionaryRepository = readingTrialCriterionDictionaryRepository;
|
||||
this._readingSystemCriterionDictionaryRepository = readingSystemCriterionDictionaryRepository;
|
||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._readingQuestionCriterionSystem = readingQuestionCriterionSystem;
|
||||
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加bool
|
||||
@@ -115,6 +88,14 @@ namespace IRaCIS.Application.Services
|
||||
IsVerify = true
|
||||
};
|
||||
|
||||
|
||||
if((addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Enum || addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Bool))
|
||||
{
|
||||
if(addBasicDicAndChild.ChildList.GroupBy(t => t.Code).Where(g => g.Count() > 1).Any())
|
||||
{
|
||||
return ResponseOutput.NotOk(_localizer["Dictionary_RepeateCode"]);
|
||||
}
|
||||
}
|
||||
|
||||
var entity = await _dicRepository.InsertFromDTOAsync(addBasicDicAndChild, false, verifyExp1);
|
||||
|
||||
@@ -135,27 +116,27 @@ namespace IRaCIS.Application.Services
|
||||
/// <summary>
|
||||
/// New 查询条件
|
||||
/// </summary>
|
||||
/// <param name="basicDicQuery"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<BasicDicView>> GetBasicDicList(BasicDicQuery basicDicQuery)
|
||||
public async Task<PageOutput<BasicDicView>> GetBasicDicList(BasicDicQuery inQuery)
|
||||
{
|
||||
|
||||
var systemBasicDataQueryable = _dicRepository.Where(t => t.ParentId == null)
|
||||
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.Code), t => t.Code.Contains(basicDicQuery.Code!))
|
||||
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.keyInfo), t => t.Description.Contains(basicDicQuery.keyInfo!)
|
||||
|| t.Code.Contains(basicDicQuery.keyInfo!)
|
||||
|| t.ChildList.Any(u => u.ValueCN.Contains(basicDicQuery.keyInfo!))
|
||||
|| t.ChildList.Any(u => u.Description.Contains(basicDicQuery.keyInfo!))
|
||||
|| t.ChildList.Any(u => u.Value.Contains(basicDicQuery.keyInfo!)))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), t => t.Code.Contains(inQuery.Code!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.keyInfo), t => t.Description.Contains(inQuery.keyInfo!)
|
||||
|| t.Code.Contains(inQuery.keyInfo!)
|
||||
|| t.ChildList.Any(u => u.ValueCN.Contains(inQuery.keyInfo!))
|
||||
|| t.ChildList.Any(u => u.Description.Contains(inQuery.keyInfo!))
|
||||
|| t.ChildList.Any(u => u.Value.Contains(inQuery.keyInfo!)))
|
||||
|
||||
.WhereIf(basicDicQuery.ConfigTypeId != null, t => t.ConfigTypeId == basicDicQuery.ConfigTypeId!)
|
||||
.WhereIf(basicDicQuery.DataTypeEnum != null, t => t.DataTypeEnum == basicDicQuery.DataTypeEnum)
|
||||
.WhereIf(basicDicQuery.DataTypeEnum == null, t => t.DataTypeEnum != DicDataTypeEnum.Config)
|
||||
.WhereIf(inQuery.ConfigTypeId != null, t => t.ConfigTypeId == inQuery.ConfigTypeId!)
|
||||
.WhereIf(inQuery.DataTypeEnum != null, t => t.DataTypeEnum == inQuery.DataTypeEnum)
|
||||
.WhereIf(inQuery.DataTypeEnum == null, t => t.DataTypeEnum != DicDataTypeEnum.Config)
|
||||
|
||||
.ProjectTo<BasicDicView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await systemBasicDataQueryable.ToPagedListAsync(basicDicQuery.PageIndex, basicDicQuery.PageSize, String.IsNullOrEmpty(basicDicQuery.SortField) ? nameof(BasicDicView.ConfigType) : basicDicQuery.SortField, basicDicQuery.Asc, String.IsNullOrEmpty(basicDicQuery.SortField), new[] { nameof(BasicDicView.ConfigType), nameof(BasicDicView.ShowOrder) });
|
||||
return await systemBasicDataQueryable.ToPagedListAsync(inQuery, new[] { nameof(BasicDicView.ConfigType), nameof(BasicDicView.ShowOrder) });
|
||||
}
|
||||
|
||||
|
||||
@@ -175,16 +156,15 @@ namespace IRaCIS.Application.Services
|
||||
IsVerify = addOrEditBasic.ParentId == null
|
||||
};
|
||||
|
||||
var verifyExp2 = new EntityVerifyExp<Dictionary>()
|
||||
{
|
||||
VerifyExp = t => t.Code == addOrEditBasic.Code && t.ParentId == addOrEditBasic.ParentId && t.Code==addOrEditBasic.Code,
|
||||
|
||||
VerifyMsg = _localizer["Dictionary_RepeateCode"],
|
||||
|
||||
IsVerify = addOrEditBasic.ParentId != null && (addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Enum || addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Bool)
|
||||
};
|
||||
|
||||
//// 验证阅片标准是否可禁用
|
||||
//if (!addOrEditBasic.IsEnable&&addOrEditBasic.Id!=null)
|
||||
//{
|
||||
// var result = await _readingQuestionService.SetSystemCriterionDisable(addOrEditBasic.Id.Value,addOrEditBasic.ParentId);
|
||||
// if (!result.IsSuccess)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (addOrEditBasic.Id != null && addOrEditBasic.ParentId == null)
|
||||
@@ -194,7 +174,7 @@ namespace IRaCIS.Application.Services
|
||||
//await _dicRepository.BatchUpdateNoTrackingAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum });
|
||||
}
|
||||
|
||||
var entity = await _dicRepository.InsertOrUpdateAsync(addOrEditBasic, true, verifyExp1);
|
||||
var entity = await _dicRepository.InsertOrUpdateAsync(addOrEditBasic, true, verifyExp1, verifyExp2);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
@@ -14,36 +15,47 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
/// 系统邮件配置表
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class EmailNoticeConfigService : BaseService, IEmailNoticeConfigService
|
||||
public class EmailNoticeConfigService(IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IRepository<EmailNoticeUserType> _emailNoticeUserTypeRepository) : BaseService, IEmailNoticeConfigService
|
||||
{
|
||||
private readonly IRepository<EmailNoticeConfig> _emailNoticeConfigrepository;
|
||||
private readonly IRepository<EmailNoticeUserType> _emailNoticeUserTypeRepository;
|
||||
|
||||
public EmailNoticeConfigService(IRepository<EmailNoticeConfig> repository, IRepository<EmailNoticeUserType> emailNoticeUserTypeRepository)
|
||||
{
|
||||
_emailNoticeConfigrepository = repository;
|
||||
_emailNoticeUserTypeRepository = emailNoticeUserTypeRepository;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
||||
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery inQuery)
|
||||
{
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
|
||||
.WhereIf(queryEmailNoticeConfig.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||
.WhereIf(queryEmailNoticeConfig.SystemLevel!=null, t =>t.SystemLevel == queryEmailNoticeConfig.SystemLevel)
|
||||
.WhereIf(queryEmailNoticeConfig.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == queryEmailNoticeConfig.IsDistinguishCriteria)
|
||||
.WhereIf(queryEmailNoticeConfig.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryEmailNoticeConfig.CriterionTypeEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
||||
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
||||
.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.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)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
|
||||
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||
{
|
||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum,
|
||||
|
||||
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
||||
};
|
||||
|
||||
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
||||
var regex = new Regex(@"\{\s*\d+\s*\}");
|
||||
|
||||
if (regex.Matches($"{addOrEditEmailNoticeConfig.EmailTopic}{addOrEditEmailNoticeConfig.EmailTopicCN}{addOrEditEmailNoticeConfig.EmailHtmlContent}{addOrEditEmailNoticeConfig.EmailHtmlContentCN}" )
|
||||
.Any(t=>t.Value.Contains(" ")))
|
||||
{
|
||||
//邮件模板占位符不允许有空格,请核查占位符的地方
|
||||
return ResponseOutput.NotOk("EmailNoticeConfig_ContainEmpty");
|
||||
}
|
||||
|
||||
|
||||
if (addOrEditEmailNoticeConfig.Id == null)
|
||||
{
|
||||
|
||||
@@ -63,7 +75,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
await _emailNoticeConfigrepository.AddAsync(entity, true);
|
||||
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
@@ -86,7 +98,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true);
|
||||
var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false,verifyExp1);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
|
||||
@@ -29,7 +29,20 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class ExcelExportService : BaseService
|
||||
public class ExcelExportService(IRepository<TrialUser> _trialUserRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<DicomStudy> _dicomStudyRepository,
|
||||
IRepository<QCChallenge> _qcChallengeRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||
IRepository<CommonDocument> _commonDocumentRepository,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<Subject> _subjectRepository) : BaseService
|
||||
{
|
||||
|
||||
|
||||
@@ -73,8 +86,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialMaintenanceDTO));
|
||||
@@ -119,8 +132,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -174,8 +187,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var exportInfo = data;
|
||||
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteUserSummaryDto));
|
||||
|
||||
@@ -300,8 +313,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var exportInfo = new ExcelExportInfo();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialToBeDoneDto));
|
||||
@@ -335,15 +348,15 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IRepository<Trial> _trialRepository
|
||||
)
|
||||
{
|
||||
var trialInfo = (await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _repository.Where<TrialDocNeedConfirmedUserType>(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId)
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
|
||||
join confirm in _repository.Where<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrainingRecordExportDTO()
|
||||
@@ -375,12 +388,12 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
|
||||
|
||||
var systemDocQuery = from needConfirmEdUserType in _repository.WhereIf<SystemDocNeedConfirmedUserType>(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrainingRecordExportDTO()
|
||||
{
|
||||
@@ -420,9 +433,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List=list;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialTrainingRecordList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrainingRecordExportDTO));
|
||||
@@ -476,8 +490,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
||||
@@ -535,8 +549,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCVisitImageList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
||||
@@ -563,7 +577,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(inQuery.VisitPlanArray);
|
||||
|
||||
var query = _repository.Where<QCChallenge>(x => x.TrialId == inQuery.TrialId)
|
||||
var query = _qcChallengeRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(inQuery.ReuploadEnum != null, t => t.ReuploadEnum == inQuery.ReuploadEnum)
|
||||
.WhereIf(inQuery.IsClosed != null, t => t.IsClosed == inQuery.IsClosed)
|
||||
@@ -585,8 +599,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto));
|
||||
}
|
||||
@@ -629,8 +643,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO));
|
||||
|
||||
@@ -657,8 +671,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
|
||||
var query = from subject in _repository.Where<Subject>(u => u.TrialId == dto.TrialId)
|
||||
join trialReadingCriterion in _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId) on subject.TrialId equals trialReadingCriterion.TrialId
|
||||
var query = from subject in _subjectRepository.Where(u => u.TrialId == dto.TrialId)
|
||||
join trialReadingCriterion in _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId) on subject.TrialId equals trialReadingCriterion.TrialId
|
||||
|
||||
select new SubjectProgressDto()
|
||||
{
|
||||
@@ -702,11 +716,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == dto.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
exportInfo.CriterionName = await _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.TrialSubjectProgressList_Export, exportInfo, /*"", */_commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectProgressDto));
|
||||
|
||||
@@ -798,7 +812,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _repository.Where<StudyMonitor>(t => t.TrialId == inQuery.TrialId, ignoreQueryFilters: true)
|
||||
var StudyMonitorQuery = _studyMonitorRepository.Where(t => t.TrialId == inQuery.TrialId, ignoreQueryFilters: true)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
@@ -851,8 +865,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyUploadMonitor_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyMonitorExportDto));
|
||||
@@ -879,7 +893,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var list = await _repository.Where<ReadModule>(u => u.TrialId == param.TrialId)
|
||||
var list = await _readModuleRepository.Where(u => u.TrialId == param.TrialId)
|
||||
|
||||
.ProjectTo<ReadPeriodExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
@@ -888,8 +902,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto));
|
||||
|
||||
@@ -913,7 +927,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
@@ -941,7 +955,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var svExpression2 = QCCommon.GetNoneDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
|
||||
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
@@ -978,8 +992,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == studyQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO));
|
||||
}
|
||||
@@ -1019,8 +1033,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO));
|
||||
}
|
||||
@@ -1042,7 +1056,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var list = await _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
@@ -1072,8 +1086,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _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));
|
||||
}
|
||||
@@ -1138,8 +1152,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto));
|
||||
}
|
||||
@@ -1198,8 +1212,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
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.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto));
|
||||
}
|
||||
@@ -1221,7 +1235,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
|
||||
if (criterion.CriterionType != CriterionType.RECIST1Point1)
|
||||
{
|
||||
@@ -1230,9 +1244,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
}
|
||||
//产生一致性分析的Subject
|
||||
|
||||
var subjectQuerybal = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == true).Select(t => t.SubjectId).Distinct();
|
||||
var subjectQuerybal = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == true).Select(t => t.SubjectId).Distinct();
|
||||
|
||||
var allList = await _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit)
|
||||
var allList = await _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit)
|
||||
.Where(t => (t.IsSelfAnalysis == true || t.IsSelfAnalysis == null) && t.VisitTaskNum > 0) //一致性分析的结果 + 正常任务的结果 + 仅仅访视的结果 +去除基线
|
||||
|
||||
//.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
@@ -1281,10 +1295,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
exportInfo.CriterionName = await _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSelfAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport));
|
||||
}
|
||||
@@ -1304,7 +1318,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
|
||||
if (criterion.CriterionType != CriterionType.RECIST1Point1)
|
||||
{
|
||||
@@ -1314,9 +1328,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
//产生组间一致性分析的Subject
|
||||
|
||||
var subjectQuerybal = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == false).Select(t => t.SubjectId).Distinct();
|
||||
var subjectQuerybal = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == false).Select(t => t.SubjectId).Distinct();
|
||||
|
||||
var allList = await _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit)
|
||||
var allList = await _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit)
|
||||
.Where(t => (t.IsSelfAnalysis == false || t.IsSelfAnalysis == null) && t.VisitTaskNum > 0) //一致性分析的结果 + 正常任务的结果 +仅仅访视的结果
|
||||
|
||||
//.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
@@ -1385,10 +1399,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
exportInfo.CriterionName = await _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync();
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(newList, _userInfo.TimeZoneId); ;
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialGroupAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport));
|
||||
}
|
||||
@@ -1427,7 +1441,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
var list = new List<ExportDocumentDes>();
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1)
|
||||
{
|
||||
@@ -1442,7 +1456,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion });
|
||||
}
|
||||
|
||||
var result = _repository.Where<CommonDocument>(t => list.Select(c => c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = _userInfo.IsEn_Us ? c.Name : c.NameCN }).ToList();
|
||||
var result = _commonDocumentRepository.Where(t => list.Select(c => c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = _userInfo.IsEn_Us ? c.Name : c.NameCN }).ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
@@ -1624,7 +1638,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
if (criterion.CriterionType != CriterionType.RECIST1Point1 && criterion.CriterionType != CriterionType.PCWG3)
|
||||
{
|
||||
@@ -1632,7 +1646,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
throw new Exception(_localizer["ExcelExport_UnsupportedExport"]);
|
||||
}
|
||||
|
||||
var list = await _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect)
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect)
|
||||
|
||||
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
|
||||
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
|
||||
@@ -1665,8 +1679,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType);
|
||||
@@ -1689,9 +1703,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstOrDefaultAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstOrDefaultAsync();
|
||||
|
||||
var query = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
var query = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
|
||||
//.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
//.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
@@ -1725,8 +1739,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType);
|
||||
@@ -1758,9 +1772,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstOrDefaultAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstOrDefaultAsync();
|
||||
|
||||
var query = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
var query = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
@@ -1814,8 +1828,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType);
|
||||
|
||||
@@ -1849,8 +1863,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId); ;
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
exportInfo.ClientZoneId = _userInfo.TimeZoneId;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PCWG3DetailedOfEvaluatedLesionExport), criterion.CriterionType);
|
||||
|
||||
|
||||
@@ -15,15 +15,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// ExploreRecommendService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class ExploreRecommendService : BaseService, IExploreRecommendService
|
||||
public class ExploreRecommendService(IRepository<ExploreRecommend> _exploreRecommendRepository) : BaseService, IExploreRecommendService
|
||||
{
|
||||
|
||||
private readonly IRepository<ExploreRecommend> _exploreRecommendRepository;
|
||||
|
||||
public ExploreRecommendService(IRepository<ExploreRecommend> exploreRecommendRepository)
|
||||
{
|
||||
_exploreRecommendRepository = exploreRecommendRepository;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ExploreRecommendView>> GetExploreRecommendList(ExploreRecommendQuery inQuery)
|
||||
@@ -40,8 +34,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ProjectTo<ExploreRecommendView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await exploreRecommendQueryable
|
||||
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(ExploreRecommendView.Id) : inQuery.SortField,
|
||||
inQuery.Asc);
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@@ -8,24 +8,15 @@ using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
public class FileService : IFileService
|
||||
public class FileService(
|
||||
IDoctorService _doctorService,
|
||||
IAttachmentService _attachmentService,
|
||||
IWebHostEnvironment _hostEnvironment) : IFileService
|
||||
|
||||
{
|
||||
private string defaultUploadFilePath = FileStoreHelper.GetIRaCISRootPath(_hostEnvironment);
|
||||
|
||||
private readonly IDoctorService _doctorService;
|
||||
private readonly IAttachmentService _attachmentService;
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
private string defaultUploadFilePath = string.Empty;
|
||||
private readonly ILogger<FileService> _logger;
|
||||
public FileService(IDoctorService doctorService, IAttachmentService attachmentService,
|
||||
IWebHostEnvironment hostEnvironment, ILogger<FileService> logger)
|
||||
{
|
||||
_doctorService = doctorService;
|
||||
_attachmentService = attachmentService;
|
||||
_hostEnvironment = hostEnvironment;
|
||||
|
||||
defaultUploadFilePath = FileStoreHelper.GetIRaCISRootPath(_hostEnvironment);
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打包医生官方简历
|
||||
@@ -41,7 +32,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
string uploadFolderPath = Path.Combine(FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment), "UploadFile");
|
||||
|
||||
|
||||
|
||||
|
||||
var tempSavePath = Path.Combine(uploadFolderPath, "temp", guidStr); //待压缩的文件夹,将需要下载的文件拷贝到此文件夹
|
||||
if (!Directory.Exists(tempSavePath))
|
||||
@@ -99,7 +90,7 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<string> CreateDoctorsAllAttachmentZip(Guid[] doctorIds)
|
||||
{
|
||||
#region 老版本 存储在服务器
|
||||
//准备下载文件的临时路径
|
||||
//准备下载文件的临时路径
|
||||
var guidStr = Guid.NewGuid().ToString();
|
||||
//string uploadFolderPath = HostingEnvironment.MapPath("/UploadFile/");
|
||||
string uploadFolderPath = Path.Combine(FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment), "UploadFile");
|
||||
@@ -136,7 +127,7 @@ namespace IRaCIS.Application.Services
|
||||
ZipHelper.CreateZip(tempSavePath, targetPath);
|
||||
return Path.Combine("/IRaCISData/UploadFile/", target + ".zip");
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EasyCaching.Core.Interceptor;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -19,16 +19,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// InternationalizationService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class InternationalizationService : BaseService, IInternationalizationService
|
||||
public class InternationalizationService (IRepository<Internationalization> _internationalizationRepository) : BaseService, IInternationalizationService
|
||||
{
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IRepository<Internationalization> _internationalizationRepository;
|
||||
|
||||
public InternationalizationService(IRepository<Internationalization> internationalizationRepository, IEasyCachingProvider provider)
|
||||
{
|
||||
_internationalizationRepository = internationalizationRepository;
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前端国际化内容接口
|
||||
@@ -38,7 +31,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpGet]
|
||||
public async Task<IEnumerable<InternationalizationSimpleDto>> GetFrontInternationalizationList()
|
||||
{
|
||||
var cacheList= _provider.Get<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front).Value;
|
||||
var cacheList = await _fusionCache.GetOrDefaultAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational);
|
||||
|
||||
//if(cacheList != null && cacheList.Count!=0)
|
||||
//{
|
||||
@@ -55,11 +48,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
Description = t.Description,
|
||||
}).ToListAsync();
|
||||
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, list, TimeSpan.FromDays(1));
|
||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, list, TimeSpan.FromDays(1));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -74,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var find = await _internationalizationRepository.FirstOrDefaultAsync(t => t.Code == item.Code && t.Description == item.Description && t.InternationalizationType == 0);
|
||||
|
||||
if (find != null)
|
||||
{
|
||||
{
|
||||
_mapper.Map(item, find);
|
||||
}
|
||||
else
|
||||
@@ -82,7 +75,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var mapItem = _mapper.Map<Internationalization>(item);
|
||||
mapItem.InternationalizationType = 0;
|
||||
|
||||
// 0 是预翻译 1是已确认 2是后端废弃
|
||||
// 0 是预翻译 1是已确认 2是后端废弃
|
||||
mapItem.State = 0;
|
||||
|
||||
await _internationalizationRepository.AddAsync(mapItem);
|
||||
@@ -91,7 +84,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _internationalizationRepository.SaveChangesAsync();
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -103,7 +96,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var internationalizationQueryable = _internationalizationRepository
|
||||
.WhereIf(inQuery.Description != null, t => t.Description.Contains(inQuery.Description))
|
||||
.WhereIf(inQuery.Module != null, t => t.Module.Contains(inQuery.Module))
|
||||
.WhereIf(inQuery.PublishLogId != null, t => t.PublishLogId==inQuery.PublishLogId)
|
||||
.WhereIf(inQuery.PublishLogId != null, t => t.PublishLogId == inQuery.PublishLogId)
|
||||
.WhereIf(inQuery.Code != null, t => t.Code.Contains(inQuery.Code))
|
||||
.WhereIf(inQuery.State != null, t => t.State == inQuery.State)
|
||||
.WhereIf(inQuery.InternationalizationType != null, t => t.InternationalizationType == inQuery.InternationalizationType)
|
||||
@@ -112,8 +105,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ProjectTo<InternationalizationView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await internationalizationQueryable
|
||||
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(InternationalizationView.State) : inQuery.SortField,
|
||||
inQuery.Asc);
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -148,7 +140,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _internationalizationRepository.SaveChangesAsync();
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -168,7 +160,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
VerifyExp = t => t.Code == addOrEditInternationalization.Code && t.InternationalizationType == addOrEditInternationalization.InternationalizationType,
|
||||
|
||||
VerifyMsg = $"该类型已有{addOrEditInternationalization.Code}名称的国际化标识",
|
||||
IsVerify = true /*internationalizationType == 1*/
|
||||
IsVerify = true /*internationalizationType == 1*/
|
||||
};
|
||||
|
||||
//前端验证标识重复与否
|
||||
@@ -184,12 +176,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (addOrEditInternationalization.InternationalizationType == 1)
|
||||
{
|
||||
await InternationalizationHelper.AddOrUpdateJsonKeyValueAsync(entity.Code, addOrEditInternationalization.Value, addOrEditInternationalization.ValueCN,addOrEditInternationalization.Description);
|
||||
await InternationalizationHelper.AddOrUpdateJsonKeyValueAsync(entity.Code, addOrEditInternationalization.Value, addOrEditInternationalization.ValueCN, addOrEditInternationalization.Description);
|
||||
}
|
||||
else
|
||||
{
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
}
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
@@ -202,7 +194,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var success = await _internationalizationRepository.DeleteFromQueryAsync(t => t.Id == internationalizationId, true);
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
@@ -214,7 +206,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> BatchUpdateInternationalInfo(BatchUpdateInfoCommand inCommand)
|
||||
{
|
||||
await _internationalizationRepository.BatchUpdateNoTrackingAsync(t => inCommand.IdList.Contains(t.Id), t => new Internationalization() { State = inCommand.State, PublishLogId = inCommand.PublishLogId });
|
||||
await _internationalizationRepository.BatchUpdateNoTrackingAsync(t => inCommand.IdList.Contains(t.Id), t => new Internationalization() { State = inCommand.State, PublishLogId = inCommand.PublishLogId });
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
@@ -53,51 +53,26 @@ namespace IRaCIS.Application.Services
|
||||
Task UserFeedBackMail(Guid feedBackId);
|
||||
}
|
||||
|
||||
public class MailVerificationService : BaseService, IMailVerificationService
|
||||
public class MailVerificationService(
|
||||
IRepository<VerificationCode> _verificationCodeRepository,
|
||||
IRepository<SystemBasicData> _systemBasicDatarepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<UserFeedBack> _userFeedBackRepository,
|
||||
ITokenService _tokenService,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<UserType> _userTypeRepository,
|
||||
IRepository<Doctor> _doctorTypeRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||
IDistributedLockProvider _distributedLockProvider) : BaseService, IMailVerificationService
|
||||
{
|
||||
private readonly IRepository<VerificationCode> _verificationCodeRepository;
|
||||
|
||||
private readonly IRepository<SystemBasicData> _systemBasicDatarepository;
|
||||
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
private readonly ITokenService _tokenService;
|
||||
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<UserType> _userTypeRepository;
|
||||
|
||||
private readonly IRepository<Doctor> _doctorTypeRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig;
|
||||
|
||||
private readonly IRepository<EmailNoticeConfig> _emailNoticeConfigrepository;
|
||||
|
||||
public MailVerificationService(IRepository<VerificationCode> verificationCodeRepository,
|
||||
IRepository<SystemBasicData> systemBasicDatarepository,
|
||||
IRepository<User> userRepository,
|
||||
ITokenService tokenService,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<UserType> userTypeRepository,
|
||||
IRepository<Doctor> doctorTypeRepository,
|
||||
IRepository<EmailNoticeConfig> emailNoticeConfigRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig, IDistributedLockProvider distributedLockProvider)
|
||||
{
|
||||
_systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
_verificationCodeRepository = verificationCodeRepository;
|
||||
_systemBasicDatarepository = systemBasicDatarepository;
|
||||
_tokenService = tokenService;
|
||||
_userRepository = userRepository;
|
||||
_trialRepository = trialRepository;
|
||||
|
||||
_userTypeRepository = userTypeRepository;
|
||||
_doctorTypeRepository = doctorTypeRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_emailNoticeConfigrepository = emailNoticeConfigRepository;
|
||||
}
|
||||
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
|
||||
|
||||
private async Task<EmailNoticeConfig> GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario scenario, MimeMessage messageToSend,
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
|
||||
{
|
||||
@@ -381,9 +356,9 @@ namespace IRaCIS.Application.Services
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
|
||||
|
||||
var trialInfo = await _repository.FirstOrDefaultAsync<Trial>(t => t.Id == trialSiteSurvey.TrialId);
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialSiteSurvey.TrialId);
|
||||
|
||||
var siteInfo = await _repository.FirstOrDefaultAsync<TrialSite>(t => t.TrialId == trialSiteSurvey.TrialId && t.Id == trialSiteSurvey.TrialSiteId, true);
|
||||
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialSiteSurvey.TrialId && t.Id == trialSiteSurvey.TrialSiteId, true);
|
||||
|
||||
|
||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
@@ -748,7 +723,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task UserFeedBackMail(Guid feedBackId)
|
||||
{
|
||||
var feedBack = await _repository.Where<UserFeedBack>(t => t.Id == feedBackId).Include(t => t.CreateUser).ThenInclude(t => t.UserTypeRole).FirstNotNullAsync();
|
||||
var feedBack = await _userFeedBackRepository.Where(t => t.Id == feedBackId).Include(t => t.CreateUser).ThenInclude(t => t.UserTypeRole).FirstNotNullAsync();
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
@@ -764,7 +739,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
var userTypeEnumList = emailConfigInfo.EmailNoticeUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList();
|
||||
|
||||
var emailList = await _repository.Where<User>(t => userTypeEnumList.Contains(t.UserTypeEnum) &&
|
||||
var emailList = await _userRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) &&
|
||||
(isHaveTrialId ? t.UserTrials.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.EMail, t.UserTypeEnum, t.FullName }).ToListAsync();
|
||||
|
||||
|
||||
@@ -779,10 +754,10 @@ namespace IRaCIS.Application.Services
|
||||
if (feedBack.VisitTaskId != null)
|
||||
{
|
||||
|
||||
var emailType = await _repository.Where<Dictionary>(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.IRImageError).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.IRImageError).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
var info = await _repository.Where<VisitTask>(t => t.Id == feedBack.VisitTaskId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.SourceSubjectVisit.VisitName }).FirstNotNullAsync();
|
||||
var info = await _visitTaskRepository.Where(t => t.Id == feedBack.VisitTaskId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.SourceSubjectVisit.VisitName }).FirstNotNullAsync();
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
@@ -809,10 +784,10 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
else if (feedBack.SubjectVisitId != null)
|
||||
{
|
||||
var emailType = await _repository.Where<Dictionary>(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialSubjectVisitFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialSubjectVisitFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
var info = await _repository.Where<SubjectVisit>(t => t.Id == feedBack.SubjectVisitId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.VisitName }).FirstNotNullAsync();
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == feedBack.SubjectVisitId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.VisitName }).FirstNotNullAsync();
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
@@ -840,10 +815,10 @@ namespace IRaCIS.Application.Services
|
||||
else if (feedBack.TrialId != null)
|
||||
{
|
||||
|
||||
var emailType = await _repository.Where<Dictionary>(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
var info = await _repository.Where<Trial>(t => t.Id == feedBack.TrialId).Select(t => new { t.ResearchProgramNo, t.TrialCode }).FirstNotNullAsync();
|
||||
var info = await _trialRepository.Where(t => t.Id == feedBack.TrialId).Select(t => new { t.ResearchProgramNo, t.TrialCode }).FirstNotNullAsync();
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
|
||||
@@ -17,15 +17,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// PublishLogService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class PublishLogService : BaseService, IPublishLogService
|
||||
public class PublishLogService(IRepository<PublishLog> _publishLogRepository) : BaseService, IPublishLogService
|
||||
{
|
||||
|
||||
private readonly IRepository<PublishLog> _publishLogRepository;
|
||||
|
||||
public PublishLogService(IRepository<PublishLog> publishLogRepository)
|
||||
{
|
||||
_publishLogRepository = publishLogRepository;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<PublishLogView>> GetPublishLogList(PublishLogQuery inQuery)
|
||||
@@ -38,7 +32,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ProjectTo<PublishLogView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await publishLogQueryable
|
||||
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@@ -12,34 +12,30 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// SystemBasicDataService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class SystemBasicDataService : BaseService, ISystemBasicDataService
|
||||
public class SystemBasicDataService(IRepository<SystemBasicData> _systemBasicDataRepository) : BaseService, ISystemBasicDataService
|
||||
{
|
||||
private readonly IRepository<SystemBasicData> _systemBasicDataRepository;
|
||||
|
||||
public SystemBasicDataService(IRepository<SystemBasicData> systemBasicDataRepository) {
|
||||
this._systemBasicDataRepository = systemBasicDataRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 模板列表
|
||||
/// </summary>
|
||||
/// <param name="querySystemBasicData"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery querySystemBasicData)
|
||||
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery inQuery)
|
||||
{
|
||||
var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null)
|
||||
.ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await systemBasicDataQueryable.ToPagedListAsync(querySystemBasicData.PageIndex, querySystemBasicData.PageSize, String.IsNullOrEmpty(querySystemBasicData.SortField) ? "Code" : querySystemBasicData.SortField, querySystemBasicData.Asc);
|
||||
return await systemBasicDataQueryable.ToPagedListAsync(inQuery,nameof(SystemBasicDataView.Code));
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{code}")]
|
||||
public async Task<SystemBasicDataView> GetSystemBasicData(string code)
|
||||
{
|
||||
return (await _repository.Where<SystemBasicData>(t => t.Code == code).ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
return (await _systemBasicDataRepository.Where(t => t.Code == code).ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,14 +12,9 @@ namespace IRaCIS.Application.Services
|
||||
/// 医生文档关联关系维护
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class AttachmentService : BaseService, IAttachmentService
|
||||
public class AttachmentService(IRepository<Attachment> _attachmentrepository) : BaseService, IAttachmentService
|
||||
{
|
||||
private readonly IRepository<Attachment> _attachmentrepository;
|
||||
|
||||
public AttachmentService(IRepository<Attachment> attachmentrepository)
|
||||
{
|
||||
this._attachmentrepository = attachmentrepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除附件
|
||||
@@ -164,8 +159,8 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
var newAttachment = attachments.Where(t => t.Id == Guid.Empty);
|
||||
|
||||
await _repository.AddRangeAsync(newAttachment);
|
||||
await _repository.SaveChangesAsync();
|
||||
await _attachmentrepository.AddRangeAsync(newAttachment);
|
||||
await _attachmentrepository.SaveChangesAsync();
|
||||
|
||||
//_doctorAttachmentRepository.AddRange(newAttachment);
|
||||
//_doctorAttachmentRepository.SaveChanges();
|
||||
@@ -189,8 +184,8 @@ namespace IRaCIS.Application.Services
|
||||
attachment.IsOfficial = true;
|
||||
}
|
||||
|
||||
await _repository.AddAsync(newAttachment);
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
await _attachmentrepository.AddAsync(newAttachment);
|
||||
var success = await _attachmentrepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success, attachment);
|
||||
}
|
||||
|
||||
@@ -219,15 +214,14 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost("{doctorId:guid}/{attachmentId:guid}/{language}")]
|
||||
public async Task<IResponseOutput> SetOfficial(Guid doctorId, Guid attachmentId, int language)
|
||||
{
|
||||
var resumeList = await _attachmentrepository.Where(t => t.DoctorId == doctorId && t.Type == "Resume" && t.Language == language).ToListAsync();
|
||||
var resumeList = await _attachmentrepository.Where(t => t.DoctorId == doctorId && t.Type == "Resume" && t.Language == language,true).ToListAsync();
|
||||
foreach (var item in resumeList)
|
||||
{
|
||||
if (item.Id == attachmentId) item.IsOfficial = true;
|
||||
else item.IsOfficial = false;
|
||||
await _repository.UpdateAsync(item);
|
||||
}
|
||||
|
||||
return ResponseOutput.Result(await _repository.SaveChangesAsync());
|
||||
return ResponseOutput.Result(await _attachmentrepository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,51 +8,50 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class DoctorListService : BaseService, IDoctorListQueryService
|
||||
public class DoctorListService (
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<EnrollDetail> _enrollDetailRepository,
|
||||
IRepository<Trial> _trialRepository) : BaseService, IDoctorListQueryService
|
||||
{
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
|
||||
public DoctorListService(IRepository<Doctor> doctorRepository)
|
||||
{
|
||||
_doctorRepository = doctorRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reviewer列表分页查询
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO doctorSearch)
|
||||
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO inQuery)
|
||||
{
|
||||
|
||||
// 项目经验 多选
|
||||
var evaluationCriteriaCount = doctorSearch.EvaluationCriteriaIdList.Count();
|
||||
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
|
||||
|
||||
// 搜索条件 ReadingType 、Subspeciality、Title 多选
|
||||
var count = doctorSearch.ReadingTypeIdList.Count + doctorSearch.TitleIdList.Count + doctorSearch.SubspecialityIdList.Count;
|
||||
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
|
||||
|
||||
var guidList = doctorSearch.ReadingTypeIdList.Concat(doctorSearch.SubspecialityIdList).Concat(doctorSearch.TitleIdList);
|
||||
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
|
||||
|
||||
|
||||
var query = _doctorRepository.AsQueryable()
|
||||
.WhereIf(doctorSearch.DepartmentId != null, t => t.DepartmentId == doctorSearch.DepartmentId)
|
||||
.WhereIf(doctorSearch.SpecialityId != null, t => t.SpecialityId == doctorSearch.SpecialityId)
|
||||
.WhereIf(doctorSearch.HospitalId != null, t => t.HospitalId == doctorSearch.HospitalId)
|
||||
.WhereIf(doctorSearch.PositionId != null, t => t.PositionId == doctorSearch.PositionId)
|
||||
.WhereIf(doctorSearch.RankId != null, t => t.RankId == doctorSearch.RankId)
|
||||
.WhereIf(doctorSearch.ContractorStatus != null, t => t.CooperateStatus == doctorSearch.ContractorStatus)
|
||||
.WhereIf(doctorSearch.InformationConfirmed != null, t => t.ResumeStatus == doctorSearch.InformationConfirmed)
|
||||
.WhereIf(doctorSearch.AcceptingNewTrial != null, t => t.AcceptingNewTrial == doctorSearch.AcceptingNewTrial)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(doctorSearch.Name), t => t.ChineseName.Contains(doctorSearch.Name) || (t.LastName + t.FirstName).Contains(doctorSearch.Name))
|
||||
.WhereIf(doctorSearch.Nation != null, t => t.Nation == doctorSearch.Nation)
|
||||
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => doctorSearch.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
|
||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
|
||||
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
|
||||
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
|
||||
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus)
|
||||
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
|
||||
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.Nation != null, t => t.Nation == inQuery.Nation)
|
||||
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
|
||||
////用户类型 看到简历的范围这里需要确认
|
||||
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
|
||||
.WhereIf(doctorSearch.EnrollStatus != null && doctorSearch.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
|
||||
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
|
||||
|
||||
.ProjectTo<DoctorDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToPagedListAsync(doctorSearch.PageIndex, doctorSearch.PageSize, doctorSearch.SortField == string.Empty ? "CreateTime" : doctorSearch.SortField, doctorSearch.Asc);
|
||||
return await query.ToPagedListAsync(inQuery, nameof(DoctorDTO.CreateTime));
|
||||
|
||||
|
||||
}
|
||||
@@ -64,45 +63,45 @@ namespace IRaCIS.Application.Services
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SelectionReviewerDTO>> GetSelectionReviewerList(
|
||||
ReviewerSelectionQueryDTO selectionQuery)
|
||||
ReviewerSelectionQueryDTO inQuery)
|
||||
{
|
||||
//项目配置需要的医生过滤 2表示混合
|
||||
var trialConfig = await _repository.Where<Trial>(s => s.Id == selectionQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
|
||||
var trialConfig = await _trialRepository.Where(s => s.Id == inQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
|
||||
|
||||
//var nation = trialConfig.AttendedReviewerType;
|
||||
// 临床项目经验 多选
|
||||
var evaluationCriteriaCount = selectionQuery.EvaluationCriteriaIdList.Count();
|
||||
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
|
||||
|
||||
// 搜索条件 ReadingType 、Subspeciality、Title 多选
|
||||
var count = selectionQuery.ReadingTypeIdList.Count + selectionQuery.TitleIdList.Count + selectionQuery.SubspecialityIdList.Count;
|
||||
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
|
||||
|
||||
var guidList = selectionQuery.ReadingTypeIdList.Concat(selectionQuery.SubspecialityIdList).Concat(selectionQuery.TitleIdList);
|
||||
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
|
||||
|
||||
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
|
||||
|
||||
.WhereIf(selectionQuery.DepartmentId != null, t => t.DepartmentId == selectionQuery.DepartmentId)
|
||||
.WhereIf(selectionQuery.SpecialityId != null, t => t.SpecialityId == selectionQuery.SpecialityId)
|
||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||
.WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual ==true)
|
||||
.WhereIf(trialConfig.TrialType != TrialType.NoneOfficial, t => t.IsVirtual == false)
|
||||
.WhereIf(selectionQuery.HospitalId != null, t => t.HospitalId == selectionQuery.HospitalId)
|
||||
.WhereIf(selectionQuery.PositionId != null, t => t.PositionId == selectionQuery.PositionId)
|
||||
.WhereIf(selectionQuery.RankId != null, t => t.RankId == selectionQuery.RankId)
|
||||
.WhereIf(selectionQuery.ContractorStatus != null, t => t.CooperateStatus == selectionQuery.ContractorStatus )
|
||||
.WhereIf(selectionQuery.InformationConfirmed != null, t => t.ResumeStatus == selectionQuery.InformationConfirmed)
|
||||
.WhereIf(selectionQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == selectionQuery.AcceptingNewTrial)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(selectionQuery.Name), t => t.ChineseName.Contains(selectionQuery.Name) || (t.LastName + t.FirstName).Contains(selectionQuery.Name))
|
||||
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => selectionQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
|
||||
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
|
||||
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
|
||||
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
|
||||
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus )
|
||||
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
|
||||
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
|
||||
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
|
||||
//用户类型 看到简历的范围这里需要确认
|
||||
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
|
||||
.WhereIf(selectionQuery.EnrollStatus != null && selectionQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
|
||||
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
|
||||
|
||||
.ProjectTo<SelectionReviewerDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
var result = await query.ToPagedListAsync(selectionQuery.PageIndex, selectionQuery.PageSize, selectionQuery.SortField == string.Empty ? "ReviewerCode" : selectionQuery.SortField, selectionQuery.Asc);
|
||||
var result = await query.ToPagedListAsync(inQuery);
|
||||
|
||||
//是否已申请 申请时间 申请人
|
||||
var doctorStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == selectionQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
|
||||
var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
|
||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
result.CurrentPageData.ToList().ForEach(doctor =>
|
||||
@@ -130,24 +129,24 @@ namespace IRaCIS.Application.Services
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ConfirmationReviewerDTO>> GetSubmissionOrApprovalReviewerList(
|
||||
ReviewerSubmissionQueryDTO param)
|
||||
ReviewerSubmissionQueryDTO inQuery)
|
||||
{
|
||||
|
||||
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId)
|
||||
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||
//提交CRO 以及下载简历列表
|
||||
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
|
||||
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
|
||||
//CRO确认列表 状态为 已提交CRO
|
||||
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
|
||||
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
|
||||
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
|
||||
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
|
||||
var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||
//提交CRO 以及下载简历列表
|
||||
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
|
||||
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
|
||||
//CRO确认列表 状态为 已提交CRO
|
||||
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
|
||||
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
|
||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
@@ -158,22 +157,22 @@ namespace IRaCIS.Application.Services
|
||||
var opt = enrollStateList.FirstOrDefault(t => t.DoctorId == u.Id);
|
||||
if (opt != null)
|
||||
{
|
||||
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
|
||||
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
|
||||
u.OptTime = opt.OptTime;
|
||||
u.OptUserName = opt.OptUserName;
|
||||
}
|
||||
else
|
||||
{
|
||||
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
|
||||
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
|
||||
}
|
||||
});
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
|
||||
{
|
||||
//SPM 要看到提交的时间 提交人
|
||||
var enrollCommitList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
|
||||
var enrollCommitList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||
//提交CRO 以及下载简历列表
|
||||
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
|
||||
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
|
||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
@@ -200,7 +199,7 @@ namespace IRaCIS.Application.Services
|
||||
//public async Task<PageOutput<ConfirmationReviewerDTO>> GetSPMSubmissionOrApprovalReviewerList(
|
||||
// ReviewerSubmissionQueryDTO param)
|
||||
//{
|
||||
// var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId)
|
||||
// var doctorQuery = _enrollRepository(x => x.TrialId == param.TrialId)
|
||||
// //提交CRO 以及下载简历列表
|
||||
// .WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus >= (int)EnrollStatus.HasApplyDownloadResume)
|
||||
// //CRO确认列表 状态为 已提交CRO
|
||||
@@ -210,7 +209,7 @@ namespace IRaCIS.Application.Services
|
||||
// var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
|
||||
|
||||
|
||||
// var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
|
||||
// var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == param.TrialId)
|
||||
// //提交CRO 以及下载简历列表
|
||||
// .WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus == (int)EnrollStatus.HasCommittedToCRO)
|
||||
// //CRO确认列表 状态为 已提交CRO
|
||||
@@ -237,16 +236,16 @@ namespace IRaCIS.Application.Services
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ConfirmationReviewerDTO>> GetConfirmationReviewerList(
|
||||
ReviewerConfirmationQueryDTO param)
|
||||
ReviewerConfirmationQueryDTO inQuery)
|
||||
{
|
||||
|
||||
|
||||
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
|
||||
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
|
||||
|
||||
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
|
||||
var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
|
||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
|
||||
@@ -9,40 +9,18 @@ using System.Linq.Expressions;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class DoctorService : BaseService, IDoctorService
|
||||
public class DoctorService(
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<Attachment> _attachmentRepository,
|
||||
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<Vacation> _vacationRepository,
|
||||
IRepository<TrialPaymentPrice> _trialExtRepository
|
||||
) : BaseService, IDoctorService
|
||||
{
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
private readonly IRepository<DoctorDictionary> _doctorDictionaryRepository;
|
||||
private readonly IRepository<Attachment> _attachmentRepository;
|
||||
private readonly IRepository<DoctorCriterionFile> _doctorCriterionFileRepository;
|
||||
private readonly IRepository<UserDoctor> _userDoctorRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialPaymentPrice> _trialExtRepository;
|
||||
private readonly IRepository<Vacation> _vacationRepository;
|
||||
|
||||
|
||||
|
||||
public DoctorService(IRepository<Doctor> doctorInfoRepository,
|
||||
IRepository<Dictionary> dictionaryRepository,
|
||||
IRepository<Enroll> intoGroupRepository,
|
||||
IRepository<DoctorDictionary> doctorDictionaryRepository,
|
||||
IRepository<Attachment> attachmentRepository,
|
||||
IRepository<DoctorCriterionFile> doctorCriterionFileRepository,
|
||||
IRepository<UserDoctor> userDoctorRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<TrialPaymentPrice> trialExtRepository, IRepository<Vacation> vacationRepository)
|
||||
{
|
||||
_doctorRepository = doctorInfoRepository;
|
||||
_enrollRepository = intoGroupRepository;
|
||||
_doctorDictionaryRepository = doctorDictionaryRepository;
|
||||
_attachmentRepository = attachmentRepository;
|
||||
this._doctorCriterionFileRepository = doctorCriterionFileRepository;
|
||||
_userDoctorRepository = userDoctorRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_trialExtRepository = trialExtRepository;
|
||||
_vacationRepository = vacationRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -95,7 +73,7 @@ namespace IRaCIS.Application.Services
|
||||
//await _repository.AddAsync(new UserDoctor() { DoctorId = doctor.Id, UserId = _userInfo.Id });
|
||||
//_userDoctorRepository.Add(new UserDoctor() { DoctorId = doctor.Id, UserId = _userInfo.Id });
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _doctorDictionaryRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success, _mapper.Map<DoctorBasicInfoCommand>(doctor));
|
||||
|
||||
}
|
||||
@@ -119,18 +97,18 @@ namespace IRaCIS.Application.Services
|
||||
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();
|
||||
|
||||
//删除中间表 Title对应的记录
|
||||
await _repository.BatchDeleteAsync<DoctorDictionary>(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
|
||||
await _doctorDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
|
||||
|
||||
|
||||
var adddata = new List<DoctorDictionary>();
|
||||
//重新插入新的 Title记录
|
||||
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
|
||||
|
||||
await _repository.AddRangeAsync(adddata);
|
||||
await _doctorDictionaryRepository.AddRangeAsync(adddata);
|
||||
|
||||
_mapper.Map(basicInfoModel, doctor);
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _doctorDictionaryRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success, basicInfoModel);
|
||||
|
||||
@@ -319,7 +297,7 @@ namespace IRaCIS.Application.Services
|
||||
#endregion
|
||||
|
||||
|
||||
var entity = await _repository.InsertOrUpdateAsync<Doctor, EmploymentCommand>(doctorWorkInfoModel, true);
|
||||
var entity = await _doctorRepository.InsertOrUpdateAsync(doctorWorkInfoModel, true);
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
@@ -388,7 +366,7 @@ namespace IRaCIS.Application.Services
|
||||
//_doctorDictionaryRepository.Delete(t =>
|
||||
// t.DoctorId == specialtyUpdateModel.Id && t.KeyName == StaticData.ReadingType);
|
||||
|
||||
await _repository.BatchDeleteAsync<DoctorDictionary>(t =>
|
||||
await _doctorDictionaryRepository.BatchDeleteNoTrackingAsync(t =>
|
||||
t.DoctorId == specialtyUpdateModel.Id && (t.KeyName == StaticData.Subspeciality || t.KeyName == StaticData.ReadingType));
|
||||
|
||||
|
||||
@@ -412,11 +390,11 @@ namespace IRaCIS.Application.Services
|
||||
DictionaryId = subspecialityId
|
||||
}));
|
||||
|
||||
await _repository.AddRangeAsync(adddata);
|
||||
await _doctorDictionaryRepository.AddRangeAsync(adddata);
|
||||
|
||||
_mapper.Map(specialtyUpdateModel, doctor);
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _doctorDictionaryRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
|
||||
|
||||
@@ -542,7 +520,7 @@ namespace IRaCIS.Application.Services
|
||||
var doctor = (await _doctorRepository
|
||||
.ProjectTo<ResumeConfirmDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync(t => t.Id == doctorId)).IfNullThrowException();
|
||||
|
||||
doctor.InHoliday = (await _repository.CountAsync<Vacation>(x => x.DoctorId == doctorId && x.EndDate <= appDateTimeNow && x.StartDate <= appDateTimeNow)) > 0;
|
||||
doctor.InHoliday = (await _vacationRepository.CountAsync(x => x.DoctorId == doctorId && x.EndDate <= appDateTimeNow && x.StartDate <= appDateTimeNow)) > 0;
|
||||
|
||||
return doctor;
|
||||
}
|
||||
|
||||
@@ -10,18 +10,11 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class EducationService : BaseService, IEducationService
|
||||
public class EducationService(
|
||||
IRepository<Postgraduate> _postgraduateRepository,
|
||||
IRepository<Education> _educationRepository) : BaseService, IEducationService
|
||||
{
|
||||
private readonly IRepository<Postgraduate> _postgraduateRepository;
|
||||
private readonly IRepository<Education> _educationRepository;
|
||||
|
||||
public EducationService(IRepository<Education> doctorNormalEducationRepository,
|
||||
IRepository<Postgraduate> doctorContinueLearningRepository)
|
||||
{
|
||||
_educationRepository = doctorNormalEducationRepository;
|
||||
_postgraduateRepository = doctorContinueLearningRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据医生Id获取医生教育经历和继续学习经历列表
|
||||
/// </summary>
|
||||
@@ -66,7 +59,7 @@ namespace IRaCIS.Application.Services
|
||||
break;
|
||||
}
|
||||
await _educationRepository.AddAsync(doctorEducationInfo);
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _educationRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success, doctorEducationInfo.Id.ToString());
|
||||
}
|
||||
@@ -79,7 +72,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
_mapper.Map(educationInfoViewModel, needUpdate);
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _educationRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
|
||||
@@ -121,7 +114,7 @@ namespace IRaCIS.Application.Services
|
||||
//}
|
||||
#endregion
|
||||
|
||||
var entity = await _repository.InsertOrUpdateAsync<Postgraduate, PostgraduateCommand>(postgraduateViewModel, true);
|
||||
var entity = await _postgraduateRepository.InsertOrUpdateAsync(postgraduateViewModel, true);
|
||||
return ResponseOutput.Ok(entity.Id);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -133,7 +126,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpDelete("{doctorId:guid}")]
|
||||
public async Task<IResponseOutput> DeletePostgraduateInfo(Guid doctorId)
|
||||
{
|
||||
var success = await _repository.BatchDeleteAsync<Postgraduate>(o => o.Id == doctorId);
|
||||
var success = await _postgraduateRepository.BatchDeleteNoTrackingAsync(o => o.Id == doctorId);
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,9 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class ResearchPublicationService : BaseService, IResearchPublicationService
|
||||
public class ResearchPublicationService(IRepository<ResearchPublication> _researchPublicationRepository) : BaseService, IResearchPublicationService
|
||||
{
|
||||
private readonly IRepository<ResearchPublication> researchPublicationRepository;
|
||||
|
||||
public ResearchPublicationService(IRepository<ResearchPublication> _researchPublicationRepository)
|
||||
{
|
||||
researchPublicationRepository = _researchPublicationRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询-医生科学研究信息
|
||||
@@ -22,7 +17,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpGet("{doctorId:guid}")]
|
||||
public async Task<ResearchPublicationDTO> GetResearchPublication(Guid doctorId)
|
||||
{
|
||||
var doctorScientificResearchInfo = await researchPublicationRepository.Where(o => o.DoctorId == doctorId)
|
||||
var doctorScientificResearchInfo = await _researchPublicationRepository.Where(o => o.DoctorId == doctorId)
|
||||
.ProjectTo<ResearchPublicationDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
return doctorScientificResearchInfo!;
|
||||
@@ -33,7 +28,7 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> AddOrUpdateResearchPublication(ResearchPublicationDTO param)
|
||||
{
|
||||
|
||||
var entity = await _repository.InsertOrUpdateAsync<ResearchPublication, ResearchPublicationDTO>(param, true);
|
||||
var entity = await _researchPublicationRepository.InsertOrUpdateAsync(param, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id);
|
||||
}
|
||||
|
||||
@@ -5,24 +5,14 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class TrialExperienceService : BaseService, ITrialExperienceService
|
||||
public class TrialExperienceService(
|
||||
IRepository<TrialExperience> _trialExperienceRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
||||
IRepository<Attachment> _attachmentRepository
|
||||
) : BaseService, ITrialExperienceService
|
||||
{
|
||||
private readonly IRepository<TrialExperience> _trialExperienceRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<Attachment> _attachmentRepository;
|
||||
private readonly IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository;
|
||||
|
||||
|
||||
|
||||
public TrialExperienceService(IRepository<TrialExperience> trialExperienceRepository, IRepository<Doctor> doctorRepository, IRepository<Attachment> attachmentRepository,
|
||||
IRepository<TrialExperienceCriteria> trialExperienceCriteriaRepository)
|
||||
{
|
||||
_trialExperienceRepository = trialExperienceRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_attachmentRepository = attachmentRepository;
|
||||
_trialExperienceCriteriaRepository = trialExperienceCriteriaRepository;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -78,7 +68,7 @@ namespace IRaCIS.Application.Services
|
||||
var trialExperience =
|
||||
_mapper.Map<TrialExperience>(trialExperienceViewModel);
|
||||
|
||||
trialExperience = await _repository.AddAsync(trialExperience);
|
||||
trialExperience = await _trialExperienceRepository.AddAsync(trialExperience);
|
||||
|
||||
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
||||
trialExperienceViewModel.EvaluationCriteriaIdList.ForEach(t => criteriaList.Add(new TrialExperienceCriteria()
|
||||
@@ -89,22 +79,20 @@ namespace IRaCIS.Application.Services
|
||||
TrialExperienceId = trialExperience.Id
|
||||
}));
|
||||
|
||||
await _repository.AddRangeAsync(criteriaList);
|
||||
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _trialExperienceCriteriaRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success, trialExperience.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
var needUpdate = await _trialExperienceRepository.FirstOrDefaultAsync(t => t.Id == trialExperienceViewModel.Id);
|
||||
var needUpdate = trialExperienceViewModel;
|
||||
|
||||
if (needUpdate == null) return Null404NotFound(needUpdate);
|
||||
|
||||
_mapper.Map(trialExperienceViewModel, needUpdate);
|
||||
await _repository.UpdateAsync(needUpdate);
|
||||
await _trialExperienceRepository.UpdateFromDTOAsync(trialExperienceViewModel);
|
||||
|
||||
await _repository.BatchDeleteAsync<TrialExperienceCriteria>(t => t.TrialExperienceId == needUpdate.Id);
|
||||
await _trialExperienceCriteriaRepository.BatchDeleteNoTrackingAsync(t => t.TrialExperienceId == needUpdate.Id);
|
||||
|
||||
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
||||
|
||||
@@ -112,13 +100,13 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
DoctorId = trialExperienceViewModel.DoctorId,
|
||||
EvaluationCriteriaId = t,
|
||||
TrialExperienceId = needUpdate.Id
|
||||
TrialExperienceId = needUpdate.Id.Value
|
||||
}));
|
||||
|
||||
await _repository.AddRangeAsync<TrialExperienceCriteria>(criteriaList);
|
||||
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _trialExperienceCriteriaRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success, trialExperienceViewModel.Id);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +118,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpDelete, Route("{doctorId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialExperience(Guid doctorId)
|
||||
{
|
||||
var success = await _repository.BatchDeleteAsync<TrialExperience>(o => o.Id == doctorId);
|
||||
var success = await _trialExperienceRepository.BatchDeleteNoTrackingAsync(o => o.Id == doctorId);
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -144,7 +132,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
//_attachmentRepository.Delete(t => t.DoctorId == updateGCPExperienceParam.Id && t.Type == StaticData.GCP);
|
||||
|
||||
var successs = await _repository.BatchUpdateAsync<Doctor>(o => o.Id == updateGCPExperienceParam.Id, u => new Doctor()
|
||||
var successs = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == updateGCPExperienceParam.Id, u => new Doctor()
|
||||
{
|
||||
GCP = updateGCPExperienceParam.GCP,
|
||||
GCPId = (updateGCPExperienceParam.GCP==0||updateGCPExperienceParam.GCPId==null)?Guid.Empty: updateGCPExperienceParam.GCPId!.Value
|
||||
@@ -152,7 +140,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
if (updateGCPExperienceParam.GCP == 0 )
|
||||
{
|
||||
await _repository.BatchDeleteAsync<Attachment>(a => a.DoctorId == updateGCPExperienceParam.Id && a.Type=="GCP");
|
||||
await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == updateGCPExperienceParam.Id && a.Type=="GCP");
|
||||
}
|
||||
|
||||
return ResponseOutput.Result(successs, updateGCPExperienceParam.GCPId.ToString());
|
||||
@@ -166,7 +154,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> UpdateOtherExperience(ClinicalExperienceCommand updateOtherClinicalExperience)
|
||||
{
|
||||
var success = await _repository.BatchUpdateAsync<Doctor>(o => o.Id == updateOtherClinicalExperience.DoctorId, u => new Doctor()
|
||||
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == updateOtherClinicalExperience.DoctorId, u => new Doctor()
|
||||
{
|
||||
OtherClinicalExperience = updateOtherClinicalExperience.OtherClinicalExperience ?? string.Empty,
|
||||
OtherClinicalExperienceCN = updateOtherClinicalExperience.OtherClinicalExperienceCN ?? string.Empty
|
||||
|
||||
@@ -7,14 +7,9 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class VacationService : BaseService, IVacationService
|
||||
public class VacationService (IRepository<Vacation> _vacationRepository) : BaseService, IVacationService
|
||||
{
|
||||
private readonly IRepository<Vacation> _vacationRepository;
|
||||
|
||||
public VacationService(IRepository<Vacation> vacationRepository)
|
||||
{
|
||||
_vacationRepository = vacationRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加休假时间段
|
||||
/// </summary>
|
||||
@@ -28,7 +23,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var result = await _vacationRepository.AddAsync(_mapper.Map<Vacation>(param));
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _vacationRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success, result.Id);
|
||||
|
||||
@@ -72,7 +67,7 @@ namespace IRaCIS.Application.Services
|
||||
var query = _vacationRepository.Where(u => u.DoctorId == doctorId)
|
||||
.ProjectTo<VacationCommand>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToPagedListAsync(pageIndex, pageSize, "StartDate");
|
||||
return await query.ToPagedListAsync(new PageInput() { PageIndex = pageIndex,PageSize=pageSize },nameof(VacationCommand.StartDate));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -34,23 +34,19 @@ namespace IRaCIS.Core.Application.Service
|
||||
Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null);
|
||||
}
|
||||
|
||||
public class EmailSendService : BaseService, IEmailSendService
|
||||
public class EmailSendService(
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUser> _trialUserRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : BaseService, IEmailSendService
|
||||
{
|
||||
private readonly IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository;
|
||||
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
private readonly IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig;
|
||||
|
||||
|
||||
public static string EmailNamePlaceholder => StaticData. EmailSend.EmailNamePlaceholder;
|
||||
|
||||
public EmailSendService(IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository, IRepository<Trial> trialRepository, IOptionsMonitor<SystemEmailSendConfig> systemEmailSendConfig)
|
||||
{
|
||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_SystemEmailSendConfig = systemEmailSendConfig;
|
||||
}
|
||||
|
||||
|
||||
//入组确认/PD确认
|
||||
|
||||
@@ -73,7 +69,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
result = isPDConfirm;
|
||||
}
|
||||
|
||||
var taskInfo = await _repository.Where<VisitTask>(t => t.Id == visitTaskId).Select(t => new
|
||||
var taskInfo = await _visitTaskRepository.Where(t => t.Id == visitTaskId).Select(t => new
|
||||
{
|
||||
t.Subject.TrialSiteId,
|
||||
t.Trial.ResearchProgramNo,
|
||||
@@ -131,10 +127,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task SendTrialImageQCTaskEmailAsync(Guid trialId)
|
||||
{
|
||||
var isEn_us = false;
|
||||
var trialInfo = await _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的IQC 用户Id
|
||||
var userList = await _repository.Where<TrialUser>(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
var userIdList = userList.Select(t => t.UserId).ToList();
|
||||
@@ -184,10 +180,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task SendTrialQCQuestionEmailAsync(Guid trialId)
|
||||
{
|
||||
var isEn_us = false;
|
||||
var trialInfo =await _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync();
|
||||
var trialInfo =await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的IQC 用户Id
|
||||
var userList = await _repository.Where<TrialUser>(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
|
||||
@@ -239,10 +235,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var isEn_us = false;
|
||||
|
||||
var trialInfo = await _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的CRC 用户Id
|
||||
var userList = await _repository.Where<TrialUser>(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
|
||||
@@ -326,7 +322,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||
|
||||
var allUserList = await _repository.Where<TrialUser>(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.UserId, t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToListAsync();
|
||||
var allUserList = await _trialUserRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.UserId, t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToListAsync();
|
||||
|
||||
|
||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||
@@ -339,7 +335,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
@@ -353,7 +349,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
||||
|
||||
|
||||
PageOutput<DocumentUnionWithUserStatView> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
||||
Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
||||
List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
||||
}
|
||||
}
|
||||
@@ -15,39 +15,30 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// SystemDocumentService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class SystemDocumentService : BaseService, ISystemDocumentService
|
||||
public class SystemDocumentService(
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository) : BaseService, ISystemDocumentService
|
||||
{
|
||||
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
private readonly IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository;
|
||||
private readonly IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository;
|
||||
|
||||
public SystemDocumentService( IRepository<SystemDocument> systemDocumentRepository,
|
||||
|
||||
IRepository<SystemDocNeedConfirmedUserType> systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository)
|
||||
{
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
this._systemDocNeedConfirmedUserTypeRepository = systemDocNeedConfirmedUserTypeRepository;
|
||||
_systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 管理端列表
|
||||
/// </summary>
|
||||
/// <param name="querySystemDocument"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery querySystemDocument)
|
||||
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery inQuery)
|
||||
{
|
||||
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
|
||||
return await systemDocumentQueryable.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateSystemDocumentAsync(AddOrEditSystemDocument addOrEditSystemDocument)
|
||||
@@ -134,7 +125,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
public async Task<IResponseOutput> DeleteSystemDocumentAsync(Guid systemDocumentId)
|
||||
{
|
||||
|
||||
if (await _repository.Where<SystemDocument>(t => t.Id == systemDocumentId).AnyAsync(u => u.SystemDocConfirmedUserList.Any()))
|
||||
if (await _systemDocumentRepository.Where(t => t.Id == systemDocumentId).AnyAsync(u => u.SystemDocConfirmedUserList.Any()))
|
||||
{
|
||||
//---已有用户阅读该文档,并签名,不允许删除。
|
||||
return ResponseOutput.NotOk(_localizer["SystemD_CannotDeleteSignedFile"]);
|
||||
@@ -151,15 +142,15 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument)
|
||||
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery inQuery)
|
||||
{
|
||||
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
|
||||
join user in _repository.GetQueryable<User>() on _userInfo.Id equals user.Id
|
||||
join user in _userRepository.Where() on _userInfo.Id equals user.Id
|
||||
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
@@ -184,9 +175,9 @@ namespace IRaCIS.Core.Application.Services
|
||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||
};
|
||||
|
||||
return await query.WhereIf(querySystemDocument.IsSigned==true,t=>t.ConfirmTime!=null)
|
||||
.WhereIf(querySystemDocument.IsSigned == false, t => t.ConfirmTime == null)
|
||||
.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
return await query.WhereIf(inQuery.IsSigned==true,t=>t.ConfirmTime!=null)
|
||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,73 +19,57 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// TrialDocumentService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialDocumentService : BaseService, ITrialDocumentService
|
||||
public class TrialDocumentService(
|
||||
IRepository<TrialDocument> _trialDocumentRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocUserTypeConfirmedUserRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
ISystemDocumentService _systemDocumentService,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<TrialUser> _trialUserRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository) : BaseService, ITrialDocumentService
|
||||
{
|
||||
|
||||
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<TrialDocConfirmedUser> _trialDocUserTypeConfirmedUserRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly ISystemDocumentService _systemDocumentService;
|
||||
private readonly IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository;
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
private readonly IRepository<TrialCriterionAdditionalAssessmentType> _trialCriterionAdditionalAssessmentTypeRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
|
||||
|
||||
public TrialDocumentService(IRepository<TrialDocument> trialDocumentRepository,
|
||||
IRepository<TrialDocConfirmedUser> trialDocUserTypeConfirmedUserRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
ISystemDocumentService systemDocumentService,
|
||||
IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository,
|
||||
IRepository<TrialCriterionAdditionalAssessmentType> trialCriterionAdditionalAssessmentTypeRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository
|
||||
, IRepository<SystemDocument> systemDocumentRepository)
|
||||
{
|
||||
_trialDocumentRepository = trialDocumentRepository;
|
||||
this._trialDocUserTypeConfirmedUserRepository = trialDocUserTypeConfirmedUserRepository;
|
||||
this._trialRepository = trialRepository;
|
||||
this._systemDocumentService = systemDocumentService;
|
||||
this._systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
_readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
_trialCriterionAdditionalAssessmentTypeRepository = trialCriterionAdditionalAssessmentTypeRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Setting 界面的 项目所有文档列表
|
||||
/// </summary>
|
||||
/// <param name="queryTrialDocument"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument)
|
||||
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery inQuery)
|
||||
{
|
||||
|
||||
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == queryTrialDocument.TrialId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryTrialDocument.Name), t => t.Name.Contains(queryTrialDocument.Name))
|
||||
.WhereIf(queryTrialDocument.FileTypeId != null, t => t.FileTypeId == queryTrialDocument.FileTypeId)
|
||||
.WhereIf(queryTrialDocument.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t=>t.NeedConfirmUserTypeId== queryTrialDocument.UserTypeId) )
|
||||
.WhereIf(queryTrialDocument.IsDeleted != null, t => t.IsDeleted == queryTrialDocument.IsDeleted)
|
||||
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId))
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.ProjectTo<TrialDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await trialDocumentQueryable.ToPagedListAsync(queryTrialDocument.PageIndex, queryTrialDocument.PageSize, queryTrialDocument.SortField, queryTrialDocument.Asc);
|
||||
return await trialDocumentQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSignDocView>> GetTrialSignDocumentList(TrialDocQuery querySystemDocument)
|
||||
public async Task<PageOutput<TrialSignDocView>> GetTrialSignDocumentList(TrialDocQuery inQuery)
|
||||
{
|
||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true)
|
||||
.WhereIf(querySystemDocument.TrialId!=null,t=>t.TrialId==querySystemDocument.TrialId)
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) )
|
||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
|
||||
join trialUser in _repository.Where<TrialUser>(t=>t.UserId==_userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _repository.Where<TrialDocConfirmedUser>() on
|
||||
join trialUser in _trialUserRepository.Where(t => t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where() on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrialSignDocView()
|
||||
{
|
||||
TrialCode=trialDoc.Trial.TrialCode,
|
||||
TrialCode = trialDoc.Trial.TrialCode,
|
||||
ResearchProgramNo = trialDoc.Trial.ResearchProgramNo,
|
||||
ExperimentName = trialDoc.Trial.ExperimentName,
|
||||
Id = trialDoc.Id,
|
||||
@@ -110,13 +94,13 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
};
|
||||
|
||||
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
.WhereIf(querySystemDocument.IsSigned == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(querySystemDocument.IsSigned == false, t => t.ConfirmTime == null);
|
||||
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null);
|
||||
|
||||
|
||||
return await trialDocQueryable.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
return await trialDocQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
}
|
||||
|
||||
@@ -142,19 +126,19 @@ namespace IRaCIS.Core.Application.Services
|
||||
PageSize = 1,
|
||||
})).Data;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
result = await _systemDocumentService.getWaitSignSysDocList(new SystemDocumentQuery()
|
||||
{
|
||||
PageIndex=1,
|
||||
PageIndex = 1,
|
||||
IsSigned = false,
|
||||
PageSize=1,
|
||||
Asc=false,
|
||||
SortField="UpdateTime",
|
||||
});
|
||||
PageSize = 1,
|
||||
Asc = false,
|
||||
SortField = "UpdateTime",
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (result.CurrentPageData.Count > 0)
|
||||
{
|
||||
@@ -170,10 +154,10 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// <summary>
|
||||
/// 具体用户看到的 系统文件列表 + 项目类型文档
|
||||
/// </summary>
|
||||
/// <param name="querySystemDocument"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument)
|
||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery inQuery)
|
||||
{
|
||||
#region https://github.com/dotnet/efcore/issues/16243 操作不行
|
||||
////系统文档查询
|
||||
@@ -235,19 +219,19 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
#endregion
|
||||
|
||||
var trialId = querySystemDocument.TrialId;
|
||||
var trialId = inQuery.TrialId;
|
||||
|
||||
var trialInfo = await (_repository.Where<Trial>(t => t.Id == querySystemDocument.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
var trialInfo = await ( _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
//系统文档查询
|
||||
var systemDocumentQueryable = from needConfirmedUserType in _repository.Where<SystemDocNeedConfirmedUserType>(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
//.Where(u => u.UserTypeRole.UserList.SelectMany(cc => cc.UserTrials.Where(t => t.TrialId == querySystemDocument.TrialId)).Any(e => e.Trial.TrialFinishedTime < u.SystemDocument.CreateTime))
|
||||
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id)
|
||||
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
@@ -275,12 +259,12 @@ namespace IRaCIS.Core.Application.Services
|
||||
};
|
||||
|
||||
//项目文档查询
|
||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _repository.Where<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == querySystemDocument.TrialId) on
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
@@ -309,14 +293,14 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
#region 报错 奇怪的bug
|
||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
.WhereIf(querySystemDocument.IsSign == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(querySystemDocument.IsSign == false, t => 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.IsSign == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSign == false, t => t.ConfirmTime == null);
|
||||
|
||||
|
||||
|
||||
var result = await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||
#endregion
|
||||
|
||||
#region 临时方案
|
||||
@@ -342,7 +326,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == querySystemDocument.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
@@ -352,7 +336,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == querySystemDocument.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
@@ -409,15 +393,15 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
#endregion
|
||||
|
||||
var trialInfo = (await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _repository.Where<TrialDocNeedConfirmedUserType>(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId)
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
|
||||
join confirm in _repository.Where<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
@@ -449,12 +433,12 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
|
||||
|
||||
var systemDocQuery = from needConfirmEdUserType in _repository.WhereIf<SystemDocNeedConfirmedUserType>(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
@@ -489,7 +473,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
|
||||
|
||||
var result = await unionQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
|
||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
@@ -514,7 +498,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||
{
|
||||
return await _repository.Where<TrialUser>(t => t.TrialId == trialId)
|
||||
return await _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.User.FullName, UserName = t.User.UserName })
|
||||
.ToListAsync();
|
||||
}
|
||||
@@ -638,7 +622,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
await _repository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
@@ -649,14 +633,14 @@ namespace IRaCIS.Core.Application.Services
|
||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
|
||||
await _repository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
success = await _repository.SaveChangesAsync();
|
||||
success = await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
@@ -666,11 +650,11 @@ namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
await _repository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
@@ -681,10 +665,10 @@ namespace IRaCIS.Core.Application.Services
|
||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
|
||||
await _repository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
@@ -796,7 +780,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
[Obsolete]
|
||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
||||
{
|
||||
var query = _repository.Where<TrialUser>(t => t.TrialId == trialId)
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserUnionDocumentView()
|
||||
{
|
||||
UserId = t.UserId,
|
||||
@@ -819,14 +803,14 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// <summary>
|
||||
/// 从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
||||
/// </summary>
|
||||
/// <param name="querySystemDocument"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Obsolete]
|
||||
public PageOutput<DocumentUnionWithUserStatView> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument)
|
||||
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery inQuery)
|
||||
{
|
||||
var systemDocumentQueryable = _repository
|
||||
.WhereIf<SystemDocument>(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
||||
var systemDocumentQueryable = _systemDocumentRepository
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
||||
.Select(t => new DocumentUnionWithUserStatView()
|
||||
{
|
||||
Id = t.Id,
|
||||
@@ -842,10 +826,10 @@ namespace IRaCIS.Core.Application.Services
|
||||
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
||||
|
||||
//DocumentUserCount= _trialUserRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == querySystemDocument.TrialId))).Count()
|
||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
|
||||
});
|
||||
|
||||
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == querySystemDocument.TrialId).Select(t => new DocumentUnionWithUserStatView()
|
||||
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId).Select(t => new DocumentUnionWithUserStatView()
|
||||
{
|
||||
Id = t.Id,
|
||||
IsSystemDoc = false,
|
||||
@@ -864,10 +848,10 @@ namespace IRaCIS.Core.Application.Services
|
||||
});
|
||||
|
||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId);
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId);
|
||||
|
||||
return unionQuery.ToPagedList(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
return await unionQuery.ToPagedListAsync(inQuery);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -34,48 +34,26 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// TrialEmailNoticeConfigService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialEmailNoticeConfigService : BaseService, ITrialEmailNoticeConfigService
|
||||
public class TrialEmailNoticeConfigService(
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<TrialEmailBlackUser> _trialEmailBlackUserRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialUser> _trialUserRepository,
|
||||
IRepository<TrialEmailNoticeUser> _trialEmailNoticeUserRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IEmailSendService _emailSendService) : BaseService, ITrialEmailNoticeConfigService
|
||||
{
|
||||
|
||||
private readonly IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository;
|
||||
private readonly IRepository<TrialEmailBlackUser> _trialEmailBlackUserRepository;
|
||||
private readonly IRepository<EmailNoticeConfig> _emailNoticeConfigRepository;
|
||||
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<TrialUser> _trialUserRepository;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
|
||||
private readonly IEmailSendService _emailSendService;
|
||||
|
||||
|
||||
public TrialEmailNoticeConfigService(
|
||||
IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<TrialUser> trialUserRepository,
|
||||
IRepository<TaskMedicalReview> taskMedicalReviewRepository,
|
||||
IRepository<Subject> subjectRepository,
|
||||
IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<TrialEmailBlackUser> trialEmailBlackUserRepository,
|
||||
IRepository<EmailNoticeConfig> emailNoticeConfigRepository
|
||||
, IEmailSendService emailSendService
|
||||
)
|
||||
{
|
||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_trialUserRepository = trialUserRepository;
|
||||
_taskMedicalReviewRepository = taskMedicalReviewRepository;
|
||||
_subjectRepository = subjectRepository;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
_trialEmailBlackUserRepository = trialEmailBlackUserRepository;
|
||||
_emailNoticeConfigRepository = emailNoticeConfigRepository;
|
||||
_emailSendService = emailSendService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目邮箱
|
||||
@@ -336,7 +314,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
//入组确认 根据每个标准配置的是否自动发送,发送邮件与否
|
||||
if (businessScenarioEnum == EmailBusinessScenario.EnrollConfirmed)
|
||||
{
|
||||
if (await _repository.Where<ReadingTableQuestionAnswer>().AnyAsync(x => x.VisitTaskId == visitTaskId && x.Answer == TargetState.Exist.GetEnumInt() &&
|
||||
if (await _readingTableQuestionAnswerRepository.Where().AnyAsync(x => x.VisitTaskId == visitTaskId && x.Answer == TargetState.Exist.GetEnumInt() &&
|
||||
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && x.ReadingQuestionTrial.LesionType == LesionType.TargetLesion))
|
||||
{
|
||||
answer = "是";
|
||||
@@ -363,7 +341,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (answer == "是")
|
||||
{
|
||||
//把另外一个人的任务设置为不加急(如果项目加急是否 subject 加急是否)
|
||||
var urgent = _repository.Where<SubjectVisit>(t => t.Id == taskInfo.SourceSubjectVisitId).Select(t => new { IsSubjectUrgent = t.Subject.IsUrgent, t.Trial.IsUrgent }).FirstOrDefault();
|
||||
var urgent = _subjectVisitRepository.Where(t => t.Id == taskInfo.SourceSubjectVisitId).Select(t => new { IsSubjectUrgent = t.Subject.IsUrgent, t.Trial.IsUrgent }).FirstOrDefault();
|
||||
|
||||
if (urgent?.IsUrgent == false || urgent?.IsSubjectUrgent == false)
|
||||
{
|
||||
@@ -515,7 +493,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
// if (taskInfo.ReadingCategory == ReadingCategory.Visit)
|
||||
// {
|
||||
// //存在阅片期 那么就是截止访视
|
||||
// if (await _repository.Where<ReadModule>(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.SubjectVisitId == taskInfo.SourceSubjectVisitId && t.ReadingSetType == ReadingSetType.ImageReading).AnyAsync())
|
||||
// if (await _readModuleRepository.Where(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.SubjectVisitId == taskInfo.SourceSubjectVisitId && t.ReadingSetType == ReadingSetType.ImageReading).AnyAsync())
|
||||
// {
|
||||
// isNeedSend = false;
|
||||
// }
|
||||
@@ -884,7 +862,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var currentLatestPdVisitId = pdSubjectVisitIdList.Last();
|
||||
//标准配置
|
||||
var trialReadingCriterionConfig = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == trialReadingCriterionId).Select(t => new
|
||||
var trialReadingCriterionConfig = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new
|
||||
{ TrialReadingCriterionId = t.Id, t.ReadingType, t.IsReadingTaskViewInOrder, t.CriterionType, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
// 项目双重
|
||||
@@ -930,7 +908,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
//仲裁在阅片期上
|
||||
else if (trialReadingCriterionConfig.ArbitrationRule == ArbitrationRule.Reading)
|
||||
{
|
||||
var existReadModule = await _repository.Where<ReadModule>(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectVisitId == currentLatestPdVisitId && t.ReadingSetType == ReadingSetType.ImageReading)
|
||||
var existReadModule = await _readModuleRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectVisitId == currentLatestPdVisitId && t.ReadingSetType == ReadingSetType.ImageReading)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (existReadModule == null)
|
||||
@@ -1003,7 +981,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
// {
|
||||
// //存在阅片期 那么就是截止访视
|
||||
|
||||
// var existReadModule = await _repository.Where<ReadModule>(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectVisitId == currentLatestPdVisitId && t.ReadingSetType == ReadingSetType.ImageReading)
|
||||
// var existReadModule = await _readModuleRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectVisitId == currentLatestPdVisitId && t.ReadingSetType == ReadingSetType.ImageReading)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (existReadModule != null)
|
||||
// {
|
||||
@@ -1099,20 +1077,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (readingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
|
||||
visitQuestionAnswer = await _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstNotNullAsync();
|
||||
visitQuestionAnswer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstNotNullAsync();
|
||||
|
||||
|
||||
answer = visitQuestionAnswer.Answer;
|
||||
}
|
||||
else if (readingCategory == ReadingCategory.Global)
|
||||
{
|
||||
var questionAnsewer = await _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.Tumor).OrderByDescending(c => c.VisitTask.VisitTaskNum).FirstNotNullAsync();
|
||||
var questionAnsewer = await _readingGlobalTaskInfoRepository.Where(t => t.GlobalTaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.Tumor).OrderByDescending(c => c.VisitTask.VisitTaskNum).FirstNotNullAsync();
|
||||
|
||||
|
||||
answer = questionAnsewer.Answer;
|
||||
if (string.IsNullOrEmpty(questionAnsewer.Answer))
|
||||
{
|
||||
answer = await _repository.Where<ReadingTaskQuestionAnswer>(t => questionAnsewer.TaskId == t.VisitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor)
|
||||
answer = await _readingTaskQuestionAnswerRepository.Where(t => questionAnsewer.TaskId == t.VisitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor)
|
||||
.Select(t => t.Answer).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
@@ -1121,7 +1099,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
//{
|
||||
// var judgeResultTaskId = await _visitTaskRepository.Where(t => t.Id == visitTaskId).Select(t => t.JudgeResultTaskId).FirstNotNullAsync();
|
||||
|
||||
// var questionAnsewer = await _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == judgeResultTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstNotNullAsync();
|
||||
// var questionAnsewer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == judgeResultTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstNotNullAsync();
|
||||
|
||||
|
||||
// answer = questionAnsewer.Answer;
|
||||
@@ -1147,14 +1125,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (readingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
|
||||
visitQuestionAnswer = await _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
visitQuestionAnswer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
|
||||
|
||||
answer = visitQuestionAnswer.Answer;
|
||||
}
|
||||
else if (readingCategory == ReadingCategory.Global)
|
||||
{
|
||||
var questionAnsewer = await _repository.Where<ReadingGlobalTaskInfo>(t => t.TaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
var questionAnsewer = await _readingGlobalTaskInfoRepository.Where(t => t.TaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
|
||||
answer = questionAnsewer.Answer;
|
||||
}
|
||||
@@ -1162,7 +1140,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
//{
|
||||
// //var judgeResultTaskId = await _visitTaskRepository.Where(t => t.Id == visitTaskId).Select(t => t.JudgeResultTaskId).FirstNotNullAsync();
|
||||
|
||||
// var questionAnsewer = await _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
// var questionAnsewer = await _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == visitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstNotNullAsync();
|
||||
|
||||
// answer = questionAnsewer.Answer;
|
||||
//}
|
||||
@@ -1266,21 +1244,21 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <summary>
|
||||
/// 获取系统 邮件配置 勾选列表
|
||||
/// </summary>
|
||||
/// <param name="queryEmailNoticeConfig"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
||||
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery inQuery)
|
||||
{
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigRepository
|
||||
.WhereIf(queryEmailNoticeConfig.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||
.WhereIf(queryEmailNoticeConfig.SystemLevel != null, t => t.SystemLevel == queryEmailNoticeConfig.SystemLevel)
|
||||
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
||||
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
||||
.WhereIf(queryEmailNoticeConfig.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == queryEmailNoticeConfig.IsDistinguishCriteria)
|
||||
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = queryEmailNoticeConfig.TrialId });
|
||||
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId });
|
||||
|
||||
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
|
||||
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1306,7 +1284,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
var list = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm).Select(t => new { t.CriterionType, TrialReadingCriterionId = t.Id }).ToListAsync();
|
||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Select(t => new { t.CriterionType, TrialReadingCriterionId = t.Id }).ToListAsync();
|
||||
|
||||
|
||||
var addList = _mapper.Map<List<TrialEmailNoticeConfig>>(batchAddList);
|
||||
@@ -1402,8 +1380,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var id = (Guid)addOrEditTrialEmailNoticeConfig.Id;
|
||||
|
||||
await _repository.BatchDeleteAsync<TrialEmailNoticeUser>(t => t.TrialEmailNoticeConfigId == addOrEditTrialEmailNoticeConfig.Id);
|
||||
await _repository.BatchDeleteAsync<TrialEmailBlackUser>(t => t.TrialEmailNoticeConfigId == addOrEditTrialEmailNoticeConfig.Id);
|
||||
await _trialEmailNoticeUserRepository.BatchDeleteNoTrackingAsync(t => t.TrialEmailNoticeConfigId == addOrEditTrialEmailNoticeConfig.Id);
|
||||
await _trialEmailBlackUserRepository.BatchDeleteNoTrackingAsync(t => t.TrialEmailNoticeConfigId == addOrEditTrialEmailNoticeConfig.Id);
|
||||
|
||||
|
||||
List<TrialEmailNoticeUser> trialEmailNoticeUsers = new List<TrialEmailNoticeUser>();
|
||||
@@ -1420,7 +1398,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
trialEmailNoticeUsers.Add(new TrialEmailNoticeUser() { EmailUserType = EmailUserType.Copy, UserType = item, TrialEmailNoticeConfigId = id });
|
||||
|
||||
}
|
||||
await _repository.AddRangeAsync(trialEmailNoticeUsers);
|
||||
await _trialEmailNoticeUserRepository.AddRangeAsync(trialEmailNoticeUsers);
|
||||
|
||||
foreach (var userid in addOrEditTrialEmailNoticeConfig.BlackUserIdList)
|
||||
{
|
||||
@@ -1487,7 +1465,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
#region 人员还未加入,可以先配置邮件 历史废弃
|
||||
|
||||
//var toUserList = await _repository.Where<TrialUser>(t => t.TrialId == config.TrialId)
|
||||
//var toUserList = await _trialUserRepository.Where(t => t.TrialId == config.TrialId)
|
||||
// .WhereIf(config.ToUserTypeList != null, t => config.ToUserTypeList.Contains(t.User.UserTypeEnum))
|
||||
// .Select(t => new { t.User.EMail, t.User.FullName }).ToListAsync();
|
||||
|
||||
|
||||
@@ -11,46 +11,22 @@ using Panda.DynamicWebApi.Attributes;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
public class CalculateService :BaseService, ICalculateService
|
||||
public class CalculateService(
|
||||
IRepository<Payment> _paymentRepository,
|
||||
IRepository<TrialPaymentPrice> _trialPaymentRepository,
|
||||
IRepository<ReviewerPayInformation> _doctorPayInfoRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<Workload> _doctorWorkloadRepository,
|
||||
IRepository<RankPrice> _rankPriceRepository,
|
||||
IRepository<PaymentDetail> _paymentDetailRepository,
|
||||
IVolumeRewardService _volumeRewardPriceService,
|
||||
IRepository<ExchangeRate> _exchangeRateRepository,
|
||||
IRepository<PaymentAdjustment> _payAdjustmentRepository,
|
||||
IRepository<Enroll> _enrollRepository)
|
||||
: BaseService, ICalculateService
|
||||
{
|
||||
private readonly IRepository<Payment> _paymentRepository;
|
||||
private readonly IRepository<TrialPaymentPrice> _trialPaymentRepository;
|
||||
private readonly IRepository<ReviewerPayInformation> _doctorPayInfoRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<Workload> _doctorWorkloadRepository;
|
||||
private readonly IRepository<RankPrice> _rankPriceRepository;
|
||||
private readonly IRepository<PaymentDetail> _paymentDetailRepository;
|
||||
private readonly IVolumeRewardService _volumeRewardPriceService;
|
||||
private readonly IRepository<ExchangeRate> _exchangeRateRepository;
|
||||
private readonly IRepository<PaymentAdjustment> _payAdjustmentRepository;
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
|
||||
public CalculateService(IRepository<Payment> paymentRepository, IRepository<TrialPaymentPrice> trialPaymentPriceRepository,
|
||||
IRepository<ReviewerPayInformation> reviewerPayInfoRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<Doctor> doctorRepository,
|
||||
IRepository<Workload> workloadRepository,
|
||||
IRepository<RankPrice> rankPriceRepository,
|
||||
IRepository<PaymentDetail> paymentDetailRepository,
|
||||
IVolumeRewardService volumeRewardService,
|
||||
IRepository<ExchangeRate> exchangeRateRepository,
|
||||
IRepository<Enroll> EnrollRepository,
|
||||
IRepository<PaymentAdjustment> paymentAdjustmentRepository)
|
||||
{
|
||||
_paymentRepository = paymentRepository;
|
||||
_trialPaymentRepository = trialPaymentPriceRepository;
|
||||
_doctorPayInfoRepository = reviewerPayInfoRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_doctorWorkloadRepository = workloadRepository;
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
_paymentDetailRepository = paymentDetailRepository;
|
||||
_volumeRewardPriceService = volumeRewardService;
|
||||
_exchangeRateRepository = exchangeRateRepository;
|
||||
_payAdjustmentRepository = paymentAdjustmentRepository;
|
||||
this._enrollRepository = EnrollRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取某个月下的某些医生最终确认的工作量,用于计算月度费用
|
||||
|
||||
@@ -11,16 +11,12 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class ExchangeRateService : BaseService, IExchangeRateService
|
||||
public class ExchangeRateService(
|
||||
IRepository<ExchangeRate> _exchangeRateRepository,
|
||||
IRepository<Payment> _paymentRepository)
|
||||
: BaseService, IExchangeRateService
|
||||
{
|
||||
private readonly IRepository<ExchangeRate> _exchangeRateRepository;
|
||||
private readonly IRepository<Payment> _paymentRepository;
|
||||
|
||||
public ExchangeRateService(IRepository<ExchangeRate> exchangeRateRepository, IRepository<Payment> paymentRepository)
|
||||
{
|
||||
_exchangeRateRepository = exchangeRateRepository;
|
||||
_paymentRepository = paymentRepository;
|
||||
}
|
||||
|
||||
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> AddOrUpdateExchangeRate(ExchangeRateCommand model)
|
||||
@@ -99,16 +95,16 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ExchangeRateCommand>> GetExchangeRateList(ExchangeRateQueryDTO queryParam)
|
||||
public async Task<PageOutput<ExchangeRateCommand>> GetExchangeRateList(ExchangeRateQueryDTO inQuery)
|
||||
{
|
||||
|
||||
var yearMonth = queryParam.SearchMonth?.ToString("yyyy-MM");
|
||||
var yearMonth = inQuery.SearchMonth?.ToString("yyyy-MM");
|
||||
|
||||
var exchangeRateQueryable = _exchangeRateRepository.AsQueryable()
|
||||
.WhereIf(queryParam.SearchMonth != null, o => o.YearMonth == yearMonth)
|
||||
.WhereIf(inQuery.SearchMonth != null, o => o.YearMonth == yearMonth)
|
||||
.ProjectTo<ExchangeRateCommand>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await exchangeRateQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "YearMonth", false);
|
||||
return await exchangeRateQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,60 +10,28 @@ using System.Linq.Dynamic.Core;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class FinancialService : BaseService, IPaymentService
|
||||
public class FinancialService(
|
||||
IRepository<Payment> _paymentRepository,
|
||||
IRepository<ReviewerPayInformation> _doctorPayInfoRepository,
|
||||
IRepository<TrialPaymentPrice> _trialPaymentPriceRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<RankPrice> _rankPriceRepository,
|
||||
IRepository<PaymentDetail> _paymentDetailRepository,
|
||||
IRepository<CRO> _croRepository,
|
||||
IRepository<Workload> _workloadRepository,
|
||||
IRepository<TrialRevenuesPrice> _trialRevenuePriceRepository,
|
||||
IRepository<PaymentAdjustment> _payAdjustmentRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<Workload> _doctorWorkloadRepository)
|
||||
: BaseService, IPaymentService
|
||||
{
|
||||
private readonly IRepository<Payment> _paymentRepository;
|
||||
private readonly IRepository<ReviewerPayInformation> _doctorPayInfoRepository;
|
||||
private readonly IRepository<TrialPaymentPrice> _TrialPaymentPriceRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<RankPrice> _rankPriceRepository;
|
||||
private readonly IRepository<PaymentDetail> _paymentDetailRepository;
|
||||
private readonly IRepository<CRO> _croRepository;
|
||||
private readonly IRepository<Workload> _workloadRepository;
|
||||
private readonly IRepository<TrialRevenuesPrice> _trialRevenuePriceRepository;
|
||||
private readonly IRepository<PaymentAdjustment> _payAdjustmentRepository;
|
||||
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
|
||||
private readonly IRepository<Workload> _doctorWorkloadRepository;
|
||||
|
||||
public FinancialService(IRepository<Payment> costStatisticsRepository,
|
||||
IRepository<ReviewerPayInformation> doctorPayInfoRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IRepository<Doctor> doctorRepository,
|
||||
IRepository<RankPrice> rankPriceRepository,
|
||||
IRepository<PaymentDetail> costStatisticsDetailRepository,
|
||||
IRepository<CRO> croCompanyRepository,
|
||||
IRepository<Workload> workloadRepository,
|
||||
IRepository<Enroll> intoGroupRepository,
|
||||
IRepository<TrialPaymentPrice> trialPaymentPriceRepository,
|
||||
IRepository<TrialRevenuesPrice> trialCostRepository,
|
||||
IRepository<PaymentAdjustment> costAdjustmentRepository,
|
||||
IRepository<Workload> doctoWorkloadRepository
|
||||
)
|
||||
{
|
||||
_TrialPaymentPriceRepository = trialPaymentPriceRepository;
|
||||
_paymentRepository = costStatisticsRepository;
|
||||
_doctorPayInfoRepository = doctorPayInfoRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
_paymentDetailRepository = costStatisticsDetailRepository;
|
||||
_croRepository = croCompanyRepository;
|
||||
_enrollRepository = intoGroupRepository;
|
||||
_workloadRepository = workloadRepository;
|
||||
_trialRevenuePriceRepository = trialCostRepository;
|
||||
_payAdjustmentRepository = costAdjustmentRepository;
|
||||
|
||||
_doctorWorkloadRepository = doctoWorkloadRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Financials /MonthlyPayment 列表查询接口
|
||||
/// </summary>
|
||||
[NonDynamicMethod]
|
||||
public async Task<PageOutput<PaymentModel>> GetMonthlyPaymentList(MonthlyPaymentQueryDTO queryParam)
|
||||
public async Task<PageOutput<PaymentModel>> GetMonthlyPaymentList(MonthlyPaymentQueryDTO inQuery)
|
||||
{
|
||||
//var year = queryParam.StatisticsDate.Year;
|
||||
//var month = queryParam.StatisticsDate.Month;
|
||||
@@ -74,21 +42,21 @@ namespace IRaCIS.Application.Services
|
||||
//var rate = _exchangeRateRepository.FindSingleOrDefault(u => u.YearMonth == yearMonth);
|
||||
//var exchangeRate = rate == null ? 0 : rate.Rate;
|
||||
|
||||
var yearMonth = queryParam.StatisticsDate.ToString("yyyy-MM");
|
||||
var yearMonth = inQuery.StatisticsDate.ToString("yyyy-MM");
|
||||
|
||||
Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
if (!string.IsNullOrWhiteSpace(queryParam.KeyWord))
|
||||
if (!string.IsNullOrWhiteSpace(inQuery.KeyWord))
|
||||
{
|
||||
var reviewer = queryParam.KeyWord.Trim();
|
||||
var reviewer = inQuery.KeyWord.Trim();
|
||||
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|
||||
|| u.FirstName.Contains(reviewer)
|
||||
|| u.LastName.Contains(reviewer)
|
||||
|| u.ReviewerCode.Contains(reviewer));
|
||||
}
|
||||
|
||||
if (queryParam.Nation != null)
|
||||
if (inQuery.Nation != null)
|
||||
{
|
||||
doctorLambda = doctorLambda.And(u => u.Nation == queryParam.Nation);
|
||||
doctorLambda = doctorLambda.And(u => u.Nation == inQuery.Nation);
|
||||
}
|
||||
|
||||
var costStatisticsQueryable =
|
||||
@@ -132,7 +100,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
|
||||
return await costStatisticsQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField, queryParam.Asc);
|
||||
return await costStatisticsQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
//var propName = string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField;
|
||||
//costStatisticsQueryable = queryParam.Asc ? costStatisticsQueryable.OrderBy(propName).ThenBy(u => u.Code)
|
||||
@@ -187,7 +155,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
//from enroll in _enrollRepository.Where(t => t.TrialId == challengeQuery.TrialId)
|
||||
//join dociorc in _doctorRepository.Where() on enroll.DoctorId equals dociorc.Id
|
||||
//join price in _TrialPaymentPriceRepository.Where() on enroll.TrialId equals price.TrialId
|
||||
//join price in _trialPaymentPriceRepository.Where() on enroll.TrialId equals price.TrialId
|
||||
|
||||
|
||||
//select new EnrollViewModel()
|
||||
@@ -207,7 +175,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
detailList = await (from pay in _paymentDetailRepository.Where(t => t.PaymentId == paymentId)
|
||||
join enroll in _enrollRepository.Where() on new { pay.DoctorId, pay.TrialId } equals new { enroll.DoctorId, enroll.TrialId }
|
||||
join price in _TrialPaymentPriceRepository.Where() on pay.TrialId equals price.TrialId
|
||||
join price in _trialPaymentPriceRepository.Where() on pay.TrialId equals price.TrialId
|
||||
orderby pay.ShowCodeOrder
|
||||
orderby pay.ShowTypeOrder
|
||||
select new PaymentDetailDTO()
|
||||
@@ -234,7 +202,7 @@ namespace IRaCIS.Application.Services
|
||||
var adjList =
|
||||
await (from costAdjustment in _payAdjustmentRepository.Where(t => t.YearMonth == yearMonthStr&& t.ReviewerId == paymentId)
|
||||
join enroll in _enrollRepository.Where() on new { costAdjustment.ReviewerId, costAdjustment.TrialId } equals new { ReviewerId= enroll.DoctorId, enroll.TrialId }
|
||||
join price in _TrialPaymentPriceRepository.Where() on costAdjustment.TrialId equals price.TrialId
|
||||
join price in _trialPaymentPriceRepository.Where() on costAdjustment.TrialId equals price.TrialId
|
||||
|
||||
|
||||
select new PaymentDetailDTO()
|
||||
@@ -317,23 +285,23 @@ namespace IRaCIS.Application.Services
|
||||
/// Financials / Payment History 列表查询接口(已经支付锁定的数据,包含调整的)[New]
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<MonthlyPaymentDTO>> GetPaymentHistoryList(PaymentQueryDTO queryParam)
|
||||
public async Task<PageOutput<MonthlyPaymentDTO>> GetPaymentHistoryList(PaymentQueryDTO inQuery)
|
||||
{
|
||||
Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
if (!string.IsNullOrWhiteSpace(queryParam.Reviewer))
|
||||
if (!string.IsNullOrWhiteSpace(inQuery.Reviewer))
|
||||
{
|
||||
var reviewer = queryParam.Reviewer.Trim();
|
||||
var reviewer = inQuery.Reviewer.Trim();
|
||||
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|
||||
|| u.FirstName.Contains(reviewer)
|
||||
|| u.LastName.Contains(reviewer)
|
||||
|| u.ReviewerCode.Contains(reviewer));
|
||||
}
|
||||
if (queryParam.Nation != null)
|
||||
if (inQuery.Nation != null)
|
||||
{
|
||||
doctorLambda = doctorLambda.And(u => u.Nation == queryParam.Nation);
|
||||
doctorLambda = doctorLambda.And(u => u.Nation == inQuery.Nation);
|
||||
}
|
||||
|
||||
Expression<Func<Payment, bool>> paymentLambda = x => x.IsLock && x.YearMonthDate >= queryParam.BeginMonth && x.YearMonthDate <= queryParam.EndMonth;
|
||||
Expression<Func<Payment, bool>> paymentLambda = x => x.IsLock && x.YearMonthDate >= inQuery.BeginMonth && x.YearMonthDate <= inQuery.EndMonth;
|
||||
|
||||
#region 在 payment表加 调整总计前
|
||||
|
||||
@@ -416,7 +384,7 @@ namespace IRaCIS.Application.Services
|
||||
TotalUSD = monthlyPay.AdjustmentUSD + monthlyPay.PaymentUSD
|
||||
};
|
||||
|
||||
return await query.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "ReviewerCode" : queryParam.SortField, queryParam.Asc);
|
||||
return await query.ToPagedListAsync(inQuery);
|
||||
|
||||
//var propName = queryParam.SortField == string.Empty ? "ReviewerCode" : queryParam.SortField;
|
||||
//query = queryParam.Asc ? query.OrderBy(propName).ThenBy(u => u.ReviewerCode) : query.OrderByDescending(propName).ThenBy(u => u.ReviewerCode);
|
||||
|
||||
@@ -8,23 +8,14 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class PaymentAdjustmentService : BaseService, IPaymentAdjustmentService
|
||||
public class PaymentAdjustmentService(
|
||||
IRepository<PaymentAdjustment> _payAdjustmentRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<ExchangeRate> _exchangeRateRepository,
|
||||
IRepository<Payment> _paymentRepository)
|
||||
: BaseService, IPaymentAdjustmentService
|
||||
{
|
||||
private readonly IRepository<PaymentAdjustment> _payAdjustmentRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<ExchangeRate> _exchangeRateRepository;
|
||||
private readonly IRepository<Payment> _paymentRepository;
|
||||
|
||||
|
||||
public PaymentAdjustmentService(IRepository<PaymentAdjustment> costAdjustmentRepository, IRepository<Doctor> doctorRepository,
|
||||
IRepository<ExchangeRate> exchangeRateRepository, IRepository<Payment> paymentRepository, IMapper mapper)
|
||||
{
|
||||
_payAdjustmentRepository = costAdjustmentRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_exchangeRateRepository = exchangeRateRepository;
|
||||
_paymentRepository = paymentRepository;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或更新费用调整[AUTH]
|
||||
@@ -231,19 +222,19 @@ namespace IRaCIS.Application.Services
|
||||
/// 获取费用调整列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<PaymentAdjustmentDetailDTO>> GetPaymentAdjustmentList(PaymentAdjustmentQueryDTO queryParam)
|
||||
public async Task<PageOutput<PaymentAdjustmentDetailDTO>> GetPaymentAdjustmentList(PaymentAdjustmentQueryDTO inQuery)
|
||||
{
|
||||
|
||||
var beginYearMonth = queryParam.BeginMonth.AddDays(1 - queryParam.BeginMonth.Day);
|
||||
var endYearMonth = queryParam.EndMonth.AddDays(1 - queryParam.EndMonth.Day).AddMonths(1).AddDays(-1);
|
||||
var beginYearMonth = inQuery.BeginMonth.AddDays(1 - inQuery.BeginMonth.Day);
|
||||
var endYearMonth = inQuery.EndMonth.AddDays(1 - inQuery.EndMonth.Day).AddMonths(1).AddDays(-1);
|
||||
|
||||
var costAdjustmentQueryable = from costAdjustment in _payAdjustmentRepository
|
||||
.Where(t => t.YearMonthDate >= beginYearMonth && t.YearMonthDate <= endYearMonth)
|
||||
join doctor in _doctorRepository.AsQueryable().
|
||||
WhereIf(!string.IsNullOrWhiteSpace(queryParam.Reviewer),
|
||||
u => u.ChineseName.Contains(queryParam.Reviewer) ||
|
||||
(u.LastName + u.FirstName).Contains(queryParam.Reviewer) ||
|
||||
u.ReviewerCode.Contains(queryParam.Reviewer))
|
||||
WhereIf(!string.IsNullOrWhiteSpace(inQuery.Reviewer),
|
||||
u => u.ChineseName.Contains(inQuery.Reviewer) ||
|
||||
(u.LastName + u.FirstName).Contains(inQuery.Reviewer) ||
|
||||
u.ReviewerCode.Contains(inQuery.Reviewer))
|
||||
on costAdjustment.ReviewerId equals doctor.Id
|
||||
|
||||
select new PaymentAdjustmentDetailDTO()
|
||||
@@ -262,7 +253,7 @@ namespace IRaCIS.Application.Services
|
||||
ChineseName = doctor.ChineseName
|
||||
};
|
||||
|
||||
return await costAdjustmentQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "YearMonthDate" : queryParam.SortField, queryParam.Asc);
|
||||
return await costAdjustmentQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,18 +11,12 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class RankPriceService : BaseService, IRankPriceService
|
||||
public class RankPriceService(
|
||||
IRepository<RankPrice> _rankPriceRepository,
|
||||
IRepository<ReviewerPayInformation> _reviewerPayInfoRepository)
|
||||
: BaseService, IRankPriceService
|
||||
{
|
||||
private readonly IRepository<RankPrice> _rankPriceRepository;
|
||||
private readonly IRepository<ReviewerPayInformation> _reviewerPayInfoRepository;
|
||||
|
||||
|
||||
public RankPriceService(IRepository<RankPrice> rankPriceRepository, IRepository<ReviewerPayInformation> reviewerPayInfoRepository,IMapper mapper)
|
||||
{
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
_reviewerPayInfoRepository = reviewerPayInfoRepository;
|
||||
|
||||
}
|
||||
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> AddOrUpdateRankPrice(RankPriceCommand addOrUpdateModel, Guid userId)
|
||||
@@ -86,10 +80,10 @@ namespace IRaCIS.Application.Services
|
||||
/// 获取职称单价列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<RankPriceDTO>> GetRankPriceList(RankPriceQueryDTO queryParam)
|
||||
public async Task<PageOutput<RankPriceDTO>> GetRankPriceList(RankPriceQueryDTO inQuery)
|
||||
{
|
||||
var rankPriceQueryable = _rankPriceRepository.ProjectTo<RankPriceDTO>(_mapper.ConfigurationProvider);
|
||||
return await rankPriceQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "ShowOrder", queryParam.Asc);
|
||||
return await rankPriceQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,23 +11,14 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class ReviewerPayInfoService : BaseService, IReviewerPayInfoService
|
||||
public class ReviewerPayInfoService(
|
||||
IRepository<ReviewerPayInformation> _doctorPayInfoRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<RankPrice> _rankPriceRepository,
|
||||
IRepository<Hospital> _hospitalRepository)
|
||||
: BaseService, IReviewerPayInfoService
|
||||
{
|
||||
private readonly IRepository<ReviewerPayInformation> _doctorPayInfoRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<RankPrice> _rankPriceRepository;
|
||||
private readonly IRepository<Hospital> _hospitalRepository;
|
||||
|
||||
|
||||
public ReviewerPayInfoService(IRepository<Doctor> doctorRepository, IRepository<ReviewerPayInformation> doctorPayInfoRepository,
|
||||
IRepository<RankPrice> rankPriceRepository, IRepository<Hospital> hospitalRepository, IMapper mapper)
|
||||
{
|
||||
_doctorPayInfoRepository = doctorPayInfoRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
_hospitalRepository = hospitalRepository;
|
||||
|
||||
}
|
||||
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> AddOrUpdateReviewerPayInfo(ReviewerPayInfoCommand addOrUpdateModel, Guid userId)
|
||||
{
|
||||
@@ -52,14 +43,14 @@ namespace IRaCIS.Application.Services
|
||||
/// 获取医生支付信息列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<DoctorPayInfoQueryListDTO>> GetReviewerPayInfoList(DoctorPaymentInfoQueryDTO queryParam)
|
||||
public async Task<PageOutput<DoctorPayInfoQueryListDTO>> GetReviewerPayInfoList(DoctorPaymentInfoQueryDTO inQuery)
|
||||
{
|
||||
|
||||
|
||||
var doctorQueryable = from doctor in _doctorRepository.AsQueryable()
|
||||
.WhereIf(queryParam.HospitalId != null, o => o.HospitalId == queryParam.HospitalId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.SearchName),
|
||||
u => u.ChineseName.Contains(queryParam.SearchName)|| (u.LastName+ u.FirstName).Contains(queryParam.SearchName))
|
||||
.WhereIf(inQuery.HospitalId != null, o => o.HospitalId == inQuery.HospitalId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SearchName),
|
||||
u => u.ChineseName.Contains(inQuery.SearchName)|| (u.LastName+ u.FirstName).Contains(inQuery.SearchName))
|
||||
join hospitalItem in _hospitalRepository.AsQueryable() on doctor.HospitalId equals hospitalItem.Id into gt
|
||||
from hospital in gt.DefaultIfEmpty()
|
||||
join trialPayInfo in _doctorPayInfoRepository.Where()
|
||||
@@ -88,7 +79,7 @@ namespace IRaCIS.Application.Services
|
||||
CreateTime = doctor.CreateTime
|
||||
};
|
||||
|
||||
return await doctorQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "Code", queryParam.Asc);
|
||||
return await doctorQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,27 +8,15 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class TrialPaymentPriceService : BaseService, ITrialPaymentPriceService
|
||||
public class TrialPaymentPriceService(
|
||||
IRepository<TrialPaymentPrice> _trialExtRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<CRO> _croRepository,
|
||||
IRepository<Trial> _trialRepository)
|
||||
: BaseService, ITrialPaymentPriceService
|
||||
{
|
||||
private readonly IRepository<TrialPaymentPrice> _trialExtRepository;
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<CRO> _croRepository;
|
||||
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
public TrialPaymentPriceService(IRepository<Trial> trialRepository, IRepository<TrialPaymentPrice> trialExtRepository,
|
||||
IRepository<Enroll> enrollRepository,
|
||||
IRepository<Doctor> doctorRepository,
|
||||
IRepository<CRO> croCompanyRepository, IMapper mapper)
|
||||
{
|
||||
_trialExtRepository = trialExtRepository;
|
||||
_croRepository = croCompanyRepository;
|
||||
_enrollRepository = enrollRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
|
||||
_trialRepository = trialRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或更新项目支付价格信息
|
||||
@@ -92,7 +80,7 @@ namespace IRaCIS.Application.Services
|
||||
/// 获取项目支付价格信息列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialPaymentPriceDTO>> GetTrialPaymentPriceList(TrialPaymentPriceQueryDTO queryParam)
|
||||
public async Task<PageOutput<TrialPaymentPriceDTO>> GetTrialPaymentPriceList(TrialPaymentPriceQueryDTO inQuery)
|
||||
{
|
||||
#region hwt
|
||||
//var trialQueryable = from trial in _trialRepository.AsQueryable()
|
||||
@@ -171,11 +159,11 @@ namespace IRaCIS.Application.Services
|
||||
#region byzhouhang 方式二
|
||||
|
||||
var trialQueryable2 = _trialExtRepository.Where(t => t.Trial.IsDeleted == false)
|
||||
.WhereIf(queryParam.CroId != null, o => o.Trial.CROId == queryParam.CroId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.KeyWord), o => o.Trial.TrialCode.Contains(queryParam.KeyWord) || o.Trial.Indication.Contains(queryParam.KeyWord))
|
||||
.WhereIf(inQuery.CroId != null, o => o.Trial.CROId == inQuery.CroId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.KeyWord), o => o.Trial.TrialCode.Contains(inQuery.KeyWord) || o.Trial.Indication.Contains(inQuery.KeyWord))
|
||||
.ProjectTo<TrialPaymentPriceDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await trialQueryable2.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrEmpty(queryParam.SortField) ? "CreateTime" : queryParam.SortField, queryParam.Asc);
|
||||
return await trialQueryable2.ToPagedListAsync(inQuery);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -10,25 +10,16 @@ using Panda.DynamicWebApi.Attributes;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class TrialRevenuesPriceService : BaseService, ITrialRevenuesPriceService
|
||||
[ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class TrialRevenuesPriceService(
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository,
|
||||
IRepository<CRO> _croRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository)
|
||||
: BaseService, ITrialRevenuesPriceService
|
||||
{
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository;
|
||||
private readonly IRepository<CRO> _croRepository;
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
private readonly IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository;
|
||||
|
||||
|
||||
public TrialRevenuesPriceService(IRepository<Trial> trialRepository, IRepository<TrialRevenuesPrice> trialCostRepository, IRepository<CRO> croCompanyRepository, IRepository<Dictionary> dictionaryRepository, IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository, IMapper mapper)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_trialRevenuesPriceRepository = trialCostRepository;
|
||||
_croRepository = croCompanyRepository;
|
||||
_dictionaryRepository = dictionaryRepository;
|
||||
_trialRevenuesPriceVerificationRepository = trialRevenuesPriceVerificationRepository;
|
||||
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialRevenuesPrice(TrialRevenuesPriceDTO model)
|
||||
{
|
||||
@@ -52,7 +43,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var trialCost = _mapper.Map<TrialRevenuesPrice>(model);
|
||||
await _trialRevenuesPriceRepository.AddAsync(trialCost);
|
||||
var success = await _trialRevenuesPriceRepository.SaveChangesAsync();
|
||||
var success = await _trialRevenuesPriceRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success, trialCost.Id.ToString());
|
||||
}
|
||||
else//update
|
||||
@@ -81,15 +72,15 @@ namespace IRaCIS.Application.Services
|
||||
});
|
||||
|
||||
//删除所有有价格的记录 为true 表示有价格或者不需要价格 缺价格的为false
|
||||
await _trialRevenuesPriceVerificationRepository.BatchDeleteNoTrackingAsync(t => t.TrialId == model.TrialId &&
|
||||
t.Timepoint&&
|
||||
t.TimepointIn24H&&
|
||||
t.TimepointIn48H &&
|
||||
t.Adjudication &&
|
||||
t.AdjudicationIn24H &&
|
||||
t.AdjudicationIn48H &&
|
||||
t.Global &&
|
||||
t.Training &&t.RefresherTraining);
|
||||
await _trialRevenuesPriceVerificationRepository.BatchDeleteNoTrackingAsync(t => t.TrialId == model.TrialId &&
|
||||
t.Timepoint &&
|
||||
t.TimepointIn24H &&
|
||||
t.TimepointIn48H &&
|
||||
t.Adjudication &&
|
||||
t.AdjudicationIn24H &&
|
||||
t.AdjudicationIn48H &&
|
||||
t.Global &&
|
||||
t.Training && t.RefresherTraining);
|
||||
|
||||
|
||||
|
||||
@@ -108,12 +99,12 @@ namespace IRaCIS.Application.Services
|
||||
/// 获取项目收入费用信息列表[New]
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialRevenuesPriceDetialDTO>> GetTrialRevenuesPriceList(TrialRevenuesPriceQueryDTO queryParam)
|
||||
public async Task<PageOutput<TrialRevenuesPriceDetialDTO>> GetTrialRevenuesPriceList(TrialRevenuesPriceQueryDTO inQuery)
|
||||
{
|
||||
|
||||
|
||||
var trialQueryable = from trial in _trialRepository.AsQueryable()
|
||||
.Where(u => u.TrialCode.Contains(queryParam.KeyWord)|| u.Indication.Contains(queryParam.KeyWord))
|
||||
.WhereIf(queryParam.CroId != null, o => o.CROId == queryParam.CroId)
|
||||
.Where(u => u.TrialCode.Contains(inQuery.KeyWord) || u.Indication.Contains(inQuery.KeyWord))
|
||||
.WhereIf(inQuery.CroId != null, o => o.CROId == inQuery.CroId)
|
||||
join cro in _croRepository.AsQueryable() on trial.CROId equals cro.Id into CRO
|
||||
from croInfo in CRO.DefaultIfEmpty()
|
||||
join dic in _dictionaryRepository.AsQueryable() on trial.ReviewModeId equals dic.Id into dict
|
||||
@@ -138,13 +129,13 @@ namespace IRaCIS.Application.Services
|
||||
Downtime = trialCostItem == null ? 0 : trialCostItem.Downtime,
|
||||
Global = trialCostItem == null ? 0 : trialCostItem.Global,
|
||||
Training = trialCostItem == null ? 0 : trialCostItem.Training,
|
||||
RefresherTraining= trialCostItem == null ? 0 : trialCostItem.RefresherTraining,
|
||||
RefresherTraining = trialCostItem == null ? 0 : trialCostItem.RefresherTraining,
|
||||
Expedited = trial.Expedited
|
||||
|
||||
};
|
||||
|
||||
return await trialQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "TrialCode", queryParam.Asc);
|
||||
|
||||
return await trialQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,21 +11,14 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// Financial---项目收入价格验证
|
||||
/// </summary>
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class TrialRevenuesPriceVerificationService : BaseService, ITrialRevenuesPriceVerificationService
|
||||
public class TrialRevenuesPriceVerificationService(
|
||||
IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<Payment> _paymentRepository)
|
||||
: BaseService, ITrialRevenuesPriceVerificationService
|
||||
{
|
||||
private readonly IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<Payment> _paymentRepository;
|
||||
|
||||
public TrialRevenuesPriceVerificationService(IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository,
|
||||
IRepository<Trial> trialRepository,IRepository<Doctor> doctorRepository,IRepository<Payment> paymentRepository)
|
||||
{
|
||||
_trialRevenuesPriceVerificationRepository = trialRevenuesPriceVerificationRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_paymentRepository = paymentRepository;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<AnalysisVerifyResultDTO> GetAnalysisVerifyList(RevenusVerifyQueryDTO param)
|
||||
{
|
||||
|
||||
@@ -11,16 +11,9 @@ using Panda.DynamicWebApi.Attributes;
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Financial")]
|
||||
public class VolumeRewardService : BaseService, IVolumeRewardService
|
||||
public class VolumeRewardService (IRepository<VolumeReward> _volumeRewardRepository) : BaseService, IVolumeRewardService
|
||||
{
|
||||
private readonly IRepository<VolumeReward> _volumeRewardRepository;
|
||||
|
||||
|
||||
public VolumeRewardService(IRepository<VolumeReward> volumeRewardRepository,IMapper mapper)
|
||||
{
|
||||
_volumeRewardRepository = volumeRewardRepository;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量添加或更新奖励费用单价
|
||||
/// </summary>
|
||||
@@ -50,11 +43,11 @@ namespace IRaCIS.Application.Services
|
||||
/// 分页获取奖励单价列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<AwardPriceDTO>> GetVolumeRewardPriceList(AwardPriceQueryDTO queryParam)
|
||||
public async Task<PageOutput<AwardPriceDTO>> GetVolumeRewardPriceList(AwardPriceQueryDTO inQuery)
|
||||
{
|
||||
var awardPriceQueryable = _volumeRewardRepository.ProjectTo<AwardPriceDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await awardPriceQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "Min");
|
||||
return await awardPriceQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
using FellowOakDicom.Network;
|
||||
using FellowOakDicom;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
/// <summary>
|
||||
/// 后台托管服务的方式运行
|
||||
/// </summary>
|
||||
//public class CStoreSCPHostedService : IHostedService
|
||||
//{
|
||||
// private readonly ILogger<CStoreSCPHostedService> _logger;
|
||||
// private readonly IDicomServerFactory _dicomServerFactory;
|
||||
// private IDicomServer? _server;
|
||||
|
||||
// public CStoreSCPHostedService(ILogger<CStoreSCPHostedService> logger, IDicomServerFactory dicomServerFactory)
|
||||
// {
|
||||
// _logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
// _dicomServerFactory = dicomServerFactory ?? throw new ArgumentNullException(nameof(dicomServerFactory));
|
||||
// }
|
||||
|
||||
// public async Task StartAsync(CancellationToken cancellationToken)
|
||||
// {
|
||||
// _logger.LogInformation("Starting DICOM server");
|
||||
// _server = _dicomServerFactory.Create<CStoreSCPService>(104);
|
||||
// _logger.LogInformation("DICOM server is running");
|
||||
// }
|
||||
|
||||
// public Task StopAsync(CancellationToken cancellationToken)
|
||||
// {
|
||||
// if (_server != null)
|
||||
// {
|
||||
// _server.Stop();
|
||||
// _server.Dispose();
|
||||
// _server = null;
|
||||
// }
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public class CStoreSCPService : DicomService, IDicomServiceProvider, IDicomCStoreProvider, IDicomCEchoProvider
|
||||
{
|
||||
private IServiceProvider _serviceProvider { get; set; }
|
||||
|
||||
|
||||
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
|
||||
{
|
||||
DicomTransferSyntax.ExplicitVRLittleEndian,
|
||||
DicomTransferSyntax.ExplicitVRBigEndian,
|
||||
DicomTransferSyntax.ImplicitVRLittleEndian
|
||||
};
|
||||
|
||||
private static readonly DicomTransferSyntax[] _acceptedImageTransferSyntaxes = new DicomTransferSyntax[]
|
||||
{
|
||||
// Lossless
|
||||
DicomTransferSyntax.JPEGLSLossless,
|
||||
DicomTransferSyntax.JPEG2000Lossless,
|
||||
DicomTransferSyntax.JPEGProcess14SV1,
|
||||
DicomTransferSyntax.JPEGProcess14,
|
||||
DicomTransferSyntax.RLELossless,
|
||||
// Lossy
|
||||
DicomTransferSyntax.JPEGLSNearLossless,
|
||||
DicomTransferSyntax.JPEG2000Lossy,
|
||||
DicomTransferSyntax.JPEGProcess1,
|
||||
DicomTransferSyntax.JPEGProcess2_4,
|
||||
// Uncompressed
|
||||
DicomTransferSyntax.ExplicitVRLittleEndian,
|
||||
DicomTransferSyntax.ExplicitVRBigEndian,
|
||||
DicomTransferSyntax.ImplicitVRLittleEndian
|
||||
};
|
||||
|
||||
|
||||
public CStoreSCPService(INetworkStream stream, Encoding fallbackEncoding, ILogger log, DicomServiceDependencies dependencies)
|
||||
: base(stream, fallbackEncoding, log, dependencies)
|
||||
{
|
||||
var tt = base.UserState;
|
||||
//_dicomArchiveService = dicomArchiveService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Task OnReceiveAssociationRequestAsync(DicomAssociation association)
|
||||
{
|
||||
_serviceProvider =(IServiceProvider) this.UserState;
|
||||
|
||||
if (association.CalledAE != "STORESCP")
|
||||
{
|
||||
return SendAssociationRejectAsync(
|
||||
DicomRejectResult.Permanent,
|
||||
DicomRejectSource.ServiceUser,
|
||||
DicomRejectReason.CalledAENotRecognized);
|
||||
}
|
||||
|
||||
foreach (var pc in association.PresentationContexts)
|
||||
{
|
||||
if (pc.AbstractSyntax == DicomUID.Verification)
|
||||
{
|
||||
pc.AcceptTransferSyntaxes(_acceptedTransferSyntaxes);
|
||||
}
|
||||
else if (pc.AbstractSyntax.StorageCategory != DicomStorageCategory.None)
|
||||
{
|
||||
pc.AcceptTransferSyntaxes(_acceptedImageTransferSyntaxes);
|
||||
}
|
||||
}
|
||||
|
||||
return SendAssociationAcceptAsync(association);
|
||||
}
|
||||
|
||||
|
||||
public Task OnReceiveAssociationReleaseRequestAsync()
|
||||
{
|
||||
return SendAssociationReleaseResponseAsync();
|
||||
}
|
||||
|
||||
|
||||
public void OnReceiveAbort(DicomAbortSource source, DicomAbortReason reason)
|
||||
{
|
||||
/* nothing to do here */
|
||||
}
|
||||
|
||||
|
||||
public void OnConnectionClosed(Exception exception)
|
||||
{
|
||||
/* nothing to do here */
|
||||
}
|
||||
|
||||
|
||||
public async Task<DicomCStoreResponse> OnCStoreRequestAsync(DicomCStoreRequest request)
|
||||
{
|
||||
var tt= _serviceProvider.GetService<IDicomArchiveService>();
|
||||
|
||||
var studyUid = request.Dataset.GetSingleValue<string>(DicomTag.StudyInstanceUID).Trim();
|
||||
var instUid = request.SOPInstanceUID.UID;
|
||||
|
||||
var path = Path.GetFullPath(@".\DICOM-Store");
|
||||
|
||||
path = Path.Combine(path, studyUid);
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
path = Path.Combine(path, instUid) + ".dcm";
|
||||
|
||||
await request.File.SaveAsync(path);
|
||||
|
||||
return new DicomCStoreResponse(request, DicomStatus.Success);
|
||||
}
|
||||
|
||||
|
||||
public Task OnCStoreRequestExceptionAsync(string tempFileName, Exception e)
|
||||
{
|
||||
// let library handle logging and error response
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
public Task<DicomCEchoResponse> OnCEchoRequestAsync(DicomCEchoRequest request)
|
||||
{
|
||||
return Task.FromResult(new DicomCEchoResponse(request, DicomStatus.Success));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,8 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||
|
||||
public Guid? StudyId { get; set; }
|
||||
|
||||
public List<int?> KeyFramesList{ get; set; }=new List<int?> { };
|
||||
|
||||
public Guid? SeriesId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||
public string TaskName { get; set; }
|
||||
|
||||
public bool IsImageFilter { get; set; }
|
||||
public string CriterionModalitys { get; set; }
|
||||
public string CriterionModalitys { get; set; }
|
||||
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
public PackState PackState { get; set; }
|
||||
@@ -33,7 +33,66 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||
|
||||
}
|
||||
|
||||
public class StudyBasicInfo
|
||||
|
||||
|
||||
|
||||
public class StudyBasicInfo : DicomStudyBasicInfo
|
||||
{
|
||||
|
||||
public List<string> SopInstanceUidList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SubjectUploadTaskInfo
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
|
||||
public bool IsImageFilter { get; set; }
|
||||
public string CriterionModalitys { get; set; }
|
||||
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SubjectCRCImageUploadedStudyDto: SubjectCRCImageUploadedDto
|
||||
{
|
||||
public bool IsDicom => DicomStudyList.Count() > 0;
|
||||
}
|
||||
|
||||
public class SubjectCRCImageUploadedDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
|
||||
|
||||
public bool IsImageFilter { get; set; }
|
||||
public string CriterionModalitys { get; set; }
|
||||
|
||||
|
||||
|
||||
public List<DicomStudyBasicInfo> DicomStudyList { get; set; }
|
||||
|
||||
public List<NoneDicomStudyBasicInfo> NoneDicomStudyList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class DicomStudyBasicInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string StudyInstanceUid { get; set; }
|
||||
@@ -54,8 +113,26 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||
public string Description { get; set; }
|
||||
public int SeriesCount { get; set; }
|
||||
public int InstanceCount { get; set; }
|
||||
}
|
||||
|
||||
public class NoneDicomStudyBasicInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string StudyCode { get; set; } = string.Empty;
|
||||
|
||||
public int FileCount { get; set; }
|
||||
|
||||
public string BodyPart { get; set; }
|
||||
|
||||
public string Modality { get; set; }
|
||||
|
||||
public DateTime ImageDate { get; set; }
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
public List<string> SopInstanceUidList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -46,7 +47,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public bool IsDicom { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class UnionStudyMonitorModel : UnionStudyBaseModel
|
||||
@@ -184,7 +185,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public decimal FileSize { get; set; }
|
||||
public long FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
@@ -206,7 +207,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
public decimal FileSize { get; set; }
|
||||
public long FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
@@ -360,5 +361,142 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
public string HtmlPath { get; set; } = string.Empty;
|
||||
|
||||
public decimal FileFize { get; set; }
|
||||
}
|
||||
|
||||
public class CRCUploadTaskQuery
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public string SubjectCode { get; set; }
|
||||
}
|
||||
|
||||
public class CRCUploadTaskStudyQuery: SortInput
|
||||
{
|
||||
|
||||
[NotDefault]
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class IRUploadStudyQuery : SortInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public string SubjectCode { get; set; }
|
||||
}
|
||||
|
||||
public class IRUploadTaskDicomStudyDto : DicomStudyBasicInfo
|
||||
{
|
||||
|
||||
public int UploadedSeriesCount { get; set; }
|
||||
|
||||
public int UploadedInstanceCount { get; set; }
|
||||
|
||||
public List<string> UploadedSopInstanceUidList { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class IRUploadTaskNoneDicomStudyDto : NoneDicomStudyBasicInfo
|
||||
{
|
||||
|
||||
public int UploadedFileCount { get; set; }
|
||||
}
|
||||
|
||||
public class TaskDicomStudyDTO: DicomStudyBasicInfo
|
||||
{
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public int UploadedSeriesCount { get; set; }
|
||||
|
||||
public int UploadedInstanceCount { get; set; }
|
||||
|
||||
public List<string> UploadedSopInstanceUidList { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TaskNoneDicomStudyDTO : NoneDicomStudyBasicInfo
|
||||
{
|
||||
|
||||
|
||||
public int UploadedFileCount { get; set; }
|
||||
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class CRCUploadedStudyQuqry
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public List<Guid> DicomStudyIdList { get; set; }
|
||||
|
||||
public List<Guid> NoneDicomStudyIdList { get; set; }
|
||||
}
|
||||
|
||||
public class IRReadingDownloadQuery:SortInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public string SubjectCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class IRDownloadQuery
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public List<Guid> SubjectVisitIdList { get; set; }
|
||||
|
||||
public List<Guid> DicomStudyIdList { get; set; }
|
||||
|
||||
public List<Guid> NoneDicomStudyIdList { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Text;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
@@ -12,39 +11,25 @@ using FellowOakDicom.Imaging.Codec;
|
||||
using System.Data;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using FellowOakDicom.Network;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
public class DicomArchiveService : BaseService, IDicomArchiveService
|
||||
public class DicomArchiveService(
|
||||
IRepository<DicomStudy> _studyRepository,
|
||||
IRepository<DicomSeries> _seriesRepository,
|
||||
IRepository<DicomInstance> _instanceRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<SystemAnonymization> _systemAnonymizationRepository,
|
||||
IDistributedLockProvider _distributedLockProvider) : BaseService, IDicomArchiveService
|
||||
{
|
||||
private readonly IRepository<DicomStudy> _studyRepository;
|
||||
private readonly IRepository<DicomSeries> _seriesRepository;
|
||||
private readonly IRepository<DicomInstance> _instanceRepository;
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
|
||||
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
|
||||
|
||||
private List<Guid> _instanceIdList = new List<Guid>();
|
||||
|
||||
public DicomArchiveService(IRepository<DicomStudy> studyRepository,
|
||||
IRepository<DicomSeries> seriesRepository,
|
||||
IRepository<DicomInstance> instanceRepository,
|
||||
IRepository<Dictionary> dictionaryRepository,
|
||||
IEasyCachingProvider provider, IDistributedLockProvider distributedLockProvider)
|
||||
{
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_studyRepository = studyRepository;
|
||||
|
||||
_seriesRepository = seriesRepository;
|
||||
|
||||
_instanceRepository = instanceRepository;
|
||||
_dictionaryRepository = dictionaryRepository;
|
||||
_provider = provider;
|
||||
|
||||
}
|
||||
|
||||
public async Task<bool> DicomDBDataSaveChange()
|
||||
{
|
||||
@@ -74,20 +59,15 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
var anonymize_AddFixedFiledList = _provider.Get<List<SystemAnonymization>>(StaticData.Anonymize.Anonymize_AddFixedFiled).Value ?? new List<SystemAnonymization>();
|
||||
var anonymize_AddIRCInfoFiledList = _provider.Get<List<SystemAnonymization>>(StaticData.Anonymize.Anonymize_AddIRCInfoFiled).Value ?? new List<SystemAnonymization>();
|
||||
var anonymize_FixedFieldList = _provider.Get<List<SystemAnonymization>>(StaticData.Anonymize.Anonymize_FixedField).Value ?? new List<SystemAnonymization>();
|
||||
var anonymize_IRCInfoFieldList = _provider.Get<List<SystemAnonymization>>(StaticData.Anonymize.Anonymize_IRCInfoField).Value ?? new List<SystemAnonymization>();
|
||||
var anonymizeList = await _fusionCache.GetOrSetAsync(CacheKeys.SystemAnonymization, _ => CacheHelper.GetSystemAnonymizationListAsync(_systemAnonymizationRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var fixedFiledList = anonymizeList.Where(t => t.IsFixed).ToList();
|
||||
var ircFiledList = anonymizeList.Where(t => t.IsFixed == false).ToList();
|
||||
|
||||
|
||||
if (anonymize_AddFixedFiledList.Union(anonymize_AddIRCInfoFiledList).Union(anonymize_FixedFieldList).Union(anonymize_IRCInfoFieldList).Count() == 0)
|
||||
{
|
||||
//---未取到缓存匿名化配置数据,上传停止,请联系开发人员核实
|
||||
throw new BusinessValidationFailedException(_localizer["DAS_NoAnonCacheData"]);
|
||||
}
|
||||
|
||||
|
||||
foreach (var item in anonymize_AddFixedFiledList.Union(anonymize_FixedFieldList))
|
||||
foreach (var item in fixedFiledList)
|
||||
{
|
||||
|
||||
var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||
@@ -95,7 +75,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
dataset.AddOrUpdate(dicomTag, item.ReplaceValue);
|
||||
}
|
||||
|
||||
foreach (var item in anonymize_AddIRCInfoFiledList.Union(anonymize_IRCInfoFieldList))
|
||||
foreach (var item in ircFiledList)
|
||||
{
|
||||
|
||||
var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||
@@ -291,7 +271,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
var dbStudyCodeIntMax = _studyRepository.Where(s => s.TrialId == addtionalInfo.TrialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
//获取缓存中的值 并发的时候,需要记录,已被占用的值 这样其他线程在此占用的最大的值上递增
|
||||
var cacheMaxCodeInt = _provider.Get<int>($"{addtionalInfo.TrialId}_{StaticData.CacheKey.StudyMaxCode}").Value;
|
||||
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(addtionalInfo.TrialId));
|
||||
|
||||
int currentNextCodeInt = cacheMaxCodeInt > dbStudyCodeIntMax ? cacheMaxCodeInt + 1 : dbStudyCodeIntMax + 1;
|
||||
|
||||
@@ -299,53 +279,10 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
dicomStudy.StudyCode = AppSettings.GetCodeStr(currentNextCodeInt, nameof(DicomStudy));
|
||||
|
||||
_provider.Set<int>($"{addtionalInfo.TrialId}_{StaticData.CacheKey.StudyMaxCode}", dicomStudy.Code, TimeSpan.FromMinutes(30));
|
||||
_fusionCache.Set(CacheKeys.TrialStudyMaxCode(addtionalInfo.TrialId), dicomStudy.Code, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
|
||||
|
||||
#region Setting Code old
|
||||
|
||||
//var studyCode = _studyRepository.Where(s => s.TrialId == addtionalInfo.TrialId).Select(t => t.StudyCode).OrderByDescending(c => c).FirstOrDefault();
|
||||
|
||||
//var cacheMaxCode = _provider.Get<string>($"{addtionalInfo.TrialId }_{ StaticData.StudyMaxCode}").Value;
|
||||
|
||||
//if (studyCode == null && string.IsNullOrEmpty(cacheMaxCode))
|
||||
//{
|
||||
// dicomStudy.StudyCode = "ST" + 1.ToString().PadLeft(5, '0');
|
||||
|
||||
// _logger.LogWarning($"Thread {id} DB:{studyCode} 生成{ dicomStudy.StudyCode}");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// int dbNum = 0;
|
||||
|
||||
// int cacheNum = 0;
|
||||
|
||||
// if (studyCode != null)
|
||||
// {
|
||||
// int.TryParse(studyCode.Substring(studyCode.Length - 5, 5), out dbNum);
|
||||
// }
|
||||
|
||||
// if (!string.IsNullOrEmpty(cacheMaxCode))
|
||||
// {
|
||||
// int.TryParse(cacheMaxCode.Substring(cacheMaxCode.Length - 5, 5), out cacheNum);
|
||||
// }
|
||||
|
||||
// dbNum = cacheNum > dbNum ? cacheNum : dbNum;
|
||||
|
||||
|
||||
// dicomStudy.StudyCode = "ST" + (++dbNum).ToString().PadLeft(5, '0');
|
||||
|
||||
// _logger.LogWarning($" Thread {id} DB:{studyCode} cache:{cacheNum} 生成{ dicomStudy.StudyCode}");
|
||||
//}
|
||||
|
||||
//_provider.Set<string>($"{addtionalInfo.TrialId }_{ StaticData.StudyMaxCode}", dicomStudy.StudyCode, TimeSpan.FromMinutes(30));
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
return dicomStudy;
|
||||
|
||||
|
||||
@@ -564,7 +501,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
findStudy.Modalities = modality;
|
||||
findStudy.ModalityForEdit= modalityForEdit;
|
||||
findStudy.ModalityForEdit = modalityForEdit;
|
||||
|
||||
if (findStudy.PatientBirthDate.Length == 8)
|
||||
{
|
||||
@@ -657,13 +594,13 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
if (isStudyNeedAdd)
|
||||
{
|
||||
await _studyRepository.AddAsync(findStudy);
|
||||
await _studyRepository.AddAsync(findStudy);
|
||||
}
|
||||
if(isSeriesNeedAdd)
|
||||
if (isSeriesNeedAdd)
|
||||
{
|
||||
await _seriesRepository.AddAsync(findSerice);
|
||||
}
|
||||
if(isInstanceNeedAdd)
|
||||
if (isInstanceNeedAdd)
|
||||
{
|
||||
await _instanceRepository.AddAsync(findInstance);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using FellowOakDicom;
|
||||
using FellowOakDicom;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
@@ -9,19 +8,21 @@ using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using MassTransit;
|
||||
using MassTransit.Initializers;
|
||||
using MathNet.Numerics;
|
||||
using Medallion.Threading;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Data;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
@@ -30,28 +31,23 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true);
|
||||
}
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class DownloadAndUploadService : BaseService, IDownloadAndUploadService
|
||||
public class DownloadAndUploadService(
|
||||
IRepository<SystemAnonymization> _systemAnonymizationRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IOSSService _oSSService,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||
IRepository<TaskStudy> _taskStudyRepository,
|
||||
IRepository<TaskSeries> _taskSeriesRepository,
|
||||
IRepository<TaskInstance> _taskInstanceRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<NoneDicomStudy> _noneDicomStudyReposiotry,
|
||||
IRepository<NoneDicomStudyFile> _noneDicomStudyFileReposiotry,
|
||||
IDistributedLockProvider _distributedLockProvider) : BaseService, IDownloadAndUploadService
|
||||
{
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IRepository<SystemAnonymization> _systemAnonymizationRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IOSSService _oSSService;
|
||||
private readonly IRepository<StudyMonitor> _studyMonitorRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
public DownloadAndUploadService(IEasyCachingProvider provider, IRepository<SystemAnonymization> systemAnonymizationRepository, IRepository<SubjectVisit> subjectVisitRepository, IOSSService oSSService,
|
||||
IRepository<StudyMonitor> studyMonitorRepository, IDistributedLockProvider distributedLockProvider, IRepository<VisitTask> visitTaskRepository)
|
||||
{
|
||||
_systemAnonymizationRepository = systemAnonymizationRepository;
|
||||
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
|
||||
_oSSService = oSSService;
|
||||
_studyMonitorRepository = studyMonitorRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_provider = provider;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 受试者随机阅片,任务进行随机编号
|
||||
@@ -104,14 +100,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
/// <summary>
|
||||
/// 获取该受试者任务上传列表(展示已上传情况)
|
||||
/// </summary>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <param name="trialReadingCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(Guid subjectId, Guid trialReadingCriterionId)
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(IRUploadStudyQuery inQuery)
|
||||
{
|
||||
await SubejctRandomReadingTaskNameDeal(subjectId, trialReadingCriterionId);
|
||||
await SubejctRandomReadingTaskNameDeal(inQuery.SubjectId, inQuery.TrialReadingCriterionId);
|
||||
|
||||
var query = _repository.Where<VisitTask>(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.SourceSubjectVisitId != null
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null
|
||||
&& t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
.Select(u => new SubjectImageUploadDTO()
|
||||
{
|
||||
@@ -171,7 +166,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
})
|
||||
;
|
||||
|
||||
var list = await query.ToListAsync();
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
@@ -186,7 +181,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
study.PatientBirthDate = $"{study.PatientBirthDate[0]}{study.PatientBirthDate[1]}{study.PatientBirthDate[2]}{study.PatientBirthDate[3]}-{study.PatientBirthDate[4]}{study.PatientBirthDate[5]}-{study.PatientBirthDate[6]}{study.PatientBirthDate[7]}";
|
||||
}
|
||||
|
||||
var dicModalityList = _repository.Where<Dictionary>(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList();
|
||||
var dicModalityList = _dictionaryRepository.Where(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList();
|
||||
|
||||
|
||||
var modality = study.Modalities;
|
||||
@@ -249,7 +244,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
#region 获取该subject 已生成任务的访视的检查
|
||||
|
||||
var queryStudy = _repository.Where<VisitTask>(t => t.SubjectId == incommand.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id).Select(u => new
|
||||
var queryStudy = _visitTaskRepository.Where(t => t.SubjectId == incommand.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id).Select(u => new
|
||||
{
|
||||
VisitTaskId = u.Id,
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
@@ -298,17 +293,17 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
//查询数据库获取最大的Code 没有记录则为0
|
||||
var dbStudyCodeIntMax = _repository.Where<TaskStudy>(s => s.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
var dbStudyCodeIntMax = _taskStudyRepository.Where(s => s.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
//获取缓存中的值 并发的时候,需要记录,已被占用的值 这样其他线程在此占用的最大的值上递增
|
||||
var cacheMaxCodeInt = _provider.Get<int>($"{trialId}_{StaticData.CacheKey.StudyMaxCode}").Value;
|
||||
var cacheMaxCodeInt = await _fusionCache.GetOrDefaultAsync<int>(CacheKeys.TrialStudyMaxCode(trialId));
|
||||
|
||||
int currentNextCodeInt = cacheMaxCodeInt > dbStudyCodeIntMax ? cacheMaxCodeInt + 1 : dbStudyCodeIntMax + 1;
|
||||
study.Code = currentNextCodeInt;
|
||||
|
||||
study.StudyCode = AppSettings.GetCodeStr(currentNextCodeInt, nameof(DicomStudy));
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.StudyMaxCode}", study.Code, TimeSpan.FromMinutes(30));
|
||||
await _fusionCache.SetAsync<int>(CacheKeys.TrialStudyMaxCode(trialId), study.Code, TimeSpan.FromMinutes(30));
|
||||
|
||||
}
|
||||
|
||||
@@ -325,7 +320,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
SpecialArchiveStudyDeal(study);
|
||||
modalitys = study.Modalities;
|
||||
|
||||
await _repository.AddAsync(study);
|
||||
await _taskStudyRepository.AddAsync(study);
|
||||
|
||||
|
||||
studyMonitor.StudyId = study.Id;
|
||||
@@ -347,7 +342,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
//前端传递的数量不准,上传的时候,把失败的也加进来了,以实际数组的数字为准
|
||||
series.InstanceCount = seriesItem.InstanceList.Count;
|
||||
|
||||
await _repository.AddAsync(series);
|
||||
await _taskSeriesRepository.AddAsync(series);
|
||||
|
||||
foreach (var instanceItem in seriesItem.InstanceList)
|
||||
{
|
||||
@@ -364,7 +359,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
//isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
isntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
await _repository.AddAsync(isntance);
|
||||
await _taskInstanceRepository.AddAsync(isntance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,7 +372,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
|
||||
var study = await _repository.FirstOrDefaultAsync<TaskStudy>(t => t.Id == studyId);
|
||||
var study = await _taskStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||
|
||||
//重传的时候也要赋值检查Id
|
||||
studyMonitor.StudyId = study.Id;
|
||||
@@ -396,7 +391,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
var seriesId = IdentifierHelper.CreateGuid(seriesItem.StudyInstanceUid, seriesItem.SeriesInstanceUid, trialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
|
||||
TaskSeries dicomSeries = await _repository.FirstOrDefaultAsync<TaskSeries>(t => t.Id == seriesId);
|
||||
TaskSeries dicomSeries = await _taskSeriesRepository.FirstOrDefaultAsync(t => t.Id == seriesId);
|
||||
|
||||
//判断重复
|
||||
if (dicomSeries == null)
|
||||
@@ -412,7 +407,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
//series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
||||
dicomSeries = await _repository.AddAsync(series);
|
||||
dicomSeries = await _taskSeriesRepository.AddAsync(series);
|
||||
|
||||
//新的序列 那么 检查的序列数量+1
|
||||
study.SeriesCount += 1;
|
||||
@@ -434,7 +429,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
await _repository.AddAsync(insntance);
|
||||
await _taskInstanceRepository.AddAsync(insntance);
|
||||
}
|
||||
|
||||
|
||||
@@ -450,7 +445,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
using (await @lock2.AcquireAsync())
|
||||
{
|
||||
await _repository.SaveChangesAsync();
|
||||
await _taskStudyRepository.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -460,7 +455,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
}
|
||||
finally
|
||||
{
|
||||
_provider.Remove($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}");
|
||||
await _fusionCache.RemoveAsync(CacheKeys.TrialStudyUidUploading(incommand.TrialId, incommand.Study.StudyInstanceUid));
|
||||
}
|
||||
|
||||
|
||||
@@ -474,12 +469,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
|
||||
[HttpDelete]
|
||||
public async Task<IResponseOutput> DeleteTaskStudy(Guid visitTaskId)
|
||||
public async Task<IResponseOutput> DeleteTaskStudy(Guid visitTaskId, bool isDicom, Guid? noneDicomStudyId)
|
||||
{
|
||||
|
||||
await _repository.BatchDeleteAsync<TaskStudy>(t => t.VisitTaskId == visitTaskId);
|
||||
await _repository.BatchDeleteAsync<TaskSeries>(t => t.VisitTaskId == visitTaskId);
|
||||
await _repository.BatchDeleteAsync<TaskInstance>(t => t.VisitTaskId == visitTaskId);
|
||||
if (isDicom)
|
||||
{
|
||||
await _taskStudyRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId);
|
||||
await _taskSeriesRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId);
|
||||
await _taskInstanceRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _noneDicomStudyFileReposiotry.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visitTaskId && t.NoneDicomStudyId == noneDicomStudyId);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -496,7 +497,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
|
||||
|
||||
var extralConfig = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||
var extralConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||
|
||||
var config = JsonConvert.DeserializeObject<TrialExtraConfig>(extralConfig) ?? new TrialExtraConfig();
|
||||
|
||||
@@ -554,7 +555,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
if (inQuery.TrialReadingCriterionId != null)
|
||||
{
|
||||
var criterionInfo = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstOrDefaultAsync();
|
||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstOrDefaultAsync();
|
||||
|
||||
if (criterionInfo != null)
|
||||
{
|
||||
@@ -614,7 +615,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
}
|
||||
else if (inQuery.SubejctId != null)
|
||||
{
|
||||
var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubejctId).SelectMany(t=>t.SubjectVisitList)
|
||||
var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubejctId).SelectMany(t => t.SubjectVisitList)
|
||||
|
||||
|
||||
select new
|
||||
@@ -662,7 +663,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.NotOk("不允许 subjectId subjectId 都不传递");
|
||||
return ResponseOutput.NotOk("不允许 subjectId SubejectVisitId 都不传递");
|
||||
}
|
||||
|
||||
|
||||
@@ -676,6 +677,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
/// <param name="isDicom"></param>
|
||||
/// <param name="isAnonymize"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true)
|
||||
{
|
||||
|
||||
@@ -900,5 +902,343 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region 按照任务为维度 展示上传的列表 废弃
|
||||
/// <summary>
|
||||
/// IR 影像上传任务列表 --old 20240903 界面调整,现在先废弃
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<SubjectUploadTaskInfo>> GetIRUploadTaskList_Old(CRCUploadTaskQuery inQuery)
|
||||
{
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
.ProjectTo<SubjectUploadTaskInfo>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
/// <summary>
|
||||
/// IR 上传任务 dicom 列表 后处理的数据不能排序 --old 20240903 界面调整,现在先废弃
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<IRUploadTaskDicomStudyDto>> GetIRUploadTaskDicomStudyList_Old(CRCUploadTaskStudyQuery inQuery)
|
||||
{
|
||||
var list = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId)
|
||||
.SelectMany(t => t.SourceSubjectVisit.StudyList)
|
||||
.ProjectTo<IRUploadTaskDicomStudyDto>(_mapper.ConfigurationProvider).SortToListAsync(inQuery);
|
||||
|
||||
var taskDicomStudyList = _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId)
|
||||
.SelectMany(t => t.TaskStudyList)
|
||||
.Select(u => new
|
||||
{
|
||||
u.Id,
|
||||
u.SeriesCount,
|
||||
u.InstanceCount,
|
||||
SopInstanceList = u.InstanceList.Select(t => t.SopInstanceUid).ToList()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
var find = taskDicomStudyList.FirstOrDefault(t => t.Id == item.Id);
|
||||
|
||||
if (find != null)
|
||||
{
|
||||
item.UploadedInstanceCount = find.InstanceCount;
|
||||
item.UploadedSopInstanceUidList = find.SopInstanceList;
|
||||
item.UploadedSeriesCount = find.SeriesCount;
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IR 上传任务 nonedicom 列表 后处理的数据不能排序 --old 20240903 界面调整,现在先废弃
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<IRUploadTaskNoneDicomStudyDto>> GetIRUploadTaskNoneDicomStudyList_Old(CRCUploadTaskStudyQuery inQuery)
|
||||
{
|
||||
var list = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId)
|
||||
.SelectMany(t => t.SourceSubjectVisit.StudyList)
|
||||
.ProjectTo<IRUploadTaskNoneDicomStudyDto>(_mapper.ConfigurationProvider).SortToListAsync(inQuery);
|
||||
|
||||
var taskNoneDicomStudyList = _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId)
|
||||
.SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => t.VisitTaskId == inQuery.VisitTaskId)
|
||||
.Select(u => new
|
||||
{
|
||||
u.OriginNoneDicomStudyId,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.UploadedFileCount = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).Count();
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region IR 上传 列表,dicom 上以任务为维度,非dicom 以检查为维度
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IR 上传任务 nonedicom 列表 后处理的数据UploadedFileCount不能排序 --new
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<TaskNoneDicomStudyDTO>> GetIRUploadTaskNoneDicomStudyList(IRUploadStudyQuery inQuery)
|
||||
{
|
||||
var query = from u in _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
join ns in _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId) on u.SourceSubjectVisitId equals ns.SubjectVisitId
|
||||
|
||||
select new TaskNoneDicomStudyDTO()
|
||||
{
|
||||
SubjectId = u.SubjectId,
|
||||
SubjectCode = u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
TaskName = u.TaskName,
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
|
||||
Id = ns.Id,
|
||||
Description = ns.Description,
|
||||
ImageDate = ns.ImageDate,
|
||||
BodyPart = ns.BodyPart,
|
||||
FileCount = ns.FileCount,
|
||||
Modality = ns.Modality,
|
||||
StudyCode = ns.StudyCode,
|
||||
|
||||
};
|
||||
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).SortToListAsync(inQuery);
|
||||
|
||||
var noneDicomStudyIdList = list.Select(t => t.Id).ToList();
|
||||
|
||||
|
||||
var taskNoneDicomStudyList = _visitTaskRepository.Where(t => noneDicomStudyIdList.Contains(t.Id))
|
||||
.SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => noneDicomStudyIdList.Contains((Guid)t.VisitTaskId))
|
||||
.Select(u => new
|
||||
{
|
||||
u.OriginNoneDicomStudyId,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.UploadedFileCount = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).Count();
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IQC 获取CRC 上传到某一个访视的的检查信息 (原始影像信息 包含dicom 非dicom)
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> GetCRCUploadedStudyInfo(CRCUploadedStudyQuqry inQuery)
|
||||
{
|
||||
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
||||
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
||||
|
||||
var query = from sv in _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId)
|
||||
|
||||
|
||||
select new
|
||||
{
|
||||
SubjectCode = sv.Subject.Code,
|
||||
VisitName = sv.VisitName,
|
||||
|
||||
StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
|
||||
|
||||
.Select(u => new
|
||||
{
|
||||
u.PatientId,
|
||||
u.StudyTime,
|
||||
u.StudyCode,
|
||||
|
||||
SeriesList = u.SeriesList.Select(z => new
|
||||
{
|
||||
z.Modality,
|
||||
|
||||
InstanceList = z.DicomInstanceList.Select(k => new
|
||||
{
|
||||
k.Path,
|
||||
k.FileSize
|
||||
})
|
||||
})
|
||||
|
||||
}).ToList(),
|
||||
|
||||
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
||||
|
||||
.Select(nd => new
|
||||
{
|
||||
nd.Modality,
|
||||
nd.StudyCode,
|
||||
nd.ImageDate,
|
||||
|
||||
FileList = nd.NoneDicomFileList.Select(file => new
|
||||
{
|
||||
file.FileName,
|
||||
file.Path,
|
||||
file.FileType
|
||||
})
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
var result = query.FirstOrDefault();
|
||||
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IR 阅片页面 和IR 任务列表页面下载 勾选下载列表(后端要考虑到一致性分析 subjectCode的问题)
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<SubjectCRCImageUploadedStudyDto>> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery)
|
||||
{
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||
|
||||
#region 将任务级别转为检查级别
|
||||
|
||||
var result = new List<SubjectCRCImageUploadedStudyDto>();
|
||||
|
||||
var dicomStudyList = list.Where(item => item.DicomStudyList.Count > 0)
|
||||
.Select(item => new SubjectCRCImageUploadedStudyDto
|
||||
{
|
||||
VisitTaskId = item.VisitTaskId,
|
||||
SubjectId = item.SubjectId,
|
||||
SubjectCode = item.SubjectCode,
|
||||
TaskBlindName = item.TaskBlindName,
|
||||
TaskName = item.TaskName,
|
||||
IsImageFilter = item.IsImageFilter,
|
||||
CriterionModalitys = item.CriterionModalitys,
|
||||
SourceSubjectVisitId = item.SourceSubjectVisitId,
|
||||
//取dicom
|
||||
DicomStudyList = item.DicomStudyList,
|
||||
}).ToList();
|
||||
|
||||
var noneStudyList = list.Where(item => item.NoneDicomStudyList.Count > 0)
|
||||
.Select(item => new SubjectCRCImageUploadedStudyDto
|
||||
{
|
||||
VisitTaskId = item.VisitTaskId,
|
||||
SubjectId = item.SubjectId,
|
||||
SubjectCode = item.SubjectCode,
|
||||
TaskBlindName = item.TaskBlindName,
|
||||
TaskName = item.TaskName,
|
||||
IsImageFilter = item.IsImageFilter,
|
||||
CriterionModalitys = item.CriterionModalitys,
|
||||
SourceSubjectVisitId = item.SourceSubjectVisitId,
|
||||
//非dicom
|
||||
NoneDicomStudyList = item.NoneDicomStudyList,
|
||||
}).ToList();
|
||||
|
||||
|
||||
result.AddRange(dicomStudyList);
|
||||
result.AddRange(noneStudyList);
|
||||
#endregion
|
||||
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题)
|
||||
/// 检查在访视下面,所以需要传递下载的访视Id,另外下载访视下面那些检查,就把访视下的对应的检查Id 丢到数组里就好
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_subjectRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery, [FromServices] IRepository<Subject> _subjectRepository)
|
||||
{
|
||||
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||
.Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync();
|
||||
|
||||
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
||||
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
||||
|
||||
var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubjectId).SelectMany(t => t.SubjectVisitList.Where(t => inQuery.SubjectVisitIdList.Contains(t.Id)))
|
||||
|
||||
select new
|
||||
{
|
||||
SubjectCode = sv.Subject.Code,
|
||||
VisitName = sv.VisitName,
|
||||
StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
|
||||
.Select(u => new
|
||||
{
|
||||
u.PatientId,
|
||||
u.StudyTime,
|
||||
u.StudyCode,
|
||||
|
||||
SeriesList = u.SeriesList.Select(z => new
|
||||
{
|
||||
z.Modality,
|
||||
|
||||
InstancePathList = z.DicomInstanceList.Select(k => new
|
||||
{
|
||||
k.Path
|
||||
})
|
||||
})
|
||||
|
||||
}),
|
||||
|
||||
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
||||
.Select(nd => new
|
||||
{
|
||||
nd.Modality,
|
||||
nd.StudyCode,
|
||||
nd.ImageDate,
|
||||
|
||||
FileList = nd.NoneDicomFileList.Select(file => new
|
||||
{
|
||||
file.FileName,
|
||||
file.Path,
|
||||
file.FileType
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
|
||||
var result = await query.FirstOrDefaultAsync();
|
||||
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user