Merge branch 'Test_IRC_Net10' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net10

Uat_IRC_Net10
he 2026-07-10 18:05:16 +08:00
commit 28e367eb88
10 changed files with 205 additions and 162 deletions

View File

@ -1,32 +1,28 @@
{ {
//
"Logging": { "Logging": {
//
"LogLevel": { "LogLevel": {
//
"Default": "Information", "Default": "Information",
//
"Microsoft": "Warning", "Microsoft": "Warning",
// ASP.NET Core
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
}, },
//
"ConnectionStrings": { "ConnectionStrings": {
//
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true", "RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
// Hangfire
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;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"
}, },
"WeComNoticeConfig": { "WeComNoticeConfig": {
"IsOpenWeComNotice": true, "IsOpenWeComNotice": true,
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322 "WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449",
"APINoticeUserList": [ "u", "wait..." ], "APINoticeUserList": [
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ] "u",
"wait..."
],
"VueNoticeUserList": [
"wangxiaoshuang",
"6b7717a31647293621b97b96f74e6f3d"
]
}, },
//
"ObjectStoreService": { "ObjectStoreService": {
// 使
"ObjectStoreUse": "AliyunOSS", "ObjectStoreUse": "AliyunOSS",
"IsOpenStoreSync": true, "IsOpenStoreSync": true,
"ApiDeployRegion": "CN", "ApiDeployRegion": "CN",
@ -48,168 +44,88 @@
"IsOpenSync": true "IsOpenSync": true
} }
], ],
//
"AliyunOSS": { "AliyunOSS": {
// OSS Region ID
"RegionId": "cn-shanghai", "RegionId": "cn-shanghai",
// OSS 访
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
// OSS 访
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com", "EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
// OSS 访 ID
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm", "AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
// OSS 访 Secret
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV", "AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
// OSS ARN
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access", "RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
// OSS Bucket
"BucketName": "zy-irc-test-store", "BucketName": "zy-irc-test-store",
// OSS 访
"ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com", "ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com",
// OSS
"Region": "oss-cn-shanghai", "Region": "oss-cn-shanghai",
// OSS 访
"DurationSeconds": 7200, "DurationSeconds": 7200,
// OSS
"PreviewEndpoint": "https://test-oss.test.extimaging.com" "PreviewEndpoint": "https://test-oss.test.extimaging.com"
}, },
// MinIO
"MinIO": { "MinIO": {
// MinIO 访
"EndPoint": "hir-oss.test.extimaging.com", "EndPoint": "hir-oss.test.extimaging.com",
// MinIO
"Port": "443", "Port": "443",
// 使 SSL
"UseSSL": true, "UseSSL": true,
// MinIO ARN
"AccessKey": "fbStsVYCIPKHQneeqMwD", "AccessKey": "fbStsVYCIPKHQneeqMwD",
// MinIO 访
"SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy", "SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
// MinIO BucketName
"BucketName": "irc-test", "BucketName": "irc-test",
// MinIO 访
"ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test" "ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
}, },
// AWS S3
"AWS": { "AWS": {
// AWS S3 Region
"Region": "us-east-1", "Region": "us-east-1",
// AWS S3 访
"EndPoint": "s3.us-east-1.amazonaws.com", "EndPoint": "s3.us-east-1.amazonaws.com",
// 使 SSL
"UseSSL": true, "UseSSL": true,
// AWS S3 ARN
"RoleArn": "arn:aws:iam::471112624751:role/uat_s3_access", "RoleArn": "arn:aws:iam::471112624751:role/uat_s3_access",
// AWS S3 访 ID
"AccessKeyId": "AKIAW3MEAFJX7IPXISP4", "AccessKeyId": "AKIAW3MEAFJX7IPXISP4",
// AWS S3 访 Secret
"SecretAccessKey": "Pgrg3le5jPxZQ7MR1yYNS30J0XRyJeKVyIIjElXc", "SecretAccessKey": "Pgrg3le5jPxZQ7MR1yYNS30J0XRyJeKVyIIjElXc",
// AWS S3 Bucket
"BucketName": "ei-med-s3-lili-uat-store", "BucketName": "ei-med-s3-lili-uat-store",
// AWS S3 访
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com", "ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com",
// AWS S3
"DurationSeconds": 7200 "DurationSeconds": 7200
} }
}, },
//
"BasicSystemConfig": { "BasicSystemConfig": {
//
"QCRiskControl": true, "QCRiskControl": true,
//
"OpenUserComplexPassword": false, "OpenUserComplexPassword": false,
//
"OpenSignDocumentBeforeWork": false, "OpenSignDocumentBeforeWork": false,
//
"OpenLoginLimit": false, "OpenLoginLimit": false,
//
"LoginMaxFailCount": 5, "LoginMaxFailCount": 5,
//
"LoginFailLockMinutes": 1, "LoginFailLockMinutes": 1,
//
"AutoLoginOutMinutes": 10, "AutoLoginOutMinutes": 10,
// MFA
"OpenLoginMFA": false, "OpenLoginMFA": false,
//
"ContinuousReadingTimeMin": 120, "ContinuousReadingTimeMin": 120,
//
"ReadingRestTimeMin": 10, "ReadingRestTimeMin": 10,
//
"IsNeedChangePassWord": true, "IsNeedChangePassWord": true,
//
"ChangePassWordDays": 90, "ChangePassWordDays": 90,
// 1 ElevateLiLi 2 Extensive()
"TemplateType": 2, "TemplateType": 2,
// "OpenTrialRelationDelete": false,
"OpenTrialRelationDelete": true,
// PDF
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf", "ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf",
//MFA
"UserMFAVerifyMinutes": 1440 "UserMFAVerifyMinutes": 1440
}, },
//
"SystemEmailSendConfig": { "SystemEmailSendConfig": {
// SMTP
"Host": "smtp.qiye.aliyun.com", "Host": "smtp.qiye.aliyun.com",
// SMTP
"Port": 465, "Port": 465,
"Imap": "imap.qiye.aliyun.com", "Imap": "imap.qiye.aliyun.com",
"ImapPort": 993, "ImapPort": 993,
//
"FromEmail": "test@extimaging.com", "FromEmail": "test@extimaging.com",
//
"FromName": "Test EIC Imaging System", "FromName": "Test EIC Imaging System",
// SMTP
"AuthorizationCode": "SHzyyl2021", "AuthorizationCode": "SHzyyl2021",
// 访
"SiteUrl": "http://irc.test.extimaging.com/login", "SiteUrl": "http://irc.test.extimaging.com/login",
// - 使
"SystemShortName": "IRC", "SystemShortName": "IRC",
// -
"OrganizationName": "ExtImaging", "OrganizationName": "ExtImaging",
//
"OrganizationNameCN": "ExtImaging", "OrganizationNameCN": "ExtImaging",
"PlatformName": "EICS", "PlatformName": "EICS",
"PlatformNameCN": "展影云平台", "PlatformNameCN": "展影云平台",
//
"CompanyName": "Extensive Imaging", "CompanyName": "Extensive Imaging",
//
"CompanyNameCN": "上海展影医疗科技有限公司", "CompanyNameCN": "上海展影医疗科技有限公司",
//
"CompanyShortName": "Extensive Imaging", "CompanyShortName": "Extensive Imaging",
//
"CompanyShortNameCN": "展影医疗", "CompanyShortNameCN": "展影医疗",
// 便lili irc
"IsEnv_US": false, "IsEnv_US": false,
//
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", "EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
//
"CronEmailDefaultCulture": "zh-CN" "CronEmailDefaultCulture": "zh-CN"
}, },
// PACS
"SystemPacsConfig": { "SystemPacsConfig": {
// PACS
"Port": "11113", "Port": "11113",
// PACSIP
"IP": "106.14.89.110" "IP": "106.14.89.110"
}, },
//
"RequestDuplicationOptions": { "RequestDuplicationOptions": {
//
"IsEnabled": true, "IsEnabled": true,
//
"DuplicationWindowMs": 500, "DuplicationWindowMs": 500,
//
"CacheTimeSeconds": 5, "CacheTimeSeconds": 5,
"ExcludedPaths": [ "ExcludedPaths": []
]
} }
} }

View File

@ -8,6 +8,8 @@ public static class CacheKeys
//项目缓存 //项目缓存
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}"; public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
public static string TrialVisitTaskMaxCode(Guid trialId) => $"TrialVisitTaskMaxCode:{trialId}";
//检查编号递增锁 //检查编号递增锁
public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}"; public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}";

View File

@ -337,6 +337,12 @@
<param name="taskId"></param> <param name="taskId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GenerateTaskNo">
<summary>
从 NewId 的后 3 个字节24 位)生成一个 6 位十六进制字符串
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GetIsClinicalDataSignTest(System.Guid)"> <member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GetIsClinicalDataSignTest(System.Guid)">
<summary> <summary>
获取GetIsClinicalDataSignTest 获取GetIsClinicalDataSignTest
@ -17537,17 +17543,17 @@
</member> </member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question"> <member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
<summary> <summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 质疑
</summary> </summary>
</member> </member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency"> <member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
<summary> <summary>
һ<EFBFBD><EFBFBD><EFBFBD>Ժ˲<EFBFBD> 一致性核查
</summary> </summary>
</member> </member>
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto"> <member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
<summary> <summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 复制
</summary> </summary>
</member> </member>
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView"> <member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">

View File

@ -439,6 +439,8 @@ namespace IRaCIS.Core.Application.ViewModel
public string TaskName { get; set; } = String.Empty; public string TaskName { get; set; } = String.Empty;
public string TaskBlindName { get; set; } = String.Empty;
public Guid? DoctorUserId { get; set; } public Guid? DoctorUserId { get; set; }
public ReadingCategory? ReadingCategory { get; set; } public ReadingCategory? ReadingCategory { get; set; }

View File

@ -124,6 +124,45 @@ namespace IRaCIS.Core.Application.Service
} }
#region 获取随机编号
/// <summary>
/// 从 NewId 的后 3 个字节24 位)生成一个 6 位十六进制字符串
/// </summary>
/// <returns></returns>
public static string GenerateTaskNo()
{
var bytes = NewId.Next().ToByteArray();
uint value =
BitConverter.ToUInt32(bytes, 0)
^ BitConverter.ToUInt32(bytes, 4)
^ BitConverter.ToUInt32(bytes, 8)
^ BitConverter.ToUInt32(bytes, 12);
return (value & 0xFFFFFF).ToString("X6");
}
private async Task<string> GetRandomTaskName(Guid trialId, List<string> existList)
{
var taskName = GenerateTaskNo();
while (existList.Any(t => t == taskName))
{
taskName = GenerateTaskNo();
}
while (await _visitTaskRepository.AnyAsync(t => t.TaskBlindName == taskName && t.TrialId == trialId))
{
taskName = GenerateTaskNo();
}
existList.Add(taskName);
return taskName;
}
#endregion
//基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务) //基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务)
public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null) public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null)
@ -151,11 +190,11 @@ namespace IRaCIS.Core.Application.Service
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max(); var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId)); var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode; int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
var randomTaskBlindNameList = new List<string>();
foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() })) foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() }))
{ {
@ -173,6 +212,8 @@ namespace IRaCIS.Core.Application.Service
var blindTaskName = string.Empty; var blindTaskName = string.Empty;
var isRandom = false;
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder) if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{ {
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0) if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0)
@ -185,6 +226,12 @@ namespace IRaCIS.Core.Application.Service
} }
} }
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
{
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
isRandom = true;
}
else else
{ {
blindTaskName = "Timepoint"; blindTaskName = "Timepoint";
@ -258,12 +305,14 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
var blindTaskName2 = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
task2 = await _visitTaskRepository.AddAsync(new VisitTask() task2 = await _visitTaskRepository.AddAsync(new VisitTask()
{ {
TrialId = trialId, TrialId = trialId,
SubjectId = subjectVisit.SubjectId, SubjectId = subjectVisit.SubjectId,
IsUrgent = subjectVisit.IsUrgent, IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName, TaskBlindName = blindTaskName2,
TaskName = subjectVisit.VisitName, TaskName = subjectVisit.VisitName,
TaskUrgentType = taskUrgentType, TaskUrgentType = taskUrgentType,
IsCanEditUrgentState = isCanEditUrgentState, IsCanEditUrgentState = isCanEditUrgentState,
@ -283,7 +332,7 @@ namespace IRaCIS.Core.Application.Service
} }
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
@ -344,7 +393,7 @@ namespace IRaCIS.Core.Application.Service
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
@ -590,11 +639,11 @@ namespace IRaCIS.Core.Application.Service
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max(); var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId)); var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode; int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
var randomTaskBlindNameList = new List<string>();
switch (generateTaskCommand.ReadingCategory) switch (generateTaskCommand.ReadingCategory)
@ -654,7 +703,9 @@ namespace IRaCIS.Core.Application.Service
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false); var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
var blindTaskName = string.Empty; var blindTaskName = string.Empty;
var isFullRandom = false;
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder) if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{ {
@ -668,6 +719,12 @@ namespace IRaCIS.Core.Application.Service
} }
} }
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
{
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
isFullRandom = true;
}
//受试者随机
else else
{ {
blindTaskName = "Timepoint"; blindTaskName = "Timepoint";
@ -721,11 +778,15 @@ namespace IRaCIS.Core.Application.Service
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2)) if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))
{ {
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
var blindTaskName2 = isFullRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
task2 = await _visitTaskRepository.AddAsync(new VisitTask() task2 = await _visitTaskRepository.AddAsync(new VisitTask()
{ {
TrialId = trialId, TrialId = trialId,
SubjectId = subjectVisit.SubjectId, SubjectId = subjectVisit.SubjectId,
TaskBlindName = blindTaskName, TaskBlindName = blindTaskName2,
TaskName = subjectVisit.VisitName, TaskName = subjectVisit.VisitName,
IsUrgent = subjectVisit.IsUrgent, IsUrgent = subjectVisit.IsUrgent,
@ -747,7 +808,7 @@ namespace IRaCIS.Core.Application.Service
} }
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
#region 分配 #region 分配
@ -920,7 +981,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
} }
@ -992,7 +1053,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
} }
@ -1069,7 +1130,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
#region 分配 #region 分配
@ -1197,7 +1258,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
} }
@ -1277,6 +1338,7 @@ namespace IRaCIS.Core.Application.Service
var reReadingVisitTask = generateTaskCommand.ReReadingTask; var reReadingVisitTask = generateTaskCommand.ReReadingTask;
Guid? subjectVisitId = Guid.Empty; Guid? subjectVisitId = Guid.Empty;
if (reReadingVisitTask.SourceSubjectVisitId == null) if (reReadingVisitTask.SourceSubjectVisitId == null)
@ -1317,6 +1379,10 @@ namespace IRaCIS.Core.Application.Service
//&& t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId && t.TaskState == TaskState.Effect //&& t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId && t.TaskState == TaskState.Effect
// && t.SourceSubjectVisitId == reReadingVisitTask.SourceSubjectVisitId && t.ArmEnum == reReadingVisitTask.ArmEnum && t.DoctorUserId == reReadingVisitTask.DoctorUserId).FirstOrDefault(); // && t.SourceSubjectVisitId == reReadingVisitTask.SourceSubjectVisitId && t.ArmEnum == reReadingVisitTask.ArmEnum && t.DoctorUserId == reReadingVisitTask.DoctorUserId).FirstOrDefault();
var isRandomReading = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
var taskBlindName = isRandomReading ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : reReadingVisitTask.TaskBlindName;
var newTask = await _visitTaskRepository.AddAsync(new VisitTask() var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
{ {
@ -1325,7 +1391,7 @@ namespace IRaCIS.Core.Application.Service
SubjectId = reReadingVisitTask.SubjectId, SubjectId = reReadingVisitTask.SubjectId,
ArmEnum = reReadingVisitTask.ArmEnum, ArmEnum = reReadingVisitTask.ArmEnum,
TaskName = reReadingVisitTask.TaskName, TaskName = reReadingVisitTask.TaskName,
TaskBlindName = reReadingVisitTask.TaskBlindName, TaskBlindName = taskBlindName,
IsUrgent = reReadingVisitTask.IsAnalysisCreate ? false : subjectVisitUrgentInfo.IsUrgent, IsUrgent = reReadingVisitTask.IsAnalysisCreate ? false : subjectVisitUrgentInfo.IsUrgent,
TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent, TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent,
@ -1386,7 +1452,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
//} //}
@ -1491,7 +1557,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
break; break;
@ -1538,7 +1604,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
break; break;
@ -1548,6 +1614,11 @@ namespace IRaCIS.Core.Application.Service
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync(); var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync();
var isRandom = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == firstTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
var blindName = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : firstTask.TaskBlindName;
VisitTask visitTask = new VisitTask() VisitTask visitTask = new VisitTask()
{ {
ArmEnum = Arm.JudgeArm, ArmEnum = Arm.JudgeArm,
@ -1564,7 +1635,7 @@ namespace IRaCIS.Core.Application.Service
SouceReadModuleId = firstTask.SouceReadModuleId, SouceReadModuleId = firstTask.SouceReadModuleId,
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
TaskState = TaskState.Effect, TaskState = TaskState.Effect,
TaskBlindName = firstTask.TaskBlindName, TaskBlindName = blindName,
DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId, DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId,
TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated, TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
AllocateTime = subjectUser == null ? null : DateTime.Now, AllocateTime = subjectUser == null ? null : DateTime.Now,
@ -1576,7 +1647,7 @@ namespace IRaCIS.Core.Application.Service
await _visitTaskRepository.AddAsync(visitTask); await _visitTaskRepository.AddAsync(visitTask);
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask() await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask()
{ {
@ -1637,7 +1708,7 @@ namespace IRaCIS.Core.Application.Service
}); });
currentMaxCodeInt = currentMaxCodeInt + 1; currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
} }
@ -1707,7 +1778,7 @@ namespace IRaCIS.Core.Application.Service
TrialId = originalTaskInfo.TrialId TrialId = originalTaskInfo.TrialId
}); });
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30)); _fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
} }
break; break;
} }

View File

@ -854,7 +854,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
/// <param name="inQuery"></param> /// <param name="inQuery"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery inQuery) public async Task<IResponseOutput<PageOutput<ReReadingTaskView>>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
{ {
var visitTaskQueryable = _visitTaskReReadingRepository var visitTaskQueryable = _visitTaskReReadingRepository
@ -878,6 +878,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
.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.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.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskBlindName))
.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(!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.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1)) .WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
@ -889,7 +890,11 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray); var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList; var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(pageList, criterionInfo);
} }
@ -1242,7 +1247,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
/// <param name="inQuery"></param> /// <param name="inQuery"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery inQuery) public async Task<IResponseOutput<PageOutput<IRHaveReadView>>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
{ {
@ -1261,6 +1266,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState) .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.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.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.TaskBlindName.Contains(inQuery.TaskBlindName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate)) .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.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1)) .WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
@ -1270,7 +1276,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray); var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList; var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(pageList, criterionInfo);
} }
@ -2267,7 +2276,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
_ = _taskSeriesRepository.AddAsync(newSeries).Result; _ = _taskSeriesRepository.AddAsync(newSeries).Result;
var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id).ToList(); var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id && t.SeriesId == series.Id).ToList();
foreach (var instance in studyInstanceList) foreach (var instance in studyInstanceList)
{ {

View File

@ -4,6 +4,7 @@ using Medallion.Threading;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -16,7 +17,7 @@ using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Common; namespace IRaCIS.Core.Application.Service.Common;
[ApiExplorerSettings(GroupName = "Common")] [ApiExplorerSettings(GroupName = "Common")]
public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService public class DeployConfigService(IMapper _mapper, IConfiguration _configuration, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService
{ {
/// <summary> /// <summary>
@ -26,7 +27,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
/// <returns></returns> /// <returns></returns>
public async Task<ServiceVerifyConfigOption> GetSystemBasicConfigInfo([FromServices] IOptionsMonitor<ServiceVerifyConfigOption> options) public async Task<ServiceVerifyConfigOption> GetSystemBasicConfigInfo([FromServices] IOptionsMonitor<ServiceVerifyConfigOption> options)
{ {
return options.CurrentValue; //var config = _configuration.GetSection("BasicSystemConfig").Get<ServiceVerifyConfigOption>();
//return config;
var path = Path.Combine( _hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
var json = File.ReadAllText(path);
var obj = JObject.Parse(json);
return obj["BasicSystemConfig"]!.ToObject<ServiceVerifyConfigOption>()!;
} }
/// <summary> /// <summary>
@ -37,7 +49,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
[HttpPost] [HttpPost]
public async Task<IResponseOutput> UpdateSystemBasicConfig(ServiceVerifyConfigOption basicSystemConfigOption) public async Task<IResponseOutput> UpdateSystemBasicConfig(ServiceVerifyConfigOption basicSystemConfigOption)
{ {
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json"; //var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile"); var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
@ -73,6 +86,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
// 重新写入appsettings.json // 重新写入appsettings.json
string result = obj.ToString(); string result = obj.ToString();
System.IO.File.WriteAllText(path, result); System.IO.File.WriteAllText(path, result);
} }
@ -86,7 +100,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
/// <returns></returns> /// <returns></returns>
public async Task<SystemEmailSendConfig> GetEmailConfigInfo([FromServices] IOptionsMonitor<SystemEmailSendConfig> options) public async Task<SystemEmailSendConfig> GetEmailConfigInfo([FromServices] IOptionsMonitor<SystemEmailSendConfig> options)
{ {
return options.CurrentValue; //两种方式都有问题
//var config = _configuration.GetSection("BasicSystemConfig").Get<SystemEmailSendConfig>();
//return config;
//return options.CurrentValue;
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
var json = File.ReadAllText(path);
var obj = JObject.Parse(json);
return obj["SystemEmailSendConfig"]!.ToObject<SystemEmailSendConfig>()!;
} }
@ -98,7 +123,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
[HttpPost] [HttpPost]
public async Task<IResponseOutput> UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig) public async Task<IResponseOutput> UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig)
{ {
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json"; var path = Path.Combine(_hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile"); var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
@ -139,6 +165,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
string result = obj.ToString(); string result = obj.ToString();
System.IO.File.WriteAllText(path, result); System.IO.File.WriteAllText(path, result);
} }
return ResponseOutput.Ok(); return ResponseOutput.Ok();

View File

@ -58,8 +58,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{ {
//subject 随机阅片 或者无序 有上传 才处理任务编号 //subject 随机阅片 或者无序 有上传 才处理任务编号
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom || (t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None)))) //||(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None)
)))
{ {
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务 //找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId

View File

@ -246,9 +246,9 @@ namespace IRaCIS.Core.Application.Service
var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
{ {
Answer = x.Answer, Answer = x.Answer,
Unit=x.ReadingQuestionTrial.Unit, Unit = x.ReadingQuestionTrial.Unit,
ValueType=x.ReadingQuestionTrial.ValueType, ValueType = x.ReadingQuestionTrial.ValueType,
CustomUnit=x.ReadingQuestionTrial.CustomUnit, CustomUnit = x.ReadingQuestionTrial.CustomUnit,
VisitTaskId = x.VisitTaskId, VisitTaskId = x.VisitTaskId,
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
ShowOrder = x.ReadingQuestionTrial.ShowOrder, ShowOrder = x.ReadingQuestionTrial.ShowOrder,
@ -643,8 +643,8 @@ namespace IRaCIS.Core.Application.Service
[HttpPost] [HttpPost]
public async Task<string> TestGetJointMedicalReviewDialog(Guid id) public async Task<string> TestGetJointMedicalReviewDialog(Guid id)
{ {
var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id) var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id)
.ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync(); .ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
Dictionary<string, string> i18NKeys = new Dictionary<string, string>() Dictionary<string, string> i18NKeys = new Dictionary<string, string>()
@ -661,11 +661,11 @@ namespace IRaCIS.Core.Application.Service
}; };
var i18Values = i18NKeys.Select(x => x.Value).ToList(); var i18Values = i18NKeys.Select(x => x.Value).ToList();
var i18nList=await _internationalizationRepository.Where(x => i18Values.Contains(x.Code)) var i18nList = await _internationalizationRepository.Where(x => i18Values.Contains(x.Code))
.Select(x => new .Select(x => new
{ {
Code= x.Code, Code = x.Code,
Value= _userInfo.IsEn_Us?x.Value:x.ValueCN Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
}).ToListAsync(); }).ToListAsync();
List<string> dictionaryCodeList = new List<string>() List<string> dictionaryCodeList = new List<string>()
@ -676,16 +676,16 @@ namespace IRaCIS.Core.Application.Service
"YesOrNo", "YesOrNo",
}; };
var dictionadParents=await _dictionaryRepository.Where(x=> dictionaryCodeList.Contains(x.Parent.Code)) var dictionadParents = await _dictionaryRepository.Where(x => dictionaryCodeList.Contains(x.Parent.Code))
.Select(x => new .Select(x => new
{ {
ParentCode = x.Parent.Code, ParentCode = x.Parent.Code,
Code=x.Code, Code = x.Code,
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
}).ToListAsync(); }).ToListAsync();
JointMedicalReviewI18n i18N = new JointMedicalReviewI18n() { }; JointMedicalReviewI18n i18N = new JointMedicalReviewI18n() { };
foreach (var kv in i18NKeys) foreach (var kv in i18NKeys)
{ {
PropertyInfo? pi = i18N.GetType().GetProperty(kv.Key); PropertyInfo? pi = i18N.GetType().GetProperty(kv.Key);
if (pi != null && pi.CanWrite) if (pi != null && pi.CanWrite)
@ -706,7 +706,7 @@ namespace IRaCIS.Core.Application.Service
} }
} }
return await JointMedicalReviewDialog(dialog,i18N); return await JointMedicalReviewDialog(dialog, i18N);
@ -910,7 +910,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost] [HttpPost]
public async Task<GetIRMedicalFeedbackListOutDto> GetNextIRMedicalFeedback(GetNextIRMedicalFeedbackInDto inDto) public async Task<GetIRMedicalFeedbackListOutDto> GetNextIRMedicalFeedback(GetNextIRMedicalFeedbackInDto inDto)
{ {
var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto() var responseOutput = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
{ {
TrialId = inDto.TrialId, TrialId = inDto.TrialId,
TrialReadingCriterionId = inDto.TrialReadingCriterionId, TrialReadingCriterionId = inDto.TrialReadingCriterionId,
@ -919,6 +919,8 @@ namespace IRaCIS.Core.Application.Service
PageSize = 99999, PageSize = 99999,
}); });
var list = responseOutput.Data;
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId); var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
var result = new GetIRMedicalFeedbackListOutDto() { }; var result = new GetIRMedicalFeedbackListOutDto() { };
@ -949,12 +951,12 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<PageOutput<GetIRMedicalFeedbackListOutDto>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto) public async Task<IResponseOutput<PageOutput<GetIRMedicalFeedbackListOutDto>>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
{ {
var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask) var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask)
.Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId) .Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId)
.Where(x => x.IsHaveQuestion) .Where(x => x.IsHaveQuestion)
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName == inDto.TaskBlindName) .WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName.Contains(inDto.TaskBlindName))
.WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!) .WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!)
.WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!) .WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!)
.WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!) .WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!)
@ -1004,7 +1006,11 @@ namespace IRaCIS.Core.Application.Service
var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState)); var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState));
return result; var criterionInfo = await _readingQuestionCriterionTrial.Where(t => t.Id == inDto.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(result, criterionInfo);
} }
} }
} }

View File

@ -920,7 +920,7 @@ namespace IRaCIS.Core.Application.Contracts
var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
foreach (var item in needGenerateList.GroupBy(t => t.Email)) foreach (var item in needSendEmailList.GroupBy(t => t.Email))
{ {
var addUserRoleList = item.ToList(); var addUserRoleList = item.ToList();
@ -1137,23 +1137,26 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id }); await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id });
//中心调研设置用户角色退出
var needQuitUserList = item.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
{
IsDeleted = true,
DeletedTime = DateTime.Now,
});
await _trialSiteUserRoleRepository.SaveChangesAsync(); await _trialSiteUserRoleRepository.SaveChangesAsync();
} }
//中心调研设置用户角色退出
var needQuitUserList = allUserList.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
{
IsDeleted = true,
DeletedTime = DateTime.Now,
});
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.UserRoleId, ReviewerTime = DateTime.Now }); await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.UserRoleId, ReviewerTime = DateTime.Now });
} }