Compare commits
241 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da57773cd3 | |||
| d3c2ded3d4 | |||
| 37e7ab575f | |||
| 39a9a0c05d | |||
| 570c5863c0 | |||
| 343f9211e2 | |||
| 4b7fff9869 | |||
| 1b1ac3ee65 | |||
| 37b4860668 | |||
| 96f3ecb45d | |||
| 4966a32bcb | |||
| 07dcb6fe47 | |||
| f802897b14 | |||
| 0642b9e4fb | |||
| f945793d6d | |||
| 7b4eb7a459 | |||
| 5fbebe9cc0 | |||
| 6feb2b20f8 | |||
| 2f87048f65 | |||
| 5e613fd9d3 | |||
| 3fa4db75d0 | |||
| 0c4bc87ee9 | |||
| 6fb0562a0b | |||
| 10fc07ec03 | |||
| 400421a337 | |||
| 4983def85b | |||
| d60a2567c1 | |||
| 2cd9716e68 | |||
| 1cf0ac0c53 | |||
| 74dd5369cb | |||
| 9d6a046d7f | |||
| a31eef5ccd | |||
| 21beeecb7d | |||
| c5c3c3334d | |||
| 92008fe6ba | |||
| 138a967283 | |||
| ed72ed9a5e | |||
| 5d0dca121f | |||
| 3d656dfa17 | |||
| 7adb291a0f | |||
| 3c790965fe | |||
| da4fe122ab | |||
| e029f32bad | |||
| 4320f06b77 | |||
| ac43952c18 | |||
| 5ef97ff742 | |||
| 2c8056c77b | |||
| 5ac6e186c0 | |||
| e4e02225c5 | |||
| 72b21fc021 | |||
| b8175c8ed5 | |||
| 885b115927 | |||
| 776c8f5c5e | |||
| 5564d8cc42 | |||
| 2b9d3785d6 | |||
| 46db19f513 | |||
| 3a479fe724 | |||
| a1afb299b3 | |||
| c54074dd3d | |||
| 203bce15ea | |||
| c1096ae473 | |||
| f2cd5f35e3 | |||
| 40afae1f37 | |||
| 845c532134 | |||
| 8615c90ebe | |||
| eb1d90e304 | |||
| 88f015183d | |||
| 4f9560c3a6 | |||
| 9abb78400a | |||
| 8f5e2c5b0c | |||
| efe96203d9 | |||
| 65de94079a | |||
| 6e706c4fc9 | |||
| 84e2e14b73 | |||
| 49d4a71f36 | |||
| 7dcf73176c | |||
| f9bf9d752c | |||
| acac7ec995 | |||
| 6cfcb9bfe1 | |||
| 9adf2ad52b | |||
| 403885ef3f | |||
| 7b1a0affbe | |||
| 85897f990d | |||
| be477818d7 | |||
| 41bbb75407 | |||
| fd9fdcb8be | |||
| 0e8ecdaf46 | |||
| 81b033885e | |||
| fca2a81c66 | |||
| 353f5df217 | |||
| 4874533804 | |||
| 025a8e7af1 | |||
| 79c5824051 | |||
| 2c47842e13 | |||
| 39d9cefda9 | |||
| 2c0d1cdc82 | |||
| af77d5be56 | |||
| f662a988e0 | |||
| b9cace17b2 | |||
| c8d0ef9043 | |||
| 2491fd1fff | |||
| 7cc9731edf | |||
| ff333219d4 | |||
| 0eae520f0d | |||
| 0a2513245c | |||
| f10cc0adbf | |||
| 58b2f9c7a9 | |||
| 472e744b6c | |||
| 699df338c1 | |||
| a64127537e | |||
| 2287c8869d | |||
| 0d8319feaa | |||
| 676c5b0e74 | |||
| a76654c210 | |||
| 0a29d431dc | |||
| 86562b39e3 | |||
| 86fe43aa93 | |||
| 082998da09 | |||
| d209a8de4d | |||
| b1608812ec | |||
| 20c18d957a | |||
| 7a7011e7ef | |||
| 24a395f8c8 | |||
| df2f179917 | |||
| 1bcc831937 | |||
| 75bf85997a | |||
| 074cba906c | |||
| 86db676df8 | |||
| bc67f16735 | |||
| 3e046e24e9 | |||
| c971161d31 | |||
| a63904c0bb | |||
| 572d4ea4b8 | |||
| ae4345cfcc | |||
| a536c33302 | |||
| be5c9b636e | |||
| c71bf65cd9 | |||
| 69c5ce9841 | |||
| 2139193df4 | |||
| 9aa2f23a67 | |||
| 531e0fa228 | |||
| 250c478687 | |||
| 09ba37ec6d | |||
| 913b673b72 | |||
| 5ee8a3db21 | |||
| 3c41789ba9 | |||
| d2268f0706 | |||
| e8496df81a | |||
| 3e24fe9461 | |||
| d771ab0f6f | |||
| 29dfa03d0f | |||
| 44e9b211c2 | |||
| b1154ea594 | |||
| 6dd12b419b | |||
| bce7c1cc99 | |||
| a660eb4f37 | |||
| 3ade13a922 | |||
| a5fed78c19 | |||
| 5207fef130 | |||
| b8ad8085cd | |||
| dc8451f55c | |||
| dd9ec3d8fe | |||
| 589cd83576 | |||
| 6c2a1e0a4b | |||
| 7a927b3133 | |||
| 3dbf6dc897 | |||
| bb5401f78c | |||
| 59e9d9df69 | |||
| 9a70193e7a | |||
| b44a9ecc63 | |||
| fb45173106 | |||
| bf2996bd1c | |||
| d840f14a2f | |||
| 4101c68d37 | |||
| 91503dc599 | |||
| debe22fdc3 | |||
| 8f4f9a91c2 | |||
| a53e306427 | |||
| 02183affc3 | |||
| e81c97037a | |||
| 1fd02cbbc5 | |||
| 55cbbffba6 | |||
| 4a1bf759cf | |||
| 703ab03b7f | |||
| 0582390b2c | |||
| cdf1119764 | |||
| 72cb407766 | |||
| 9f80386a19 | |||
| 3a96710210 | |||
| b8b63e33b8 | |||
| 98d09886de | |||
| 91671c5003 | |||
| 35ef014391 | |||
| 82fc9bfc75 | |||
| d6d47a6f85 | |||
| 32d6cce33e | |||
| 06ca624886 | |||
| 88231fffb4 | |||
| 12ab0d3eb4 | |||
| 6faeecebb0 | |||
| 48b778c95a | |||
| dee286cc90 | |||
| 2e96f7a936 | |||
| ebb33f45ba | |||
| 9d32be658c | |||
| 27fd819c9c | |||
| 937f8a5b66 | |||
| 53544001a7 | |||
| f08cd1c818 | |||
| 2c377d02f9 | |||
| 29f8648287 | |||
| f0725873e1 | |||
| dc12e57494 | |||
| d4a731d544 | |||
| 6e22515603 | |||
| abd5c8942d | |||
| 3decef7693 | |||
| ae83c753cb | |||
| 53ae0527ff | |||
| a234e0746d | |||
| c88d927c4b | |||
| 245898e22e | |||
| 93d3024b0f | |||
| 35be7f3144 | |||
| 62ac9418b5 | |||
| ea5de83364 | |||
| cf5a8b20e4 | |||
| ea95ece331 | |||
| 894b9eb67b | |||
| d7e5b3f57c | |||
| 29a47e7351 | |||
| 6d2cddfcfc | |||
| 60b2978deb | |||
| 79187772a6 | |||
| 105da818a8 | |||
| 584516f936 | |||
| a7429c1739 | |||
| 75f227e547 | |||
| 60c31b470c | |||
| 731f049fc0 | |||
| 201c24238c |
@@ -126,6 +126,47 @@ csharp_style_deconstructed_variable_declaration = true:suggestion
|
|||||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||||
|
|
||||||
|
# SA0001: XML comment analysis disabled
|
||||||
|
dotnet_diagnostic.SA0001.severity = suggestion
|
||||||
|
|
||||||
|
# SA1002: Semicolons should be spaced correctly
|
||||||
|
dotnet_diagnostic.SA1002.severity = suggestion
|
||||||
|
|
||||||
|
# SA1005: Single line comments should begin with single space
|
||||||
|
dotnet_diagnostic.SA1005.severity = none
|
||||||
|
dotnet_diagnostic.CS8618.severity = none
|
||||||
|
dotnet_diagnostic.CS8604.severity = none
|
||||||
|
dotnet_diagnostic.CS8600.severity = none
|
||||||
|
dotnet_diagnostic.CS1570.severity = none
|
||||||
|
dotnet_diagnostic.CS8601.severity = none
|
||||||
|
dotnet_diagnostic.CS8632.severity = none
|
||||||
|
dotnet_diagnostic.CS8625.severity = none
|
||||||
|
|
||||||
|
dotnet_diagnostic.CS8603.severity = none
|
||||||
|
dotnet_diagnostic.CS8602.severity = none
|
||||||
|
dotnet_diagnostic.CS1998.severity = none
|
||||||
|
dotnet_diagnostic.CS0168.severity = none
|
||||||
|
dotnet_diagnostic.CS0219.severity = none
|
||||||
|
dotnet_diagnostic.CS0108.severity = none
|
||||||
|
dotnet_diagnostic.CS0120.severity = none
|
||||||
|
|
||||||
|
dotnet_diagnostic.CS8620.severity = none
|
||||||
|
dotnet_diagnostic.CS8619.severity = none
|
||||||
|
dotnet_diagnostic.CS0162.severity = none
|
||||||
|
dotnet_diagnostic.CS0472.severity = none
|
||||||
|
|
||||||
|
dotnet_diagnostic.CS8629.severity = none
|
||||||
|
dotnet_diagnostic.CS8073.severity = none
|
||||||
|
dotnet_diagnostic.CS0414.severity = none
|
||||||
|
dotnet_diagnostic.CS1573.severity = none
|
||||||
|
dotnet_diagnostic.CS0109.severity = none
|
||||||
|
|
||||||
|
csharp_style_prefer_method_group_conversion = true:silent
|
||||||
|
csharp_style_prefer_top_level_statements = true:silent
|
||||||
|
dotnet_diagnostic.SA1003.severity = silent
|
||||||
|
dotnet_diagnostic.SA1108.severity = silent
|
||||||
|
dotnet_diagnostic.SA1107.severity = silent
|
||||||
|
|
||||||
[*.vb]
|
[*.vb]
|
||||||
#### 命名样式 ####
|
#### 命名样式 ####
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ using Aliyun.Acs.Core.Profile;
|
|||||||
using Aliyun.Acs.Sts.Model.V20150401;
|
using Aliyun.Acs.Sts.Model.V20150401;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace IRaCIS.Api.Controllers
|
namespace IRaCIS.Api.Controllers
|
||||||
{
|
{
|
||||||
@@ -134,25 +136,82 @@ namespace IRaCIS.Api.Controllers
|
|||||||
return returnModel;
|
return returnModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[HttpGet("user/GetObjectStoreToken")]
|
||||||
[HttpGet("user/GenerateSTS")]
|
public IResponseOutput GetObjectStoreToken([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
public IResponseOutput GenerateSTS( [FromServices] IWebHostEnvironment webHostEnvironment)
|
|
||||||
{
|
{
|
||||||
|
var serviceOption = options.CurrentValue;
|
||||||
|
|
||||||
|
if (Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedEnum) && parsedEnum == ObjectStoreUse.AliyunOSS)
|
||||||
|
{
|
||||||
|
|
||||||
|
var ossOptions = serviceOption.AliyunOSS;
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AliyunOSS = serviceOption.AliyunOSS, AWS = serviceOption.AWS });
|
||||||
|
|
||||||
|
#region 临时token 屏蔽
|
||||||
|
//IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret);
|
||||||
|
//DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
|
||||||
|
|
||||||
var configuration = new ConfigurationBuilder()
|
//// 创建一个STS请求
|
||||||
.AddJsonFile($"appsettings.{webHostEnvironment.EnvironmentName}.json")
|
//AssumeRoleRequest request = new AssumeRoleRequest
|
||||||
.Build();
|
//{
|
||||||
|
// RoleArn = ossOptions.RoleArn, // 角色ARN,需要替换为你的角色ARN
|
||||||
|
// RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||||
|
// DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||||
|
//};
|
||||||
|
|
||||||
|
|
||||||
IClientProfile profile = DefaultProfile.GetProfile("cn-shanghai", configuration["AliyunOSS:accessKeyId"], configuration["AliyunOSS:accessKeySecret"]);
|
//AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||||
|
|
||||||
|
//// 返回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,
|
||||||
|
|
||||||
|
// 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 });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[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);
|
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
|
||||||
|
|
||||||
// 创建一个STS请求
|
// 创建一个STS请求
|
||||||
AssumeRoleRequest request = new AssumeRoleRequest
|
AssumeRoleRequest request = new AssumeRoleRequest
|
||||||
{
|
{
|
||||||
RoleArn = "acs:ram::1899121822495495:role/oss-upload", // 角色ARN,需要替换为你的角色ARN
|
RoleArn = ossOptions.roleArn, // 角色ARN,需要替换为你的角色ARN
|
||||||
RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||||
DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||||
};
|
};
|
||||||
@@ -168,9 +227,9 @@ namespace IRaCIS.Api.Controllers
|
|||||||
SecurityToken = response.Credentials.SecurityToken,
|
SecurityToken = response.Credentials.SecurityToken,
|
||||||
Expiration = response.Credentials.Expiration,
|
Expiration = response.Credentials.Expiration,
|
||||||
|
|
||||||
Region= configuration["AliyunOSS:region"],
|
Region = ossOptions.region ,
|
||||||
BucketName = configuration["AliyunOSS:bucketName"],
|
BucketName = ossOptions.bucketName ,
|
||||||
ViewEndpoint = configuration["AliyunOSS:viewEndpoint"],
|
ViewEndpoint = ossOptions.viewEndpoint ,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using Magicodes.ExporterAndImporter.Excel;
|
|||||||
using MassTransit;
|
using MassTransit;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors.Infrastructure;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -37,7 +38,7 @@ using Microsoft.Net.Http.Headers;
|
|||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SharpCompress.Archives;
|
using SharpCompress.Archives;
|
||||||
using SharpCompress.Common;
|
using SkiaSharp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -134,6 +135,32 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("base")]
|
||||||
|
public virtual async Task FileUploadToOSSAsync(Func<string, Stream, Task<string>> toMemoryStreamFunc)
|
||||||
|
{
|
||||||
|
var boundary = HeaderUtilities.RemoveQuotes(MediaTypeHeaderValue.Parse(Request.ContentType).Boundary).Value;
|
||||||
|
|
||||||
|
var reader = new MultipartReader(boundary, HttpContext.Request.Body);
|
||||||
|
|
||||||
|
var section = await reader.ReadNextSectionAsync();
|
||||||
|
|
||||||
|
while (section != null)
|
||||||
|
{
|
||||||
|
var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var contentDisposition);
|
||||||
|
if (hasContentDispositionHeader)
|
||||||
|
{
|
||||||
|
var fileName = contentDisposition.FileName.Value;
|
||||||
|
|
||||||
|
await toMemoryStreamFunc(fileName, section.Body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
section = await reader.ReadNextSectionAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary> 流式上传 Dicom上传 </summary>
|
/// <summary> 流式上传 Dicom上传 </summary>
|
||||||
@@ -280,9 +307,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!HttpContext.Request.HasFormContentType ||
|
if (!HttpContext.Request.HasFormContentType ||
|
||||||
!MediaTypeHeaderValue.TryParse(HttpContext.Request.ContentType, out var mediaTypeHeader) ||
|
!MediaTypeHeaderValue.TryParse(HttpContext.Request.ContentType, out var mediaTypeHeader) ||
|
||||||
string.IsNullOrEmpty(mediaTypeHeader.Boundary.Value))
|
string.IsNullOrEmpty(mediaTypeHeader.Boundary.Value))
|
||||||
@@ -756,11 +780,13 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
|
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
|
||||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId)
|
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId, [FromServices] IOSSService oSSService)
|
||||||
{
|
{
|
||||||
|
|
||||||
var (serverFilePath, relativePath, fileName) = (string.Empty, string.Empty, string.Empty);
|
var fileName = string.Empty;
|
||||||
await FileUploadAsync(async (realFileName) =>
|
var templateFileStream = new MemoryStream();
|
||||||
|
|
||||||
|
await FileUploadToOSSAsync(async (realFileName, fileStream) =>
|
||||||
{
|
{
|
||||||
fileName = realFileName;
|
fileName = realFileName;
|
||||||
|
|
||||||
@@ -770,19 +796,16 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_SupportedFormats"));
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_SupportedFormats"));
|
||||||
}
|
}
|
||||||
|
|
||||||
(serverFilePath, relativePath) = FileStoreHelper.GetTrialCheckFilePath(_hostEnvironment, fileName, trialId);
|
fileStream.CopyTo(templateFileStream);
|
||||||
|
templateFileStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
await _repository.AddAsync(new UserUploadFile()
|
|
||||||
{
|
|
||||||
TrialId = trialId,
|
|
||||||
CreateTime = DateTime.Now,
|
|
||||||
FileName = fileName,
|
|
||||||
FilePath = relativePath,
|
|
||||||
RelativePath = relativePath,
|
|
||||||
CreateUserId = _userInfo.Id
|
|
||||||
});
|
|
||||||
|
|
||||||
return serverFilePath;
|
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/Check", realFileName);
|
||||||
|
|
||||||
|
await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||||
|
|
||||||
|
return ossRelativePath;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -814,7 +837,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
{
|
{
|
||||||
var Importer = new ExcelImporter();
|
var Importer = new ExcelImporter();
|
||||||
|
|
||||||
var import = await Importer.Import<CheckViewModel>(System.IO.File.OpenRead(serverFilePath));
|
var import = await Importer.Import<CheckViewModel>(templateFileStream);
|
||||||
|
|
||||||
if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||||
|
|
||||||
@@ -829,7 +852,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
#region 临时方案 MiniExcel读取 然后保存为xlsx 再用 Magicodes验证数据
|
#region 临时方案 MiniExcel读取 然后保存为xlsx 再用 Magicodes验证数据
|
||||||
|
|
||||||
//因为csv 需要加配置文件 不然都是null
|
//因为csv 需要加配置文件 不然都是null
|
||||||
etcCheckList = MiniExcel.Query<CheckViewModel>(serverFilePath, null, configuration: new MiniExcelLibs.Csv.CsvConfiguration()
|
etcCheckList = MiniExcel.Query<CheckViewModel>(templateFileStream, null, configuration: new MiniExcelLibs.Csv.CsvConfiguration()
|
||||||
{
|
{
|
||||||
StreamReaderFunc = (stream) => new StreamReader(stream, Encoding.GetEncoding("gb2312"))
|
StreamReaderFunc = (stream) => new StreamReader(stream, Encoding.GetEncoding("gb2312"))
|
||||||
}).ToList();
|
}).ToList();
|
||||||
@@ -874,35 +897,35 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//为了支持 xls 引入新的组件库
|
//为了支持 xls 引入新的组件库
|
||||||
using (var stream = System.IO.File.Open(serverFilePath, FileMode.Open, FileAccess.Read))
|
//using (var stream = System.IO.File.Open(templateFileStream, FileMode.Open, FileAccess.Read))
|
||||||
|
//{
|
||||||
|
// Auto-detect format, supports:
|
||||||
|
// - Binary Excel files (2.0-2003 format; *.xls)
|
||||||
|
// - OpenXml Excel files (2007 format; *.xlsx, *.xlsb)
|
||||||
|
using (var reader = ExcelReaderFactory.CreateReader(templateFileStream))
|
||||||
{
|
{
|
||||||
// Auto-detect format, supports:
|
|
||||||
// - Binary Excel files (2.0-2003 format; *.xls)
|
// 2. Use the AsDataSet extension method
|
||||||
// - OpenXml Excel files (2007 format; *.xlsx, *.xlsb)
|
var dateset = reader.AsDataSet();
|
||||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
|
||||||
|
foreach (DataRow col in dateset.Tables[0].Rows)
|
||||||
{
|
{
|
||||||
|
|
||||||
// 2. Use the AsDataSet extension method
|
etcCheckList.Add(new CheckViewModel()
|
||||||
var dateset = reader.AsDataSet();
|
|
||||||
|
|
||||||
foreach (DataRow col in dateset.Tables[0].Rows)
|
|
||||||
{
|
{
|
||||||
|
SiteCode = col[0].ToString(),
|
||||||
etcCheckList.Add(new CheckViewModel()
|
SubjectCode = col[1].ToString(),
|
||||||
{
|
VisitName = col[2].ToString(),
|
||||||
SiteCode = col[0].ToString(),
|
StudyDate = col[3].ToString(),
|
||||||
SubjectCode = col[1].ToString(),
|
Modality = col[4].ToString(),
|
||||||
VisitName = col[2].ToString(),
|
});
|
||||||
StudyDate = col[3].ToString(),
|
|
||||||
Modality = col[4].ToString(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
etcCheckList.Remove(etcCheckList[0]);
|
|
||||||
|
|
||||||
// The result of each spreadsheet is in result.Tables
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
etcCheckList.Remove(etcCheckList[0]);
|
||||||
|
|
||||||
|
// The result of each spreadsheet is in result.Tables
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (etcCheckList == null || etcCheckList.Count == 0)
|
if (etcCheckList == null || etcCheckList.Count == 0)
|
||||||
@@ -940,7 +963,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -948,6 +970,8 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 项目 系统 基本文件 上传 下载 预览
|
#region 项目 系统 基本文件 上传 下载 预览
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
[ApiExplorerSettings(GroupName = "Common")]
|
||||||
@@ -980,30 +1004,38 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
[DisableFormValueModelBinding]
|
[DisableFormValueModelBinding]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl,
|
public async Task<IResponseOutput> UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl,
|
||||||
[FromServices] IRepository<TrialSite> _trialSiteRepository,
|
[FromServices] IRepository<TrialSite> _trialSiteRepository,
|
||||||
[FromServices] IRepository<UserType> _usertypeRepository,
|
[FromServices] IRepository<UserType> _usertypeRepository,
|
||||||
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService)
|
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService,
|
||||||
|
[FromServices] IOSSService oSSService,
|
||||||
|
[FromServices] IRepository<InspectionFile> _inspectionFileRepository)
|
||||||
{
|
{
|
||||||
var (serverFilePath, relativePath, fileName) = (string.Empty, string.Empty, string.Empty);
|
var templateFileStream = new MemoryStream();
|
||||||
await FileUploadAsync(async (realFileName) =>
|
|
||||||
{
|
|
||||||
fileName = realFileName;
|
|
||||||
|
|
||||||
if (!fileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase))
|
|
||||||
|
await FileUploadToOSSAsync(async (realFileName, fileStream) =>
|
||||||
|
{
|
||||||
|
await fileStream.CopyToAsync(templateFileStream);
|
||||||
|
templateFileStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
if (!realFileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// 请用提供格式的模板excel上传需要处理的数据
|
// 请用提供格式的模板excel上传需要处理的数据
|
||||||
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData"));
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData"));
|
||||||
}
|
}
|
||||||
|
|
||||||
(serverFilePath, relativePath) = FileStoreHelper.GetOtherFileUploadPath(_hostEnvironment, StaticData.Folder.TempFile, fileName);
|
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/SiteSurvey", realFileName);
|
||||||
|
|
||||||
//FileStoreHelper.UploadOOS(serverFilePath, "testc/test", true);
|
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return ossRelativePath;
|
||||||
|
|
||||||
return serverFilePath;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//去掉空白行
|
//去掉空白行
|
||||||
var excelList = MiniExcel.Query<SiteSurveyUserImportDto>(serverFilePath).ToList()
|
var excelList = MiniExcel.Query<SiteSurveyUserImportDto>(templateFileStream,excelType:ExcelType.XLSX).ToList()
|
||||||
.Where(t => !(string.IsNullOrWhiteSpace(t.TrialSiteCode) && string.IsNullOrWhiteSpace(t.FirstName) && string.IsNullOrWhiteSpace(t.LastName) && string.IsNullOrWhiteSpace(t.Email)
|
.Where(t => !(string.IsNullOrWhiteSpace(t.TrialSiteCode) && string.IsNullOrWhiteSpace(t.FirstName) && string.IsNullOrWhiteSpace(t.LastName) && string.IsNullOrWhiteSpace(t.Email)
|
||||||
&& string.IsNullOrWhiteSpace(t.Phone) && string.IsNullOrWhiteSpace(t.UserTypeStr) && string.IsNullOrWhiteSpace(t.OrganizationName))).ToList();
|
&& string.IsNullOrWhiteSpace(t.Phone) && string.IsNullOrWhiteSpace(t.UserTypeStr) && string.IsNullOrWhiteSpace(t.OrganizationName))).ToList();
|
||||||
|
|
||||||
@@ -1033,7 +1065,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
//有邮箱不符合邮箱格式,请核查Excel数据
|
//有邮箱不符合邮箱格式,请核查Excel数据
|
||||||
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidEmail"));
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidEmail"));
|
||||||
}
|
}
|
||||||
var generateUserTypeList = new List<string>() { "CRC", "SR", "CRA" };
|
var generateUserTypeList = new List<string>() { "CRC", "CRA","SR" };
|
||||||
|
|
||||||
if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
||||||
{
|
{
|
||||||
@@ -1083,122 +1115,18 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 废弃
|
/// <summary> 通用文件下载 </summary>
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpGet("CommonDocument/DownloadCommonDoc")]
|
||||||
|
public async Task<IActionResult> DownloadCommonFile(string code, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
||||||
|
{
|
||||||
|
var (filePath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
||||||
|
|
||||||
///// <summary> 缩略图 </summary>
|
new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType);
|
||||||
//[AllowAnonymous]
|
|
||||||
//[HttpGet("Common/LocalFilePreview")]
|
|
||||||
//public async Task<FileContentResult> LocalFilePreview(string relativePath)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// var _fileStorePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, relativePath);
|
|
||||||
|
|
||||||
// var storePreviewPath = _fileStorePath + ".preview.jpeg";
|
|
||||||
|
|
||||||
// if (!System.IO.File.Exists(storePreviewPath))
|
|
||||||
// {
|
|
||||||
// ImageHelper.ResizeSave(_fileStorePath, storePreviewPath);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return new FileContentResult(await System.IO.File.ReadAllBytesAsync(storePreviewPath), "image/jpeg");
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary> 通用文件下载 </summary>
|
|
||||||
//[AllowAnonymous]
|
|
||||||
//[HttpGet("CommonDocument/DownloadCommonDoc")]
|
|
||||||
//public async Task<IActionResult> DownloadCommonFile(string code, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
|
||||||
//{
|
|
||||||
// var (filePath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
|
||||||
|
|
||||||
// new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType);
|
|
||||||
|
|
||||||
// return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName);
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 下载项目临床数据文件
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="clinicalDataTrialSetId"></param>
|
|
||||||
///// <param name="_clinicalDataTrialSetRepository"></param>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[AllowAnonymous]
|
|
||||||
//[HttpGet("CommonDocument/DownloadTrialClinicalFile")]
|
|
||||||
//public async Task<IActionResult> DownloadTrialClinicalFile(Guid clinicalDataTrialSetId, [FromServices] IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository)
|
|
||||||
//{
|
|
||||||
// var (filePath, fileName) = await FileStoreHelper.GetTrialClinicalPathAsync(_hostEnvironment, _clinicalDataTrialSetRepository, clinicalDataTrialSetId);
|
|
||||||
|
|
||||||
// new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType);
|
|
||||||
|
|
||||||
// return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName);
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 下载系统临床数据文件
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="clinicalDataSystemSetId"></param>
|
|
||||||
///// <param name="_clinicalDataSystemSetRepository"></param>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[AllowAnonymous]
|
|
||||||
//[HttpGet("CommonDocument/DownloadSystemClinicalFile")]
|
|
||||||
//public async Task<IActionResult> DownloadSystemClinicalFile(Guid clinicalDataSystemSetId, [FromServices] IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository)
|
|
||||||
//{
|
|
||||||
// var (filePath, fileName) = await FileStoreHelper.GetSystemClinicalPathAsync(_hostEnvironment, _clinicalDataSystemSetRepository, clinicalDataSystemSetId);
|
|
||||||
|
|
||||||
// new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType);
|
|
||||||
|
|
||||||
// return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName);
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////上传项目签名文档
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="trialId"></param>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[HttpPost("TrialDocument/UploadTrialDoc/{trialId:guid}")]
|
|
||||||
//[DisableRequestSizeLimit]
|
|
||||||
//[DisableFormValueModelBinding]
|
|
||||||
//public async Task<IResponseOutput> UploadTrialDoc(Guid trialId)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetTrialSignDocPath(_hostEnvironment, trialId, fileName));
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 上传系统签名文档
|
|
||||||
///// </summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[HttpPost("TrialDocument/UploadSystemDoc")]
|
|
||||||
//[DisableRequestSizeLimit]
|
|
||||||
//[DisableFormValueModelBinding]
|
|
||||||
//public async Task<IResponseOutput> UploadSysTemDoc()
|
|
||||||
//{
|
|
||||||
|
|
||||||
// return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemSignDocPath(_hostEnvironment, fileName));
|
|
||||||
|
|
||||||
//}
|
|
||||||
///// <summary>
|
|
||||||
///// 上传系统通知文档
|
|
||||||
///// </summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[HttpPost("SystemNotice/UploadSystemNoticeDoc")]
|
|
||||||
//[DisableRequestSizeLimit]
|
|
||||||
//[DisableFormValueModelBinding]
|
|
||||||
//public async Task<IResponseOutput> UploadSystemNoticeDoc()
|
|
||||||
//{
|
|
||||||
|
|
||||||
// return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemNoticePath(_hostEnvironment, fileName));
|
|
||||||
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传通用文档 比如一致性核查的 比如导出的excel 模板
|
/// 上传通用文档 比如一致性核查的 比如导出的excel 模板
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
|
||||||
WORKDIR /src
|
|
||||||
COPY ["IRaCIS.Core.API/IRaCIS.Core.API.csproj", "IRaCIS.Core.API/"]
|
|
||||||
COPY ["IRaCIS.Core.Application/IRaCIS.Core.Application.csproj", "IRaCIS.Core.Application/"]
|
|
||||||
COPY ["IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj", "IRaCIS.Core.Infra.EFCore/"]
|
|
||||||
COPY ["IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj", "IRaCIS.Core.Domain/"]
|
|
||||||
COPY ["IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj", "IRaCIS.Core.Domain.Share/"]
|
|
||||||
COPY ["IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj", "IRaCIS.Core.Infrastructure/"]
|
|
||||||
RUN dotnet restore "IRaCIS.Core.API/IRaCIS.Core.API.csproj"
|
|
||||||
COPY . .
|
|
||||||
WORKDIR "/src/IRaCIS.Core.API"
|
|
||||||
RUN dotnet build "IRaCIS.Core.API.csproj" -c Release -o /app/build
|
|
||||||
|
|
||||||
FROM build AS publish
|
|
||||||
RUN dotnet publish "IRaCIS.Core.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|
||||||
|
|
||||||
FROM base AS final
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=publish /app/publish .
|
|
||||||
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
// 使用的是proto3版本
|
// 使用的是proto3版本
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||||
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
每一句需要用分号结尾
|
每一句需要用分号结尾
|
||||||
message 用来定义请求和返回数据格式
|
message 用来定义请求和返回数据格式
|
||||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||||
message GetTokenReuqest{
|
message GetTokenReuqest{
|
||||||
string id=1;
|
string id=1;
|
||||||
string userName=2;
|
string userName=2;
|
||||||
@@ -22,48 +22,48 @@ message GetTokenReuqest{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增时返回的消息格式
|
// 新增时返回的消息格式
|
||||||
message GetTokenResponse {
|
message GetTokenResponse {
|
||||||
int32 code=1;
|
int32 code=1;
|
||||||
string token =2;
|
string token =2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// service 用标识定义服务的,里面写对应的方法
|
// service 用标识定义服务的,里面写对应的方法
|
||||||
service TokenGrpcService{
|
service TokenGrpcService{
|
||||||
// 获取token
|
// 获取token
|
||||||
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||||
message AddUserReuqest{
|
message AddUserReuqest{
|
||||||
string name=1;
|
string name=1;
|
||||||
int32 age=2;
|
int32 age=2;
|
||||||
bool isBoy=3;
|
bool isBoy=3;
|
||||||
}
|
}
|
||||||
// 新增时返回的消息格式
|
// 新增时返回的消息格式
|
||||||
message ResultResponse {
|
message ResultResponse {
|
||||||
int32 code=1;
|
int32 code=1;
|
||||||
string msg =2;
|
string msg =2;
|
||||||
}
|
}
|
||||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||||
message QueryUserReuqest{
|
message QueryUserReuqest{
|
||||||
string name=1;
|
string name=1;
|
||||||
}
|
}
|
||||||
//查询返回的用户信息格式,可理解为返回的类
|
//查询返回的用户信息格式,可理解为返回的类
|
||||||
message UserInfoResponse {
|
message UserInfoResponse {
|
||||||
string name=1;
|
string name=1;
|
||||||
int32 age=2;
|
int32 age=2;
|
||||||
string gender=3;
|
string gender=3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// service 用标识定义服务的,里面写对应的方法
|
// service 用标识定义服务的,里面写对应的方法
|
||||||
service UserService{
|
service UserService{
|
||||||
// 新增用户
|
// 新增用户
|
||||||
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
||||||
// 查询用户
|
// 查询用户
|
||||||
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -219,13 +219,16 @@
|
|||||||
<param name="_noneDicomStudyRepository"></param>
|
<param name="_noneDicomStudyRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid)">
|
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid,IRaCIS.Core.Application.Helper.IOSSService)">
|
||||||
<summary>
|
<summary>
|
||||||
一致性核查 excel上传 支持三种格式
|
一致性核查 excel上传 支持三种格式
|
||||||
</summary>
|
</summary>
|
||||||
<param name="trialId"></param>
|
<param name="trialId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</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>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadCommonDoc">
|
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadCommonDoc">
|
||||||
<summary>
|
<summary>
|
||||||
上传通用文档 比如一致性核查的 比如导出的excel 模板
|
上传通用文档 比如一致性核查的 比如导出的excel 模板
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Autofac.Extensions.DependencyInjection;
|
|
||||||
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;
|
|
||||||
using System.IO;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Application.Services.BackGroundJob;
|
|
||||||
using Hangfire;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.API
|
|
||||||
{
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
public readonly string environment;
|
|
||||||
public static async Task Main(string[] args)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
|
||||||
var config = new ConfigurationBuilder()
|
|
||||||
.AddEnvironmentVariables()
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(enviromentName))
|
|
||||||
{
|
|
||||||
|
|
||||||
var index = Array.IndexOf(args, "--env");
|
|
||||||
enviromentName = index > -1
|
|
||||||
? args[index + 1]
|
|
||||||
: "Development";
|
|
||||||
}
|
|
||||||
|
|
||||||
//Dicom 浏览
|
|
||||||
//ImageManager.SetImplementation(WinFormsImageManager.Instance);
|
|
||||||
|
|
||||||
var host = CreateHostBuilder(args)
|
|
||||||
.UseEnvironment(enviromentName) //命令行传入环境
|
|
||||||
.ConfigureAppConfiguration((hostContext, config) =>
|
|
||||||
{
|
|
||||||
|
|
||||||
//Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName);
|
|
||||||
config.AddJsonFile("appsettings.json", false, true)
|
|
||||||
.AddJsonFile($"appsettings.{enviromentName}.json", false, true);
|
|
||||||
})
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
|
|
||||||
//// Serilog
|
|
||||||
SerilogExtension.AddSerilogSetup(enviromentName, host.Services);
|
|
||||||
Log.Logger.Warning($"当前环境:{enviromentName}");
|
|
||||||
|
|
||||||
|
|
||||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
|
||||||
|
|
||||||
////缓存项目的状态 匿名化数据
|
|
||||||
//await InitCache(host);
|
|
||||||
|
|
||||||
host.Run();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
Log.Logger.Error(e.InnerException is null ? e.Message + e.StackTrace : e.InnerException?.Message + e.InnerException?.StackTrace);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
||||||
Host.CreateDefaultBuilder(args)
|
|
||||||
.UseWindowsService()
|
|
||||||
.ConfigureWebHostDefaults(webBuilder =>
|
|
||||||
{
|
|
||||||
webBuilder.ConfigureKestrel((context, options) =>
|
|
||||||
{
|
|
||||||
//设置应用服务器Kestrel请求体最大为1GB // if don't set default value is: 30 MB
|
|
||||||
options.Limits.MaxRequestBodySize = long.MaxValue;
|
|
||||||
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(30);
|
|
||||||
options.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20);
|
|
||||||
|
|
||||||
});
|
|
||||||
//webBuilder.UseSerilog();//在宿主机启动的时候配置serilog,与微软ILogger进行整合
|
|
||||||
webBuilder.UseStartup<Startup>();
|
|
||||||
}).UseSerilog()
|
|
||||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
|
||||||
|
|
||||||
|
|
||||||
private static async Task InitCache(IHost host)
|
|
||||||
{
|
|
||||||
var _repository = host.Services.GetService(typeof(IRepository)) as IRepository;
|
|
||||||
|
|
||||||
//初始化 国际化数据,并且监测国际化文件变更
|
|
||||||
//await InternationalizationHelper.InitInternationlizationDataAndWatchJsonFileAsync(_repository);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
using System;
|
||||||
|
using Autofac.Extensions.DependencyInjection;
|
||||||
|
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;
|
||||||
|
using System.IO;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using IRaCIS.Core.API;
|
||||||
|
using Autofac;
|
||||||
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
|
using IRaCIS.Application.Services.BackGroundJob;
|
||||||
|
using LogDashboard;
|
||||||
|
using OfficeOpenXml.Utils;
|
||||||
|
using IP2Region.Net.Abstractions;
|
||||||
|
using IP2Region.Net.XDB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取环境变量
|
||||||
|
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
||||||
|
var config = new ConfigurationBuilder()
|
||||||
|
.AddEnvironmentVariables()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(enviromentName))
|
||||||
|
{
|
||||||
|
|
||||||
|
var index = Array.IndexOf(args, "--env");
|
||||||
|
enviromentName = index > -1
|
||||||
|
? args[index + 1]
|
||||||
|
: "Development";
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
||||||
|
{
|
||||||
|
EnvironmentName = enviromentName
|
||||||
|
});
|
||||||
|
|
||||||
|
#region 兼容windows 服务命令行的方式
|
||||||
|
|
||||||
|
//foreach (var arg in args)
|
||||||
|
//{
|
||||||
|
// Console.WriteLine(arg);
|
||||||
|
//}
|
||||||
|
|
||||||
|
int urlsIndex = Array.FindIndex(args, arg => arg != null && arg.StartsWith("--urls"));
|
||||||
|
|
||||||
|
if (urlsIndex > -1)
|
||||||
|
{
|
||||||
|
var url = args[urlsIndex].Substring("--urls=".Length);
|
||||||
|
Console.WriteLine(url);
|
||||||
|
builder.WebHost.UseUrls(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 主机配置
|
||||||
|
|
||||||
|
|
||||||
|
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||||
|
|
||||||
|
builder.Configuration.AddJsonFile("appsettings.json", false, true)
|
||||||
|
.AddJsonFile($"appsettings.{enviromentName}.json", false, true);
|
||||||
|
|
||||||
|
builder.Host
|
||||||
|
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||||
|
.ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||||
|
{
|
||||||
|
containerBuilder.RegisterModule<AutofacModuleSetup>();
|
||||||
|
})
|
||||||
|
.UseWindowsService().UseSerilog();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 配置服务
|
||||||
|
var _configuration = builder.Configuration;
|
||||||
|
|
||||||
|
//健康检查
|
||||||
|
builder.Services.AddHealthChecks();
|
||||||
|
//本地化
|
||||||
|
builder.Services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
|
||||||
|
|
||||||
|
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
|
||||||
|
builder.Services.AddControllers(options =>
|
||||||
|
{
|
||||||
|
//options.Filters.Add<LogActionFilter>();
|
||||||
|
options.Filters.Add<ModelActionFilter>();
|
||||||
|
options.Filters.Add<ProjectExceptionFilter>();
|
||||||
|
options.Filters.Add<UnitOfWorkFilter>();
|
||||||
|
|
||||||
|
if (_configuration.GetSection("BasicSystemConfig").GetValue<bool>("OpenLoginLimit"))
|
||||||
|
{
|
||||||
|
options.Filters.Add<LimitUserRequestAuthorization>();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
|
||||||
|
|
||||||
|
builder.Services.AddOptions().Configure<SystemEmailSendConfig>(_configuration.GetSection("SystemEmailSendConfig"));
|
||||||
|
builder.Services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
||||||
|
builder.Services.AddOptions().Configure<AliyunOSSOptions>(_configuration.GetSection("AliyunOSS"));
|
||||||
|
builder.Services.AddOptions().Configure<ObjectStoreServiceOptions>(_configuration.GetSection("ObjectStoreService"));
|
||||||
|
|
||||||
|
|
||||||
|
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
||||||
|
builder.Services.AddDynamicWebApiSetup();
|
||||||
|
//AutoMapper
|
||||||
|
builder.Services.AddAutoMapperSetup();
|
||||||
|
//EF ORM QueryWithNoLock
|
||||||
|
builder.Services.AddEFSetup(_configuration);
|
||||||
|
//Http 响应压缩
|
||||||
|
builder.Services.AddResponseCompressionSetup();
|
||||||
|
//Swagger Api 文档
|
||||||
|
builder.Services.AddSwaggerSetup();
|
||||||
|
//JWT Token 验证
|
||||||
|
builder.Services.AddJWTAuthSetup(_configuration);
|
||||||
|
|
||||||
|
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
||||||
|
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||||
|
// EasyCaching 缓存
|
||||||
|
builder.Services.AddEasyCachingSetup(_configuration);
|
||||||
|
|
||||||
|
// hangfire 定时任务框架 有界面,更友好~
|
||||||
|
builder.Services.AddhangfireSetup(_configuration);
|
||||||
|
|
||||||
|
//
|
||||||
|
builder.Services.AddQuartZSetup(_configuration);
|
||||||
|
|
||||||
|
//Serilog 日志可视化 LogDashboard日志
|
||||||
|
builder.Services.AddLogDashboardSetup();
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services.AddJsonConfigSetup(_configuration);
|
||||||
|
//转发头设置 获取真实IP
|
||||||
|
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders =
|
||||||
|
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
|
});
|
||||||
|
//Dicom影像渲染图片 跨平台
|
||||||
|
builder.Services.AddDicomSetup();
|
||||||
|
|
||||||
|
// 实时应用
|
||||||
|
builder.Services.AddSignalR();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
||||||
|
|
||||||
|
//builder.Services.AddMemoryCache();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 历史废弃配置
|
||||||
|
|
||||||
|
////上传限制 配置
|
||||||
|
//builder.Services.Configure<FormOptions>(options =>
|
||||||
|
//{
|
||||||
|
// options.MultipartBodyLengthLimit = int.MaxValue;
|
||||||
|
// options.ValueCountLimit = int.MaxValue;
|
||||||
|
// options.ValueLengthLimit = int.MaxValue;
|
||||||
|
//});
|
||||||
|
//IP 限流 可设置白名单 或者黑名单
|
||||||
|
//services.AddIpPolicyRateLimitSetup(_configuration);
|
||||||
|
// 用户类型 策略授权
|
||||||
|
//services.AddAuthorizationPolicySetup(_configuration);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<ISearcher>(new Searcher(CachePolicy.Content, Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "ip2region.xdb")));
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
var env = app.Environment;
|
||||||
|
|
||||||
|
#region 配置中间件
|
||||||
|
|
||||||
|
|
||||||
|
// Configure the HTTP request pipeline.
|
||||||
|
|
||||||
|
//本地化
|
||||||
|
app.UseLocalization();
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
//hangfire
|
||||||
|
app.UseHangfireConfig(env);
|
||||||
|
|
||||||
|
|
||||||
|
////限流 中间件
|
||||||
|
//app.UseIpRateLimiting();
|
||||||
|
|
||||||
|
|
||||||
|
if (env.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseDeveloperExceptionPage();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//app.UseHsts();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 特殊异常处理 比如 404
|
||||||
|
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||||
|
|
||||||
|
SwaggerSetup.Configure(app, env);
|
||||||
|
|
||||||
|
|
||||||
|
////serilog 记录请求的用户信息
|
||||||
|
app.UseSerilogConfig(env);
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||||
|
|
||||||
|
//app.UseIRacisHostStaticFileStore(env);
|
||||||
|
|
||||||
|
|
||||||
|
app.UseAuthentication();
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.MapControllers();
|
||||||
|
|
||||||
|
app.MapHub<UploadHub>("/UploadHub");
|
||||||
|
app.MapHealthChecks("/health");
|
||||||
|
|
||||||
|
|
||||||
|
// Serilog
|
||||||
|
SerilogExtension.AddSerilogSetup(enviromentName, app.Services);
|
||||||
|
|
||||||
|
|
||||||
|
var hangfireJobService = app.Services.GetRequiredService<IIRaCISHangfireJob>();
|
||||||
|
|
||||||
|
await hangfireJobService.InitHangfireJobTaskAsync();
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#region 运行环境 部署平台
|
||||||
|
|
||||||
|
Log.Logger.Warning($"当前环境:{enviromentName}");
|
||||||
|
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
{
|
||||||
|
Log.Logger.Warning($"当前部署平台环境:windows");
|
||||||
|
}
|
||||||
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
|
{
|
||||||
|
Log.Logger.Warning($"当前部署平台环境:linux");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Logger.Warning($"当前部署平台环境:OSX or FreeBSD");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
Log.Logger.Warning($"ContentRootPath:{env.ContentRootPath}");
|
||||||
|
|
||||||
|
|
||||||
|
string parentDirectory = Path.GetFullPath(Path.Combine(env.ContentRootPath, ".."));
|
||||||
|
|
||||||
|
|
||||||
|
Log.Logger.Warning($"ContentRootPath——parentDirectory:{parentDirectory}");
|
||||||
|
|
||||||
|
//Log.Logger.Warning($"ContentRootPath——GetParent:{Directory.GetParent(env.ContentRootPath).Parent.FullName}");
|
||||||
|
//Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}");
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
Log.Logger.Error(e.InnerException is null ? e.Message + e.StackTrace : e.InnerException?.Message + e.InnerException?.StackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"Docker": {
|
"Test_Study": {
|
||||||
"commandName": "Docker",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
"environmentVariables": {
|
||||||
"publishAllPorts": true
|
"ASPNETCORE_ENVIRONMENT": "Test_Study"
|
||||||
|
},
|
||||||
|
"applicationUrl": "http://localhost:6100"
|
||||||
},
|
},
|
||||||
"Uat_Study": {
|
"Uat_Study": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
@@ -14,14 +16,6 @@
|
|||||||
"ASPNETCORE_ENVIRONMENT": "Uat_Study"
|
"ASPNETCORE_ENVIRONMENT": "Uat_Study"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6100"
|
"applicationUrl": "http://localhost:6100"
|
||||||
},
|
|
||||||
"Test_Study": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"launchBrowser": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Test_Study"
|
|
||||||
},
|
|
||||||
"applicationUrl": "http://localhost:6100"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
// 使用的是proto3版本
|
// 使用的是proto3版本
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||||
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
每一句需要用分号结尾
|
每一句需要用分号结尾
|
||||||
message 用来定义请求和返回数据格式
|
message 用来定义请求和返回数据格式
|
||||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||||
message GetTokenReuqest{
|
message GetTokenReuqest{
|
||||||
string id=1;
|
string id=1;
|
||||||
string userName=2;
|
string userName=2;
|
||||||
@@ -22,48 +22,48 @@ message GetTokenReuqest{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增时返回的消息格式
|
// 新增时返回的消息格式
|
||||||
message GetTokenResponse {
|
message GetTokenResponse {
|
||||||
int32 code=1;
|
int32 code=1;
|
||||||
string token =2;
|
string token =2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// service 用标识定义服务的,里面写对应的方法
|
// service 用标识定义服务的,里面写对应的方法
|
||||||
service TokenGrpcService{
|
service TokenGrpcService{
|
||||||
// 获取token
|
// 获取token
|
||||||
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||||
message AddUserReuqest{
|
message AddUserReuqest{
|
||||||
string name=1;
|
string name=1;
|
||||||
int32 age=2;
|
int32 age=2;
|
||||||
bool isBoy=3;
|
bool isBoy=3;
|
||||||
}
|
}
|
||||||
// 新增时返回的消息格式
|
// 新增时返回的消息格式
|
||||||
message ResultResponse {
|
message ResultResponse {
|
||||||
int32 code=1;
|
int32 code=1;
|
||||||
string msg =2;
|
string msg =2;
|
||||||
}
|
}
|
||||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||||
message QueryUserReuqest{
|
message QueryUserReuqest{
|
||||||
string name=1;
|
string name=1;
|
||||||
}
|
}
|
||||||
//查询返回的用户信息格式,可理解为返回的类
|
//查询返回的用户信息格式,可理解为返回的类
|
||||||
message UserInfoResponse {
|
message UserInfoResponse {
|
||||||
string name=1;
|
string name=1;
|
||||||
int32 age=2;
|
int32 age=2;
|
||||||
string gender=3;
|
string gender=3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// service 用标识定义服务的,里面写对应的方法
|
// service 用标识定义服务的,里面写对应的方法
|
||||||
service UserService{
|
service UserService{
|
||||||
// 新增用户
|
// 新增用户
|
||||||
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
||||||
// 查询用户
|
// 查询用户
|
||||||
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,257 +0,0 @@
|
|||||||
using Autofac;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Application.Filter;
|
|
||||||
using LogDashboard;
|
|
||||||
using MediatR;
|
|
||||||
using IRaCIS.Core.Application.MediatR.Handlers;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using AspNetCoreRateLimit;
|
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using System.Globalization;
|
|
||||||
using Microsoft.AspNetCore.Localization;
|
|
||||||
using Localization;
|
|
||||||
using Magicodes.ExporterAndImporter.Core.Filters;
|
|
||||||
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
|
||||||
using Invio.Extensions.Authentication.JwtBearer;
|
|
||||||
using Microsoft.AspNetCore.SignalR;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using Microsoft.AspNetCore.StaticFiles;
|
|
||||||
using IRaCIS.Application.Services.BackGroundJob;
|
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Autofac.Core;
|
|
||||||
using DocumentFormat.OpenXml.InkML;
|
|
||||||
using EasyCaching.Core;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.API
|
|
||||||
{
|
|
||||||
public class Startup
|
|
||||||
{
|
|
||||||
public Startup(IConfiguration configuration)
|
|
||||||
{
|
|
||||||
_configuration = configuration;
|
|
||||||
}
|
|
||||||
public ILogger<Startup> _logger { get; }
|
|
||||||
|
|
||||||
public IConfiguration _configuration { get; }
|
|
||||||
|
|
||||||
//// ConfigureContainer is where you can register things directly
|
|
||||||
//// with Autofac. This runs after ConfigureServices so the things
|
|
||||||
//// here will override registrations made in ConfigureServices.
|
|
||||||
//// Don't build the container; that gets done for you by the factory.
|
|
||||||
// for castle
|
|
||||||
public void ConfigureContainer(ContainerBuilder containerBuilder)
|
|
||||||
{
|
|
||||||
containerBuilder.RegisterModule<AutofacModuleSetup>();
|
|
||||||
|
|
||||||
#region Test
|
|
||||||
//containerBuilder.RegisterType<ClinicalDataService>().PropertiesAutowired().InstancePerLifetimeScope();//注册仓储
|
|
||||||
|
|
||||||
//var container = containerBuilder.Build();
|
|
||||||
|
|
||||||
//// Now you can resolve services using Autofac. For example,
|
|
||||||
//// this line will execute the lambda expression registered
|
|
||||||
//// to the IConfigReader service.
|
|
||||||
//using (var scope = container.BeginLifetimeScope())
|
|
||||||
//{
|
|
||||||
// var reader = scope.Resolve<BaseService>();
|
|
||||||
|
|
||||||
// var test = scope.Resolve<ClinicalDataService>();
|
|
||||||
// var test2 = scope.Resolve<IClinicalDataService>();
|
|
||||||
|
|
||||||
// var test3 = scope.Resolve<IEFUnitOfWork<IRaCISDBContext>>();
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
|
||||||
{
|
|
||||||
//本地化
|
|
||||||
services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
|
|
||||||
|
|
||||||
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
|
|
||||||
services.AddControllers(options =>
|
|
||||||
{
|
|
||||||
//options.Filters.Add<LogActionFilter>();
|
|
||||||
options.Filters.Add<ModelActionFilter>();
|
|
||||||
options.Filters.Add<ProjectExceptionFilter>();
|
|
||||||
options.Filters.Add<UnitOfWorkFilter>();
|
|
||||||
|
|
||||||
if (_configuration.GetSection("BasicSystemConfig").GetValue<bool>("OpenLoginLimit"))
|
|
||||||
{
|
|
||||||
options.Filters.Add<LimitUserRequestAuthorization>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
.AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
|
|
||||||
|
|
||||||
services.AddOptions().Configure<SystemEmailSendConfig>(_configuration.GetSection("SystemEmailSendConfig"));
|
|
||||||
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
|
||||||
services.AddDynamicWebApiSetup();
|
|
||||||
//AutoMapper
|
|
||||||
services.AddAutoMapperSetup();
|
|
||||||
//EF ORM QueryWithNoLock
|
|
||||||
services.AddEFSetup(_configuration);
|
|
||||||
//Http 响应压缩
|
|
||||||
services.AddResponseCompressionSetup();
|
|
||||||
//Swagger Api 文档
|
|
||||||
services.AddSwaggerSetup();
|
|
||||||
//JWT Token 验证
|
|
||||||
services.AddJWTAuthSetup(_configuration);
|
|
||||||
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
|
||||||
services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
|
||||||
// EasyCaching 缓存
|
|
||||||
services.AddEasyCachingSetup(_configuration);
|
|
||||||
|
|
||||||
//services.AddDistributedMemoryCache();
|
|
||||||
|
|
||||||
// hangfire 定时任务框架 有界面,更友好~
|
|
||||||
services.AddhangfireSetup(_configuration);
|
|
||||||
|
|
||||||
// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
|
|
||||||
services.AddQuartZSetup(_configuration);
|
|
||||||
|
|
||||||
// 保护上传文件
|
|
||||||
//services.AddStaticFileAuthorizationSetup();
|
|
||||||
|
|
||||||
|
|
||||||
////HttpReports 暂时废弃
|
|
||||||
//services.AddHttpReports().AddHttpTransport();
|
|
||||||
//Serilog 日志可视化 LogDashboard日志
|
|
||||||
services.AddLogDashboardSetup();
|
|
||||||
//上传限制 配置
|
|
||||||
services.Configure<FormOptions>(options =>
|
|
||||||
{
|
|
||||||
options.MultipartBodyLengthLimit = int.MaxValue;
|
|
||||||
options.ValueCountLimit = int.MaxValue;
|
|
||||||
options.ValueLengthLimit = int.MaxValue;
|
|
||||||
});
|
|
||||||
//IP 限流 可设置白名单 或者黑名单
|
|
||||||
//services.AddIpPolicyRateLimitSetup(_configuration);
|
|
||||||
// 用户类型 策略授权
|
|
||||||
//services.AddAuthorizationPolicySetup(_configuration);
|
|
||||||
|
|
||||||
services.AddJsonConfigSetup(_configuration);
|
|
||||||
//转发头设置 获取真实IP
|
|
||||||
services.Configure<ForwardedHeadersOptions>(options =>
|
|
||||||
{
|
|
||||||
options.ForwardedHeaders =
|
|
||||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
|
||||||
});
|
|
||||||
//Dicom影像渲染图片 跨平台
|
|
||||||
services.AddDicomSetup();
|
|
||||||
|
|
||||||
// 实时应用
|
|
||||||
services.AddSignalR();
|
|
||||||
|
|
||||||
|
|
||||||
services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
|
||||||
|
|
||||||
//services.AddSingleton<IImportResultFilter, ImportResultFilteTest>();
|
|
||||||
|
|
||||||
services.AddMemoryCache();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
||||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
||||||
{
|
|
||||||
//app.UsePathBase(PathString.FromUriComponent("/api"));
|
|
||||||
|
|
||||||
//本地化
|
|
||||||
app.UseLocalization();
|
|
||||||
|
|
||||||
app.UseForwardedHeaders();
|
|
||||||
|
|
||||||
//响应压缩
|
|
||||||
app.UseResponseCompression();
|
|
||||||
|
|
||||||
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
|
||||||
|
|
||||||
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
|
||||||
app.UseStaticFiles();
|
|
||||||
|
|
||||||
|
|
||||||
//LogDashboard
|
|
||||||
app.UseLogDashboard("/back/logs");
|
|
||||||
|
|
||||||
//hangfire
|
|
||||||
app.UseHangfireConfig(env);
|
|
||||||
|
|
||||||
////暂时废弃
|
|
||||||
//app.UseHttpReports();
|
|
||||||
|
|
||||||
////限流 中间件
|
|
||||||
//app.UseIpRateLimiting();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.UseDeveloperExceptionPage();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//app.UseHsts();
|
|
||||||
}
|
|
||||||
Console.WriteLine("当前环境: " + env.EnvironmentName);
|
|
||||||
|
|
||||||
//app.UseMiddleware<AuthMiddleware>();
|
|
||||||
|
|
||||||
// 特殊异常处理 比如 404
|
|
||||||
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
|
||||||
|
|
||||||
SwaggerSetup.Configure(app, env);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////serilog 记录请求的用户信息
|
|
||||||
app.UseSerilogConfig(env);
|
|
||||||
|
|
||||||
app.UseRouting();
|
|
||||||
|
|
||||||
app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
|
||||||
|
|
||||||
//app.UseIRacisHostStaticFileStore(env);
|
|
||||||
app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
|
||||||
|
|
||||||
|
|
||||||
app.UseAuthentication();
|
|
||||||
//app.UseJwtBearerQueryString();
|
|
||||||
app.UseAuthorization();
|
|
||||||
|
|
||||||
////文件伺服 必须带Token 访问
|
|
||||||
////app.UseIRacisHostStaticFileStore(env);
|
|
||||||
|
|
||||||
app.UseEndpoints(endpoints =>
|
|
||||||
{
|
|
||||||
endpoints.MapControllers();
|
|
||||||
|
|
||||||
endpoints.MapHub<UploadHub>("/UploadHub");
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var hangfireJobService = app.ApplicationServices.GetRequiredService<IIRaCISHangfireJob>();
|
|
||||||
|
|
||||||
await hangfireJobService.InitHangfireJobTaskAsync();
|
|
||||||
//有的时候每调用
|
|
||||||
//HangfireJobHelper.NotImmediatelyOnceOnlyJob<IIRaCISHangfireJob>(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.API
|
|||||||
app.UseSerilogRequestLogging(opts
|
app.UseSerilogRequestLogging(opts
|
||||||
=>
|
=>
|
||||||
{
|
{
|
||||||
opts.MessageTemplate = "{TokenUserRealName} {TokenUserType} {ClientIp} {RequestIP} {Host} {Protocol} {RequestMethod} {RequestPath} {RequestBody} responded {StatusCode} in {Elapsed:0.0000} ms";
|
opts.MessageTemplate = "{TokenUserRealName} {TokenUserTypeShortName} {ClientIp} {LocalIP} {Host} {Protocol} {RequestMethod} {RequestPath} {RequestBody} responded {StatusCode} in {Elapsed:0.0000} ms";
|
||||||
opts.EnrichDiagnosticContext = SerilogHelper.EnrichFromRequest;
|
opts.EnrichDiagnosticContext = SerilogHelper.EnrichFromRequest;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using IRaCIS.Core.Infrastructure.Extention;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
@@ -41,9 +42,9 @@ namespace IRaCIS.Core.API
|
|||||||
// Set the content-type of the Response at this point
|
// Set the content-type of the Response at this point
|
||||||
diagnosticContext.Set("ContentType", httpContext.Response.ContentType);
|
diagnosticContext.Set("ContentType", httpContext.Response.ContentType);
|
||||||
|
|
||||||
diagnosticContext.Set("TokenUserRealName", httpContext?.User?.FindFirst("realName")?.Value);
|
diagnosticContext.Set("TokenUserRealName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.RealName)?.Value);
|
||||||
|
|
||||||
diagnosticContext.Set("TokenUserType", httpContext?.User?.FindFirst("userTypeEnumName")?.Value);
|
diagnosticContext.Set("TokenUserTypeShortName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value);
|
||||||
|
|
||||||
// Retrieve the IEndpointFeature selected for the request
|
// Retrieve the IEndpointFeature selected for the request
|
||||||
var endpoint = httpContext.GetEndpoint();
|
var endpoint = httpContext.GetEndpoint();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Autofac;
|
using Autofac;
|
||||||
using Autofac.Extras.DynamicProxy;
|
using Autofac.Extras.DynamicProxy;
|
||||||
using IRaCIS.Core.Application;
|
using IRaCIS.Core.Application;
|
||||||
using IRaCIS.Core.Application.AOP;
|
|
||||||
using IRaCIS.Core.Application.BackGroundJob;
|
using IRaCIS.Core.Application.BackGroundJob;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace IRaCIS.Core.API
|
|||||||
//triggerOptions.AddTrigger<AddlTrialUserTrigger>();
|
//triggerOptions.AddTrigger<AddlTrialUserTrigger>();
|
||||||
triggerOptions.AddTrigger<VisitTaskIsFrontTaskNeedSignButNotSignTrigger>();
|
triggerOptions.AddTrigger<VisitTaskIsFrontTaskNeedSignButNotSignTrigger>();
|
||||||
triggerOptions.AddTrigger<VisitTaskIAfterSignTrigger>();
|
triggerOptions.AddTrigger<VisitTaskIAfterSignTrigger>();
|
||||||
|
triggerOptions.AddTrigger<UserLogTrigger>();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,24 +26,26 @@ namespace IRaCIS.Core.API
|
|||||||
|
|
||||||
//控制台 方便调试 问题 我们显示记录日志 时 获取上下文的ip 和用户名 用户类型
|
//控制台 方便调试 问题 我们显示记录日志 时 获取上下文的ip 和用户名 用户类型
|
||||||
.WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Warning,
|
.WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Warning,
|
||||||
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3} ] {LocalIP} {ClientIp} {TokenUserRealName} {TokenUserType} {Message:lj} {Properties:j}{NewLine} {Exception}")
|
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}")
|
||||||
|
|
||||||
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,
|
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,
|
||||||
outputTemplate: "{Timestamp:HH:mm:ss} || {Level} || {SourceContext:l} || {Message} ||{Exception} ||end {NewLine}");
|
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}");
|
||||||
|
|
||||||
//.WriteTo.MSSqlServer("Data Source=DESKTOP-4TU9A6M;Initial Catalog=CoreFrame;User ID=sa;Password=123456", "logs", autoCreateSqlTable: true, restrictedToMinimumLevel: LogEventLevel.Information)//从左至右四个参数分别是数据库连接字符串、表名、如果表不存在是否创建、最低等级。Serilog会默认创建一些列。
|
//.WriteTo.MSSqlServer("Data Source=DESKTOP-4TU9A6M;Initial Catalog=CoreFrame;User ID=sa;Password=123456", "logs", autoCreateSqlTable: true, restrictedToMinimumLevel: LogEventLevel.Information)//从左至右四个参数分别是数据库连接字符串、表名、如果表不存在是否创建、最低等级。Serilog会默认创建一些列。
|
||||||
|
|
||||||
if (environment == "Production")
|
//if (environment == "Production")
|
||||||
{
|
//{
|
||||||
config.WriteTo.Email(new EmailConnectionInfo()
|
// config.WriteTo.Email(new EmailConnectionInfo()
|
||||||
{
|
// {
|
||||||
EmailSubject = "系统警告,请速速查看!",//邮件标题
|
// EmailSubject = "系统警告,请速速查看!",//邮件标题
|
||||||
FromEmail = "test@extimaging.com",//发件人邮箱
|
// FromEmail = "test@extimaging.com",//发件人邮箱
|
||||||
MailServer = "smtp.qiye.aliyun.com",//smtp服务器地址
|
// MailServer = "smtp.qiye.aliyun.com",//smtp服务器地址
|
||||||
NetworkCredentials = new NetworkCredential("test@extimaging.com", "SHzyyl2021"),//两个参数分别是发件人邮箱与客户端授权码
|
// NetworkCredentials = new NetworkCredential("test@extimaging.com", "SHzyyl2021"),//两个参数分别是发件人邮箱与客户端授权码
|
||||||
Port = 465,//端口号
|
// Port = 465,//端口号
|
||||||
ToEmail = "872297557@qq.com"//收件人
|
// ToEmail = "872297557@qq.com"//收件人
|
||||||
}, restrictedToMinimumLevel: LogEventLevel.Error,
|
// }, restrictedToMinimumLevel: LogEventLevel.Error,
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [ {Level} {ClientIp} {ClientAgent} {TokenUserRealName} {TokenUserType} ] || [path: {RequestPath} arguments: {RequestBody}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine})");
|
// outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [ {Level} {ClientIp} {ClientAgent} {TokenUserRealName} {TokenUserType} ] || [path: {RequestPath} arguments: {RequestBody}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine})");
|
||||||
}
|
//}
|
||||||
|
|
||||||
//扩展方法 获取上下文的ip 用户名 用户类型
|
//扩展方法 获取上下文的ip 用户名 用户类型
|
||||||
Log.Logger = config.Enrich.WithHttpContextInfo(serviceProvider).CreateLogger();
|
Log.Logger = config.Enrich.WithHttpContextInfo(serviceProvider).CreateLogger();
|
||||||
|
|||||||
@@ -6,19 +6,34 @@
|
|||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AliyunOSS": {
|
"ObjectStoreService": {
|
||||||
"regionId": "cn-shanghai",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"region": "oss-cn-shanghai",
|
"AliyunOSS": {
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"regionId": "cn-shanghai",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"bucketName": "zy-sir-store",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
"viewEndpoint": "https://zy-sir-cache.oss-cn-shanghai.aliyuncs.com"
|
"bucketName": "zy-sir-store",
|
||||||
|
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||||
|
"viewEndpoint": "https://zy-sir-cache.oss-cn-shanghai.aliyuncs.com",
|
||||||
|
"region": "oss-cn-shanghai"
|
||||||
|
},
|
||||||
|
|
||||||
|
"MinIO": {
|
||||||
|
"endpoint": "http://192.168.3.68",
|
||||||
|
"port": "8001",
|
||||||
|
"useSSL": false,
|
||||||
|
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||||
|
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||||
|
"bucketName": "test"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=47.117.165.18,1434;Database=Prod_Study;User ID=sa;Password=WHxckj@2019;TrustServerCertificate=true",
|
//"RemoteNew": "Server=47.117.165.18,1434;Database=Prod_Study;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=47.117.165.18,1434;Database=Prod_Study.hangfire;User ID=sa;Password=WHxckj@2019;TrustServerCertificate=true"
|
//"Hangfire": "Server=47.117.165.18,1434;Database=Prod_Study_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||||
|
"RemoteNew": "Server=prod_mssql_standard,1433;Database=Prod_Study;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||||
|
"Hangfire": "Server=prod_mssql_standard,1433;Database=Prod_Study_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
|
|
||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|||||||
@@ -6,18 +6,42 @@
|
|||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AliyunOSS": {
|
"ObjectStoreService": {
|
||||||
"regionId": "cn-shanghai",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"region": "oss-cn-shanghai",
|
"AliyunOSS": {
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"regionId": "cn-shanghai",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"bucketName": "zy-sir-test-store",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
"viewEndpoint": "https://zy-sir-test-store.oss-cn-shanghai.aliyuncs.com"
|
"bucketName": "zy-sir-test-store",
|
||||||
|
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||||
|
"viewEndpoint": "https://zy-sir-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
|
"region": "oss-cn-shanghai"
|
||||||
|
},
|
||||||
|
|
||||||
|
"MinIO": {
|
||||||
|
"endPoint": "123.56.94.154",
|
||||||
|
"port": "9001",
|
||||||
|
"useSSL": true,
|
||||||
|
"accessKey": "fbStsVYCIPKHQneeqMwD",
|
||||||
|
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||||
|
"bucketName": "study-test",
|
||||||
|
"viewEndpoint": "http://study.test.extimaging.com/oss/study-test"
|
||||||
|
},
|
||||||
|
|
||||||
|
"AWS": {
|
||||||
|
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||||
|
"useSSL": false,
|
||||||
|
"accessKey": "AKIAZQ3DRSOHFPJJ6FEU",
|
||||||
|
"secretKey": "l+yjtvV7Z4jiwm/7xCYv30UeUj/SvuqqYzAwjJHf",
|
||||||
|
"bucketName": "ei-irc-test-store",
|
||||||
|
"viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Test.Study;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
|
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_Study;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Test.Study.hangfire;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
"Hangfire": "Server=106.14.89.110,1435;Database=Test_Study_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
@@ -41,7 +65,7 @@
|
|||||||
"FromName": "Test_Study",
|
"FromName": "Test_Study",
|
||||||
"AuthorizationCode": "zhanying123",
|
"AuthorizationCode": "zhanying123",
|
||||||
|
|
||||||
"SiteUrl": "http://test.study.extimaging.com/login"
|
"SiteUrl": "http://study.test.extimaging.com/login"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,27 @@
|
|||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AliyunOSS": {
|
"ObjectStoreService": {
|
||||||
"regionId": "cn-shanghai",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"region": "oss-cn-shanghai",
|
"AliyunOSS": {
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"regionId": "cn-shanghai",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"bucketName": "zy-sir-uat-store",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
"viewEndpoint": "https://zy-sir-uat-store.oss-cn-shanghai.aliyuncs.com"
|
"bucketName": "zy-sir-uat-store",
|
||||||
|
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||||
|
"viewEndpoint": "https://zy-sir-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
|
"region": "oss-cn-shanghai"
|
||||||
|
},
|
||||||
|
|
||||||
|
"MinIO": {
|
||||||
|
"endpoint": "http://192.168.3.68",
|
||||||
|
"port": "8001",
|
||||||
|
"useSSL": false,
|
||||||
|
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||||
|
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||||
|
"bucketName": "test"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat.Study;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat.Study;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
@@ -40,7 +53,7 @@
|
|||||||
"FromEmail": "uat-study@extimaging.com",
|
"FromEmail": "uat-study@extimaging.com",
|
||||||
"FromName": "Uat_Study",
|
"FromName": "Uat_Study",
|
||||||
"AuthorizationCode": "zhanying123",
|
"AuthorizationCode": "zhanying123",
|
||||||
"SiteUrl": "http://uat.study.extimaging.com/login"
|
"SiteUrl": "http://study.uat.extimaging.com/login"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
Thank you for using our IRC imaging system.
|
Thank you for using our IRC imaging system.
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||||
{0}。
|
{0}.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
|
|||||||
@@ -34,12 +34,15 @@
|
|||||||
角色: {5}
|
角色: {5}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
系统登录地址:{6}
|
系统登录地址:
|
||||||
|
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||||
|
点击跳转
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,7 +34,10 @@
|
|||||||
Role: {5}
|
Role: {5}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Login URL: {6}
|
Login URL:
|
||||||
|
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||||
|
click redirect
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
|
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
|
||||||
<div style='padding-top: 20px;font-size: 16px'>
|
<div style='padding-top: 20px;font-size: 16px'>
|
||||||
<div style='line-height: 40px;font-size: 16px'>
|
<div style='line-height: 40px;font-size: 16px'>
|
||||||
Dear {0} ,
|
Dear {0} ,
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||||
The site survey questionnaire you filled in has been rejected. Details are as follows:
|
The site survey questionnaire you filled in has been rejected. Details are as follows:
|
||||||
|
|||||||
@@ -34,13 +34,16 @@
|
|||||||
角色: {5}
|
角色: {5}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
系统登录地址:{6}
|
系统登录地址:
|
||||||
|
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||||
|
点击跳转
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,7 +34,10 @@
|
|||||||
Role: {5}
|
Role: {5}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Login URL: {6}
|
Login URL:
|
||||||
|
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||||
|
click redirect
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,17 +8,17 @@
|
|||||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||||
<div style='padding-top: 20px;'>
|
<div style='padding-top: 20px;'>
|
||||||
<div style='line-height: 40px;font-size: 18px'>
|
<div style='line-height: 40px;font-size: 18px'>
|
||||||
亲爱的用户 ,
|
Hello {0},
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||||
感谢您使用展影云平台。
|
感谢您使用展影云平台。
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||||
{0},验证码是: {1},请在3分钟内输入该验证码,进行后续操作。如非本人操作,请忽略该邮件。
|
{1},验证码是: {2},请在3分钟内输入该验证码,进行后续操作。如非本人操作,请忽略该邮件。
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
<div>祝您顺利!/Best Regards</div>
|
<div>祝您顺利!</div>
|
||||||
<div style="font-size: 14px;">展影医疗</div>
|
<div style="font-size: 14px;">展影医疗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||||
<div style='padding-top: 20px;'>
|
<div style='padding-top: 20px;'>
|
||||||
<div style='line-height: 40px;font-size: 16px'>
|
<div style='line-height: 40px;font-size: 16px'>
|
||||||
Dear Sir or Madam:
|
Hello {0},
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||||
Thank you for using our imaging system.
|
Thank you for using our imaging system.
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||||
{0}, the verification code is {1}. Please enter this code within 3 minutes for follow-up operations.
|
{1}, the verification code is {2}. Please enter this code within 3 minutes for follow-up operations.
|
||||||
</div>
|
</div>
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||||
If you are not the intended person, please ignore this email.
|
If you are not the intended person, please ignore this email.
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
using Castle.DynamicProxy;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.AOP
|
|
||||||
{
|
|
||||||
public abstract class AsyncInterceptorBase : IInterceptor
|
|
||||||
{
|
|
||||||
public AsyncInterceptorBase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Intercept(IInvocation invocation)
|
|
||||||
{
|
|
||||||
BeforeProceed(invocation);
|
|
||||||
invocation.Proceed();
|
|
||||||
if (IsAsyncMethod(invocation.MethodInvocationTarget))
|
|
||||||
{
|
|
||||||
invocation.ReturnValue = InterceptAsync((dynamic)invocation.ReturnValue, invocation);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AfterProceedSync(invocation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckMethodReturnTypeIsTaskType(MethodInfo method)
|
|
||||||
{
|
|
||||||
var methodReturnType = method.ReturnType;
|
|
||||||
if (methodReturnType.IsGenericType)
|
|
||||||
{
|
|
||||||
if (methodReturnType.GetGenericTypeDefinition() == typeof(Task<>) ||
|
|
||||||
methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (methodReturnType == typeof(Task) ||
|
|
||||||
methodReturnType == typeof(ValueTask))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsAsyncMethod(MethodInfo method)
|
|
||||||
{
|
|
||||||
bool isDefAsync = Attribute.IsDefined(method, typeof(AsyncStateMachineAttribute), false);
|
|
||||||
bool isTaskType = CheckMethodReturnTypeIsTaskType(method);
|
|
||||||
bool isAsync = isDefAsync && isTaskType;
|
|
||||||
|
|
||||||
return isAsync;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected object ProceedAsyncResult { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
private async Task InterceptAsync(Task task, IInvocation invocation)
|
|
||||||
{
|
|
||||||
await task.ConfigureAwait(false);
|
|
||||||
await AfterProceedAsync(invocation, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<TResult> InterceptAsync<TResult>(Task<TResult> task, IInvocation invocation)
|
|
||||||
{
|
|
||||||
ProceedAsyncResult = await task.ConfigureAwait(false);
|
|
||||||
await AfterProceedAsync(invocation, true);
|
|
||||||
return (TResult)ProceedAsyncResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async ValueTask InterceptAsync(ValueTask task, IInvocation invocation)
|
|
||||||
{
|
|
||||||
await task.ConfigureAwait(false);
|
|
||||||
await AfterProceedAsync(invocation, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async ValueTask<TResult> InterceptAsync<TResult>(ValueTask<TResult> task, IInvocation invocation)
|
|
||||||
{
|
|
||||||
ProceedAsyncResult = await task.ConfigureAwait(false);
|
|
||||||
await AfterProceedAsync(invocation, true);
|
|
||||||
return (TResult)ProceedAsyncResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void BeforeProceed(IInvocation invocation) { }
|
|
||||||
|
|
||||||
protected virtual void AfterProceedSync(IInvocation invocation) { }
|
|
||||||
|
|
||||||
protected virtual Task AfterProceedAsync(IInvocation invocation, bool hasAsynResult)
|
|
||||||
{
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,499 +0,0 @@
|
|||||||
//using System;
|
|
||||||
//using Castle.DynamicProxy;
|
|
||||||
//using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
|
||||||
//using IRaCIS.Core.Infra.EFCore;
|
|
||||||
|
|
||||||
//using System.Linq;
|
|
||||||
//using IRaCIS.Core.Domain.Models;
|
|
||||||
//using IRaCIS.Core.Domain.Share;
|
|
||||||
|
|
||||||
//namespace IRaCIS.Core.API.Utility.AOP
|
|
||||||
//{
|
|
||||||
//#pragma warning disable
|
|
||||||
// public class QANoticeAOP : IInterceptor
|
|
||||||
// {
|
|
||||||
// private readonly IRepository<QANotice> _qaNoticeRepository;
|
|
||||||
|
|
||||||
// private readonly IRepository<DicomStudy> _studyRepository;
|
|
||||||
// private readonly IRepository<TrialUser> _userTrialRepository;
|
|
||||||
// private readonly IRepository<TrialSiteUser> _userTrialSiteRepository;
|
|
||||||
// private readonly IUserInfo _userInfo;
|
|
||||||
|
|
||||||
// public QANoticeAOP(IRepository<QANotice> qaNoticeRepository,
|
|
||||||
// IUserInfo userInfo, IRepository<DicomStudy> studyRepository, IRepository<TrialUser> userTrialRepository, IRepository<TrialSiteUser> userTrialSiteRepository)
|
|
||||||
// {
|
|
||||||
// _qaNoticeRepository = qaNoticeRepository;
|
|
||||||
|
|
||||||
// _studyRepository = studyRepository;
|
|
||||||
// _userTrialRepository = userTrialRepository;
|
|
||||||
// _userTrialSiteRepository = userTrialSiteRepository;
|
|
||||||
// _userInfo = userInfo;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public void Intercept(IInvocation invocation)
|
|
||||||
// {
|
|
||||||
// //处理拦截的方法
|
|
||||||
// invocation.Proceed();
|
|
||||||
|
|
||||||
// if (invocation.Method.Name == "UpdateStudyStatus")
|
|
||||||
// {
|
|
||||||
// var studyStatus = invocation.Arguments[0] as StudyStatusDetailCommand;
|
|
||||||
|
|
||||||
// var study = _studyRepository.FirstOrDefault(t=>t.Id==studyStatus.StudyId);
|
|
||||||
|
|
||||||
|
|
||||||
// if (study.Status == (int)StudyStatus.Uploaded)
|
|
||||||
// {
|
|
||||||
// _qaNoticeRepository.Add(new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
|
|
||||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
|
||||||
// NeedDeal = false,
|
|
||||||
// StudyStatusStr = "Uploaded",
|
|
||||||
// Message = $"CRC : {_userInfo.RealName} has uploaded {study.StudyCode} ",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #region 处理QA通知模块
|
|
||||||
|
|
||||||
// //查询项目的参与者 和 负责site下CRC用户
|
|
||||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// // 找到该study 关联Site 下的CRC
|
|
||||||
|
|
||||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
|
||||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
|
||||||
|
|
||||||
// var pm = trialUserList.FirstOrDefault(t => t.User.UserTypeEnum == UserTypeEnum.ProjectManager);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // CRC =>QA
|
|
||||||
// if (studyStatus.Status == (int)StudyStatus.QARequested)
|
|
||||||
// {
|
|
||||||
// //找出当前操作的CRC
|
|
||||||
// //PM 或者admin可以代替CRC角色 不能从CRC列表中查询用户
|
|
||||||
// //var currentCRC = trialUserList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
|
|
||||||
// var notice = new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
|
|
||||||
// //FromUser = currentCRC.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentCRC.UserType,
|
|
||||||
// NoticeTypeEnum = NoticeType.CRC_RequestToQA_NoticeQA,
|
|
||||||
// NeedDeal = true,
|
|
||||||
// StudyStatusStr = "QA Requested",
|
|
||||||
// Message =
|
|
||||||
// $"CRC -> QA : {_userInfo.RealName} request QA {study.StudyCode} , Inquiry can be performed! ",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// {
|
|
||||||
// QANoticeId = notice.Id,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// ToUser = t.User.LastName + " / " + t.User.FirstName,
|
|
||||||
// ToUserId = t.UserId,
|
|
||||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
|
||||||
// }));
|
|
||||||
|
|
||||||
// _qaNoticeRepository.Add(notice);
|
|
||||||
|
|
||||||
// //DealRequestToQA(study.Id);
|
|
||||||
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
|
||||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal && t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA).ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // QA =>CRC 向CRC推送消息影像有问题 同时作为 requestToQA 的边界
|
|
||||||
// else if (studyStatus.Status == (int)StudyStatus.QAing)
|
|
||||||
// {
|
|
||||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
|
||||||
// //var currentQA = qaList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
|
|
||||||
// //在项目CRC列表中筛选出 负责该study关联 site的CRC
|
|
||||||
// var siteCRCList = _userTrialSiteRepository.Where(t =>
|
|
||||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// //查询项目的参与者 和 负责site下CRC用户
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var notice = new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// //FromUser = currentQA.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentQA.UserType,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.QA_InQA_NoticeCRC,
|
|
||||||
// NeedDeal = true,
|
|
||||||
// StudyStatusStr = "In QA",
|
|
||||||
// Message = $"QA -> CRC : {_userInfo.RealName} inquiry {study.StudyCode} ",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// siteCRCList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// {
|
|
||||||
// QANoticeId = notice.Id,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// ToUser = t.User.LastName + " / " + t.User.FirstName,
|
|
||||||
// ToUserId = t.UserId,
|
|
||||||
// ToUserType = t.UserTypeRole.UserTypeShortName
|
|
||||||
// }));
|
|
||||||
|
|
||||||
// //添加 发送给CRC的消息 消息和CRC是 一对多
|
|
||||||
// _qaNoticeRepository.Add(notice);
|
|
||||||
|
|
||||||
|
|
||||||
// //处理 消息 标记已处理
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
|
||||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
|
||||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA)).ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// // QA =>QA 给自己的消息 通知需要匿名化 同时作为 requestToQA 的边界
|
|
||||||
// else if (studyStatus.Status == (int)StudyStatus.QAFinish)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
|
||||||
// //var currentQA = qaList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
|
|
||||||
// //发送给当前项目QA列表
|
|
||||||
|
|
||||||
// var notice = new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// //FromUser = currentQA.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentQA.UserType,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.QA_QAPass_NoticeQA,
|
|
||||||
// NeedDeal = true,
|
|
||||||
// StudyStatusStr = "QA-Passed",
|
|
||||||
// Message =
|
|
||||||
// $"QA -> QA : {_userInfo.RealName} inquiry {study.StudyCode} finished,Anonymization can be performed!",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// {
|
|
||||||
// QANoticeId = notice.Id,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
|
||||||
// ToUserId = t.UserId,
|
|
||||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
|
||||||
// }));
|
|
||||||
|
|
||||||
// _qaNoticeRepository.Add(notice);
|
|
||||||
|
|
||||||
// //处理 消息 标记已处理 存在意外情况 qa发给CRC的 但是qa里面设置了 通过或者不通过 此时qa发送的消息也设置为已处理
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
|
||||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
|
||||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA ||
|
|
||||||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_AddQARecord_NoticeCRC)).ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// // QA =>CRC 暂时不用发送消息给CRC 因为CRC 暂时没有入口回复 同时作为 requestToQA 的边界
|
|
||||||
// else if (studyStatus.Status == (int)StudyStatus.QAFInishNotPass)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// _qaNoticeRepository.Add(new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
|
||||||
// NeedDeal = false,
|
|
||||||
// StudyStatusStr = "QA-Failed",
|
|
||||||
// Message = $"QA : {_userInfo.RealName} set {study.StudyCode} QA-Failed !",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// //处理 消息 标记已处理
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
|
||||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
|
||||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA ||
|
|
||||||
|
|
||||||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC ||
|
|
||||||
// t.NoticeTypeEnum == NoticeType.QA_AddQARecord_NoticeCRC)).ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// else if (invocation.Method.Name == "ReUploadSameStudy")
|
|
||||||
// {
|
|
||||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
|
||||||
|
|
||||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
|
||||||
// var status = study.Status;
|
|
||||||
|
|
||||||
// //处理CRC 重传时 QA消息
|
|
||||||
|
|
||||||
// if (status == (int)StudyStatus.QAing)
|
|
||||||
// {
|
|
||||||
// //查询项目的参与者 和 负责site下CRC用户
|
|
||||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// // 找到该study 关联Site 下的CRC
|
|
||||||
|
|
||||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
|
||||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
|
||||||
|
|
||||||
// //CRC =>QA CRC的职能被PM 或者admin代替
|
|
||||||
// //if (_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator)
|
|
||||||
// {
|
|
||||||
// //PM 或者admin可以代替CRC角色 不能从CRC列表中查询用户
|
|
||||||
// //var currentCRC = trialUserList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
|
|
||||||
// var notice = new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// //FromUser = currentCRC.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentCRC.UserType,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.CRC_ReUpload_NoticeQA,
|
|
||||||
// NeedDeal = true,
|
|
||||||
// Message = $"CRC -> QA :{_userInfo.RealName} has reuploaded {study.StudyCode} , Need to be inquiry again",
|
|
||||||
// SendTime = DateTime.Now
|
|
||||||
// };
|
|
||||||
|
|
||||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// {
|
|
||||||
// QANoticeId = notice.Id,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
|
||||||
// ToUserId = t.UserId,
|
|
||||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
|
||||||
// }));
|
|
||||||
|
|
||||||
// _qaNoticeRepository.Add(notice);
|
|
||||||
|
|
||||||
// //这里作为 QA 设置 Inqa 状态的回复 或者QA和CRC对话的
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.Where(t => t.SubjectVisitId == study.Id && t.NeedDeal
|
|
||||||
// && (t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC || t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC))
|
|
||||||
// .ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// //不是QAing 的重传 不发送qa消息
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// else if (invocation.Method.Name == "DicomAnonymize")
|
|
||||||
// {
|
|
||||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
|
||||||
|
|
||||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
|
||||||
|
|
||||||
// #region 处理QA通知 匿名化完毕 通知PM
|
|
||||||
|
|
||||||
// //查询项目的参与者 和 负责site下CRC用户
|
|
||||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// // 找到该study 关联Site 下的CRC
|
|
||||||
|
|
||||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
|
||||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
|
||||||
|
|
||||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
|
||||||
|
|
||||||
// //
|
|
||||||
// var pm = trialUserList.FirstOrDefault(t => t.User.UserTypeEnum == UserTypeEnum.ProjectManager);
|
|
||||||
|
|
||||||
|
|
||||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
|
||||||
// //var currentQA = trialUserList.First(t =>
|
|
||||||
// // t.UserTypeEnum == UserType.IQC && t.UserId == _userInfo.Id);
|
|
||||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
|
||||||
|
|
||||||
// var notice = new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// //FromUser = currentQA.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentQA.UserType,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.QA_Anonymized_NoticeQA,
|
|
||||||
// NeedDeal = true,
|
|
||||||
// StudyStatusStr = "Anonymized",
|
|
||||||
// //Message = $"QA -> PM :{_userInfo.RealName} has anonymized {study.StudyCode} ,Forward can be performed!!",
|
|
||||||
// Message = $"QA -> QA :{_userInfo.RealName} has anonymized {study.StudyCode} ,Forward can be performed!!",
|
|
||||||
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
|
|
||||||
// };
|
|
||||||
|
|
||||||
// //notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// //{
|
|
||||||
// // QANoticeId = notice.Id,
|
|
||||||
// // StudyId = study.Id,
|
|
||||||
// // ToUser = pm.UserRealName,
|
|
||||||
// // ToUserId = pm.UserId,
|
|
||||||
// // ToUserType = pm.UserType
|
|
||||||
// //});
|
|
||||||
|
|
||||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
|
||||||
// {
|
|
||||||
// QANoticeId = notice.Id,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
|
||||||
// ToUserId = t.UserId,
|
|
||||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
|
||||||
// }));
|
|
||||||
|
|
||||||
// _qaNoticeRepository.Add(notice);
|
|
||||||
|
|
||||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
|
||||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal && (t.NoticeTypeEnum == NoticeType.QA_QAPass_NoticeQA)).ToList();
|
|
||||||
|
|
||||||
// needDealNoticeList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
// }
|
|
||||||
|
|
||||||
// else if (invocation.Method.Name == "ForwardStudy")
|
|
||||||
// {
|
|
||||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
|
||||||
|
|
||||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
|
||||||
|
|
||||||
// //匿名化操作产生的消息 设置为已经处理
|
|
||||||
// _qaNoticeRepository.Add(new QANotice()
|
|
||||||
// {
|
|
||||||
// TrialId = study.TrialId,
|
|
||||||
// SubjectVisitId = study.Id,
|
|
||||||
// //FromUser = currentQA.UserRealName,
|
|
||||||
// //FromUserId = _userInfo.Id,
|
|
||||||
// //FromUserType = currentQA.UserType,
|
|
||||||
// FromUser = _userInfo.RealName,
|
|
||||||
// FromUserId = _userInfo.Id,
|
|
||||||
// FromUserType = _userInfo.UserTypeShortName,
|
|
||||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
|
||||||
// NeedDeal = false,
|
|
||||||
// StudyStatusStr = "Forwarded",
|
|
||||||
// //Message = $"PM :{_userInfo.RealName} has forwarded {study.StudyCode} !",
|
|
||||||
// Message = $"QA :{_userInfo.RealName} has forwarded {study.StudyCode} !",
|
|
||||||
// SendTime = DateTime.Now,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// var needDealList = _qaNoticeRepository.Where(t =>
|
|
||||||
// t.SubjectVisitId == study.Id && t.NeedDeal && t.NoticeTypeEnum == NoticeType.QA_Anonymized_NoticeQA).ToList();
|
|
||||||
|
|
||||||
// needDealList.ForEach(t =>
|
|
||||||
// {
|
|
||||||
// t.NeedDeal = false;
|
|
||||||
// t.DealTime = DateTime.Now;
|
|
||||||
// _qaNoticeRepository.Update(t);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var success = _qaNoticeRepository.SaveChanges();
|
|
||||||
|
|
||||||
// if (!success)
|
|
||||||
// {
|
|
||||||
// throw new Exception("Send QA message failed");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
using Castle.DynamicProxy;
|
|
||||||
using EasyCaching.Core;
|
|
||||||
using IRaCIS.Application.Contracts;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.AOP
|
|
||||||
{
|
|
||||||
public class TrialStatusAutofacAOP : IAsyncInterceptor
|
|
||||||
{
|
|
||||||
private readonly IEasyCachingProvider _provider;
|
|
||||||
|
|
||||||
public TrialStatusAutofacAOP(IEasyCachingProvider provider)
|
|
||||||
{
|
|
||||||
_provider = provider;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void InterceptAsynchronous(IInvocation invocation)
|
|
||||||
{
|
|
||||||
invocation.Proceed();
|
|
||||||
}
|
|
||||||
|
|
||||||
//这里AOP 处理两个方法 分别是 项目的添加和更新、项目状态的变更
|
|
||||||
|
|
||||||
public void InterceptAsynchronous<TResult>(IInvocation invocation)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//处理拦截的方法
|
|
||||||
invocation.Proceed();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dynamic result = invocation.ReturnValue;
|
|
||||||
|
|
||||||
//接口成功了,才修改缓存
|
|
||||||
if (!result.IsSuccess)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 处理项目列表的查询 在前端界面已经在某个界面,但是服务器重置了,此时没有缓存项目信息,接口不能正确返回,因故采用,启动时查询,每天查询一次,缓存一天,然后项目添加、更改状态时,及时更新
|
|
||||||
|
|
||||||
//if (invocation.Method.Name == "GetTrialList")
|
|
||||||
//{
|
|
||||||
// //在此 将当前查询的项目Id 和对应的项目状态进行缓存
|
|
||||||
// dynamic result = invocation.ReturnValue;
|
|
||||||
// foreach (var item in result.CurrentPageData)
|
|
||||||
// {
|
|
||||||
// _provider.Remove(item.Id.ToString());
|
|
||||||
// _provider.Set(item.Id.ToString(), item.TrialStatusStr.ToString(), TimeSpan.FromDays(1));
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
if (invocation.Method.Name == "AddOrUpdateTrial")
|
|
||||||
{
|
|
||||||
//如果是添加 那么将对应的初始状态加进去 更新状态是单独操作的
|
|
||||||
|
|
||||||
var trialModel = (invocation.Arguments[0] as TrialCommand).IfNullThrowConvertException();
|
|
||||||
if (trialModel.Id == null || trialModel.Id == Guid.Empty)
|
|
||||||
{
|
|
||||||
_provider.Set(result.Data.Id.ToString(), StaticData.TrialState.TrialOngoing, TimeSpan.FromDays(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// 更新缓存
|
|
||||||
else if (invocation.Method.Name == "UpdateTrialStatus")
|
|
||||||
{
|
|
||||||
//项目状态更新,也需要及时更新
|
|
||||||
_provider.Set(invocation.Arguments[0].ToString(), invocation.Arguments[1].ToString(), TimeSpan.FromDays(1));
|
|
||||||
|
|
||||||
////Test参数是否符合要求
|
|
||||||
//var tt = invocation.Arguments[0].ToString();
|
|
||||||
//var cc = _provider.Get<string>(invocation.Arguments[0].ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InterceptSynchronous(IInvocation invocation)
|
|
||||||
{
|
|
||||||
invocation.Proceed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
//using System.Diagnostics;
|
|
||||||
//using IRaCIS.Application.Interfaces;
|
|
||||||
//using IRaCIS.Application.Contracts;
|
|
||||||
//using IRaCIS.Core.Infra.EFCore;
|
|
||||||
//using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
//using Microsoft.AspNetCore.Mvc;
|
|
||||||
//using Microsoft.AspNetCore.Mvc.Filters;
|
|
||||||
//using Microsoft.Extensions.Logging;
|
|
||||||
//using Newtonsoft.Json;
|
|
||||||
|
|
||||||
//namespace IRaCIS.Core.Application.Filter
|
|
||||||
//{
|
|
||||||
|
|
||||||
// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
|
|
||||||
// public class LogFilter : Attribute
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
// public class LogActionFilter : IAsyncActionFilter
|
|
||||||
// {
|
|
||||||
// private readonly ILogService _logService;
|
|
||||||
// private readonly IUserInfo _userInfo;
|
|
||||||
// private readonly ILogger<LogActionFilter> _logger;
|
|
||||||
|
|
||||||
// public LogActionFilter(ILogService logService, IUserInfo userInfo , ILogger<LogActionFilter> logger)
|
|
||||||
// {
|
|
||||||
// _logService = logService;
|
|
||||||
// _userInfo = userInfo;
|
|
||||||
// _logger = logger;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// if (context.ActionDescriptor.EndpointMetadata!=null&& context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(LogFilter)))
|
|
||||||
// {
|
|
||||||
// return LogAsync(context, next);
|
|
||||||
// }
|
|
||||||
// return next();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public async Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
|
||||||
// {
|
|
||||||
// var sw = new Stopwatch();
|
|
||||||
// sw.Start();
|
|
||||||
|
|
||||||
// dynamic actionResult = (await next()).Result;
|
|
||||||
// sw.Stop();
|
|
||||||
// var args = JsonConvert.SerializeObject(context.ActionArguments);
|
|
||||||
// var result = JsonConvert.SerializeObject(actionResult?.Value);
|
|
||||||
|
|
||||||
// var attr = (ApiExplorerSettingsAttribute)context.ActionDescriptor.EndpointMetadata.FirstOrDefault(m => m.GetType() == typeof(ApiExplorerSettingsAttribute));
|
|
||||||
// var groupName = attr?.GroupName;
|
|
||||||
// var res = actionResult?.Value as IResponseOutput;
|
|
||||||
// var input = new SystemLogDTO
|
|
||||||
// {
|
|
||||||
// ClientIP = string.Empty,
|
|
||||||
// OptUserId = _userInfo.Id,
|
|
||||||
// OptUserName = _userInfo.UserName,
|
|
||||||
// ApiPath = context.ActionDescriptor.AttributeRouteInfo.Template.ToLower(),
|
|
||||||
// Params = args,
|
|
||||||
// Result = result,
|
|
||||||
// RequestTime = DateTime.Now,
|
|
||||||
// ElapsedMilliseconds = sw.ElapsedMilliseconds,
|
|
||||||
// Status =res?.IsSuccess?? false,
|
|
||||||
// Message = res?.ErrorMessage,
|
|
||||||
// LogCategory = groupName
|
|
||||||
// };
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _logService.SaveLog2Db(input);
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// _logger.LogError(ex.Message);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -32,8 +32,10 @@ namespace IRaCIS.Core.Application.Filter
|
|||||||
|
|
||||||
if (context.Exception.GetType() == typeof(BusinessValidationFailedException))
|
if (context.Exception.GetType() == typeof(BusinessValidationFailedException))
|
||||||
{
|
{
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message,ApiResponseCodeEnum.BusinessValidationFailed));
|
var error = context.Exception as BusinessValidationFailedException;
|
||||||
}
|
|
||||||
|
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message, error!.Code));
|
||||||
|
}
|
||||||
else if(context.Exception.GetType() == typeof(QueryBusinessObjectNotExistException))
|
else if(context.Exception.GetType() == typeof(QueryBusinessObjectNotExistException))
|
||||||
{
|
{
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk( context.Exception.Message, ApiResponseCodeEnum.DataNotExist));
|
context.Result = new JsonResult(ResponseOutput.NotOk( context.Exception.Message, ApiResponseCodeEnum.DataNotExist));
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,9 +12,11 @@ using MiniExcelLibs;
|
|||||||
using MiniExcelLibs.OpenXml;
|
using MiniExcelLibs.OpenXml;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using NPOI.HPSF;
|
||||||
using NPOI.HSSF.UserModel;
|
using NPOI.HSSF.UserModel;
|
||||||
using NPOI.XSSF.UserModel;
|
using NPOI.XSSF.UserModel;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
using System.Collections;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service;
|
namespace IRaCIS.Core.Application.Service;
|
||||||
@@ -51,20 +53,24 @@ public static class ExcelExportHelper
|
|||||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||||
|
|
||||||
|
|
||||||
var dic = JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull());
|
var dic = data.ConvertToDictionary();
|
||||||
|
|
||||||
|
|
||||||
foreach (var key in dic.Keys)
|
foreach (var key in dic.Keys)
|
||||||
{
|
{
|
||||||
//是数组 那么找到对应的属性 进行翻译
|
//是数组 那么找到对应的属性 进行翻译
|
||||||
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||||
{
|
{
|
||||||
|
|
||||||
var newObjList = new List<object>();
|
var newObjList = new List<object>();
|
||||||
var no = 1;
|
var no = 1;
|
||||||
|
|
||||||
foreach (var item in dic[key] as JArray)
|
foreach (var item in dic[key] as IList )
|
||||||
{
|
{
|
||||||
var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||||
|
|
||||||
|
var itemDic = item.ConvertToDictionary();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||||
@@ -72,7 +78,7 @@ public static class ExcelExportHelper
|
|||||||
//翻译的属性依赖其他属性
|
//翻译的属性依赖其他属性
|
||||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||||
{
|
{
|
||||||
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||||
{
|
{
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
@@ -145,8 +151,12 @@ public static class ExcelExportHelper
|
|||||||
workbook.RemoveSheetAt(1);
|
workbook.RemoveSheetAt(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FileStream fileOut = new FileStream("resultTemplate", FileMode.Create, FileAccess.ReadWrite);
|
||||||
|
workbook.Write(fileOut);
|
||||||
|
|
||||||
var memoryStream2 = new MemoryStream();
|
var memoryStream2 = new MemoryStream();
|
||||||
workbook.Write(memoryStream2);
|
workbook.Write(memoryStream2,true);
|
||||||
|
|
||||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
@@ -226,29 +236,30 @@ public static class ExcelExportHelper
|
|||||||
|
|
||||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||||
|
|
||||||
|
var dic = data.ConvertToDictionary();
|
||||||
var dic = JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull());
|
//var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
|
||||||
|
|
||||||
foreach (var key in dic.Keys)
|
foreach (var key in dic.Keys)
|
||||||
{
|
{
|
||||||
//是数组 那么找到对应的属性 进行翻译
|
//是数组 那么找到对应的属性 进行翻译
|
||||||
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||||
|
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||||
{
|
{
|
||||||
|
|
||||||
var newObjList = new List<object>();
|
var newObjList = new List<object>();
|
||||||
var no = 1;
|
var no = 1;
|
||||||
|
foreach (var item in dic[key] as IList)
|
||||||
foreach (var item in dic[key] as JArray)
|
//foreach (var item in dic[key] as JArray)
|
||||||
{
|
{
|
||||||
var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||||
|
var itemDic = item.ConvertToDictionary();
|
||||||
|
|
||||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||||
{
|
{
|
||||||
//翻译的属性依赖其他属性
|
//翻译的属性依赖其他属性
|
||||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||||
{
|
{
|
||||||
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||||
{
|
{
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
@@ -316,7 +327,7 @@ public static class ExcelExportHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
var memoryStream2 = new MemoryStream();
|
var memoryStream2 = new MemoryStream();
|
||||||
workbook.Write(memoryStream2);
|
workbook.Write(memoryStream2,true);
|
||||||
|
|
||||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Helper
|
||||||
|
{
|
||||||
|
public class FileConvertHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
static public void ConvertWordToPdf(string inputWordFilePath, string outputPdfDir)
|
||||||
|
{
|
||||||
|
// 设置 libreoffice 命令行参数
|
||||||
|
string arguments = $"--headless --invisible --convert-to pdf \"{inputWordFilePath}\" --outdir \"{outputPdfDir}\"";
|
||||||
|
|
||||||
|
// 启动 libreoffice 进程
|
||||||
|
using (Process process = new Process())
|
||||||
|
{
|
||||||
|
process.StartInfo.FileName = "libreoffice";
|
||||||
|
process.StartInfo.Arguments = arguments;
|
||||||
|
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||||
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
|
process.StartInfo.RedirectStandardError = true;
|
||||||
|
process.StartInfo.UseShellExecute = false;
|
||||||
|
process.StartInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
|
process.Start();
|
||||||
|
|
||||||
|
// 等待进程结束
|
||||||
|
process.WaitForExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -142,8 +142,9 @@ public static class FileStoreHelper
|
|||||||
//API vue 部署目录
|
//API vue 部署目录
|
||||||
public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment)
|
public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment)
|
||||||
{
|
{
|
||||||
var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName;
|
string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, ".."));
|
||||||
return rootPath;
|
|
||||||
|
return parentDirectory;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +164,7 @@ public static class FileStoreHelper
|
|||||||
{
|
{
|
||||||
var rootPath = GetIRaCISRootPath(_hostEnvironment);
|
var rootPath = GetIRaCISRootPath(_hostEnvironment);
|
||||||
|
|
||||||
var physicalFilePath = Path.Combine(rootPath, relativePath.Trim('/'));
|
var physicalFilePath = Path.Combine(rootPath, relativePath.TrimStart('/'));
|
||||||
|
|
||||||
return physicalFilePath;
|
return physicalFilePath;
|
||||||
}
|
}
|
||||||
@@ -539,7 +540,6 @@ public static class FileStoreHelper
|
|||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
/// <param name="siteid"></param>
|
/// <param name="siteid"></param>
|
||||||
/// <param name="subjectId"></param>
|
/// <param name="subjectId"></param>
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetUploadPrintscreenFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteid, Guid subjectId)
|
public static (string PhysicalPath, string RelativePath, string FileRealName) GetUploadPrintscreenFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteid, Guid subjectId)
|
||||||
{
|
{
|
||||||
@@ -686,7 +686,7 @@ public static class FileStoreHelper
|
|||||||
|
|
||||||
var json = File.ReadAllText( Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json"));
|
var json = File.ReadAllText( Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json"));
|
||||||
|
|
||||||
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
JObject jsonObject = (JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load })).IfNullThrowException();
|
||||||
|
|
||||||
int switchingRatio = 80;
|
int switchingRatio = 80;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,346 @@
|
|||||||
|
using Aliyun.OSS;
|
||||||
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Minio.DataModel.Args;
|
||||||
|
using Minio;
|
||||||
|
using NPOI.HPSF;
|
||||||
|
using SharpCompress.Common;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.AccessControl;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Helper
|
||||||
|
{
|
||||||
|
public class MinIOOptions : AWSOptions
|
||||||
|
{
|
||||||
|
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 class AliyunOSSOptions
|
||||||
|
{
|
||||||
|
public string regionId { get; set; }
|
||||||
|
public string accessKeyId { get; set; }
|
||||||
|
public string accessKeySecret { get; set; }
|
||||||
|
public string endPoint { get; set; }
|
||||||
|
public string bucketName { get; set; }
|
||||||
|
|
||||||
|
public string roleArn { 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; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ObjectStoreDTO
|
||||||
|
{
|
||||||
|
public string ObjectStoreUse { get; set; }
|
||||||
|
|
||||||
|
public AliyunOSSOptions AliyunOSS { get; set; }
|
||||||
|
|
||||||
|
public MinIOOptions MinIO { get; set; }
|
||||||
|
|
||||||
|
public AWSOptions AWS { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AliyunOSSTempToken
|
||||||
|
{
|
||||||
|
public string AccessKeyId { get; set; }
|
||||||
|
public string AccessKeySecret { 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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public enum ObjectStoreUse
|
||||||
|
{
|
||||||
|
AliyunOSS = 0,
|
||||||
|
MinIO = 1,
|
||||||
|
AWS = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IOSSService
|
||||||
|
{
|
||||||
|
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName);
|
||||||
|
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath);
|
||||||
|
|
||||||
|
public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath);
|
||||||
|
|
||||||
|
public ObjectStoreServiceOptions ObjectStoreServiceOptions { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class OSSService : IOSSService
|
||||||
|
{
|
||||||
|
public ObjectStoreServiceOptions ObjectStoreServiceOptions { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
|
{
|
||||||
|
ObjectStoreServiceOptions = options.CurrentValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileStream"></param>
|
||||||
|
/// <param name="oosFolderPath"></param>
|
||||||
|
/// <param name="fileRealName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
|
||||||
|
//var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||||
|
|
||||||
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
fileStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
fileStream.CopyTo(memoryStream);
|
||||||
|
|
||||||
|
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, memoryStream);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var putObjectArgs = new PutObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithStreamData(memoryStream)
|
||||||
|
.WithObjectSize(memoryStream.Length);
|
||||||
|
|
||||||
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var putObjectArgs = new PutObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithStreamData(memoryStream)
|
||||||
|
.WithObjectSize(memoryStream.Length);
|
||||||
|
|
||||||
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return "/" + ossRelativePath;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="localFilePath"></param>
|
||||||
|
/// <param name="oosFolderPath"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath)
|
||||||
|
{
|
||||||
|
var localFileName = Path.GetFileName(localFilePath);
|
||||||
|
|
||||||
|
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}";
|
||||||
|
|
||||||
|
//var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, localFilePath);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var putObjectArgs = new PutObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithFileName(localFilePath);
|
||||||
|
|
||||||
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var putObjectArgs = new PutObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithFileName(localFilePath);
|
||||||
|
|
||||||
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
|
}
|
||||||
|
return "/" + ossRelativePath;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath)
|
||||||
|
{
|
||||||
|
|
||||||
|
ossRelativePath = ossRelativePath.TrimStart('/');
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
var result = _ossClient.GetObject(aliConfig.bucketName, ossRelativePath);
|
||||||
|
|
||||||
|
// 将下载的文件流保存到本地文件
|
||||||
|
using (var fs = File.OpenWrite(localFilePath))
|
||||||
|
{
|
||||||
|
result.Content.CopyTo(fs);
|
||||||
|
fs.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}:{minIOConfig.port}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var getObjectArgs = new GetObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithFile(localFilePath);
|
||||||
|
|
||||||
|
await minioClient.GetObjectAsync(getObjectArgs);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.endPoint}")
|
||||||
|
.WithCredentials(minIOConfig.accessKey, minIOConfig.secretKey).WithSSL(minIOConfig.useSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var getObjectArgs = new GetObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.bucketName)
|
||||||
|
.WithObject(ossRelativePath)
|
||||||
|
.WithFile(localFilePath);
|
||||||
|
|
||||||
|
await minioClient.GetObjectAsync(getObjectArgs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException("oss下载失败!" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ public static class SendEmailHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception )
|
||||||
{
|
{
|
||||||
|
|
||||||
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
<PackageReference Include="fo-dicom.Codecs" Version="5.10.8" />
|
<PackageReference Include="fo-dicom.Codecs" Version="5.10.8" />
|
||||||
<PackageReference Include="FreeSpire.Doc" Version="11.6.0" />
|
<PackageReference Include="FreeSpire.Doc" Version="11.6.0" />
|
||||||
<PackageReference Include="Hangfire.Core" Version="1.8.5" />
|
<PackageReference Include="Hangfire.Core" Version="1.8.5" />
|
||||||
|
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||||
<PackageReference Include="Magicodes.IE.Core" Version="2.7.4.5" />
|
<PackageReference Include="Magicodes.IE.Core" Version="2.7.4.5" />
|
||||||
<PackageReference Include="Magicodes.IE.Csv" Version="2.7.4.5">
|
<PackageReference Include="Magicodes.IE.Csv" Version="2.7.4.5">
|
||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
@@ -89,6 +90,7 @@
|
|||||||
<PackageReference Include="MediatR" Version="12.1.1" />
|
<PackageReference Include="MediatR" Version="12.1.1" />
|
||||||
<PackageReference Include="MimeKit" Version="4.2.0" />
|
<PackageReference Include="MimeKit" Version="4.2.0" />
|
||||||
<PackageReference Include="MiniExcel" Version="1.31.2" />
|
<PackageReference Include="MiniExcel" Version="1.31.2" />
|
||||||
|
<PackageReference Include="Minio" Version="6.0.1" />
|
||||||
<PackageReference Include="MiniWord" Version="0.7.0" />
|
<PackageReference Include="MiniWord" Version="0.7.0" />
|
||||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.0.0">
|
<PackageReference Include="My.Extensions.Localization.Json" Version="3.0.0">
|
||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
@@ -106,4 +108,10 @@
|
|||||||
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="Resources\ip2region.xdb">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
<param name="trialId"></param>
|
<param name="trialId"></param>
|
||||||
<param name="siteid"></param>
|
<param name="siteid"></param>
|
||||||
<param name="subjectId"></param>
|
<param name="subjectId"></param>
|
||||||
<param name="type"></param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Helper.FileStoreHelper.GetFilePath(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,System.String,System.Guid,System.Guid,System.String)">
|
<member name="M:IRaCIS.Core.Application.Helper.FileStoreHelper.GetFilePath(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,System.String,System.Guid,System.Guid,System.String)">
|
||||||
@@ -95,17 +94,29 @@
|
|||||||
<param name="type"></param>
|
<param name="type"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
|
</summary>
|
||||||
|
<param name="fileStream"></param>
|
||||||
|
<param name="oosFolderPath"></param>
|
||||||
|
<param name="fileRealName"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
|
</summary>
|
||||||
|
<param name="localFilePath"></param>
|
||||||
|
<param name="oosFolderPath"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.TaskMedicalReviewRuleService">
|
<member name="T:IRaCIS.Core.Application.Service.TaskMedicalReviewRuleService">
|
||||||
<summary>
|
<summary>
|
||||||
医学审核生成规则 废弃
|
医学审核生成规则 废弃
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.TaskMedicalReviewRuleService.GenerateMedicalReviewTask(IRaCIS.Core.Application.ViewModel.GenerateMedicalReviewTaskCommand)">
|
|
||||||
<summary>
|
|
||||||
产生医学审核
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.TaskMedicalReviewService">
|
<member name="T:IRaCIS.Core.Application.Service.TaskMedicalReviewService">
|
||||||
<summary>
|
<summary>
|
||||||
任务医学审核
|
任务医学审核
|
||||||
@@ -281,6 +292,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="origenalTask"></param>
|
<param name="origenalTask"></param>
|
||||||
<param name="agreeReReadingCommand"></param>
|
<param name="agreeReReadingCommand"></param>
|
||||||
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetReReadingOrBackInfluenceAnalysisAsync(System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetReReadingOrBackInfluenceAnalysisAsync(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
@@ -490,7 +502,6 @@
|
|||||||
<param name="_commonDocumentRepository"></param>
|
<param name="_commonDocumentRepository"></param>
|
||||||
<param name="_dictionaryService"></param>
|
<param name="_dictionaryService"></param>
|
||||||
<param name="_trialRepository"></param>
|
<param name="_trialRepository"></param>
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
|
||||||
@@ -536,6 +547,32 @@
|
|||||||
InternationalizationService
|
InternationalizationService
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.GetFrontInternationalizationList">
|
||||||
|
<summary>
|
||||||
|
前端国际化内容接口
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.BatchAddOrUpdateFrontInternationalization(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.BatchInternationalizationDto})">
|
||||||
|
<summary>
|
||||||
|
前端批量提交,后端判断不存在就添加,存在就更新
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.BatchAddInternationalization(IRaCIS.Core.Application.ViewModel.BatchAddInternationalization)">
|
||||||
|
<summary>
|
||||||
|
后端之前批量添加接口
|
||||||
|
</summary>
|
||||||
|
<param name="batchAdd"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.AddOrUpdateInternationalization(IRaCIS.Core.Application.ViewModel.InternationalizationAddOrEdit)">
|
||||||
|
<summary>
|
||||||
|
前后端添加的时候,区分了,前端判断重复多了多了一个路由 路由+标识唯一
|
||||||
|
</summary>
|
||||||
|
<param name="addOrEditInternationalization"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.PublishLogService">
|
<member name="T:IRaCIS.Core.Application.Service.PublishLogService">
|
||||||
<summary>
|
<summary>
|
||||||
PublishLogService
|
PublishLogService
|
||||||
@@ -937,10 +974,11 @@
|
|||||||
<summary>
|
<summary>
|
||||||
翻译稽查数据
|
翻译稽查数据
|
||||||
</summary>
|
</summary>
|
||||||
<param name="dto">传入Dto</param>
|
<param name="dto"></param>
|
||||||
|
<param name="currentInspectionId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetDataInspectionDateType(System.Collections.Generic.List{System.String},System.String)">
|
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetDataInspectionDateType(System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
格式化日期和时间
|
格式化日期和时间
|
||||||
</summary>
|
</summary>
|
||||||
@@ -948,7 +986,7 @@
|
|||||||
<param name="jsonStr"></param>
|
<param name="jsonStr"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetInspectionEnumValue(System.Collections.Generic.List{System.String},System.String)">
|
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetInspectionEnumValue(System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
获取外键表数据
|
获取外键表数据
|
||||||
</summary>
|
</summary>
|
||||||
@@ -956,7 +994,7 @@
|
|||||||
<param name="jsonStr"></param>
|
<param name="jsonStr"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetEnum(System.Guid,System.Collections.Generic.List{System.String},System.String)">
|
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetEnum(System.Guid,System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
获取枚举
|
获取枚举
|
||||||
</summary>
|
</summary>
|
||||||
@@ -1131,7 +1169,6 @@
|
|||||||
<summary>
|
<summary>
|
||||||
获取阅片报告
|
获取阅片报告
|
||||||
</summary>
|
</summary>
|
||||||
<param name="indto"></param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.ReadingCalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.ReadingCalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
|
||||||
@@ -2468,6 +2505,8 @@
|
|||||||
<param name="item"></param>
|
<param name="item"></param>
|
||||||
<param name="questions"></param>
|
<param name="questions"></param>
|
||||||
<param name="tableQuestions"></param>
|
<param name="tableQuestions"></param>
|
||||||
|
<param name="answers"></param>
|
||||||
|
<param name="tableAnswers"></param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ClinicalQuestionService.GetTrialClinicalQuestionList(IRaCIS.Core.Application.Service.Reading.Dto.TrialClinicalQuestionQuery)">
|
<member name="M:IRaCIS.Core.Application.Service.ClinicalQuestionService.GetTrialClinicalQuestionList(IRaCIS.Core.Application.Service.Reading.Dto.TrialClinicalQuestionQuery)">
|
||||||
<summary>
|
<summary>
|
||||||
@@ -4482,6 +4521,11 @@
|
|||||||
是否是第一次转化的任务
|
是否是第一次转化的任务
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetRelatedVisitTaskOutDto.IsExistsClinicalData">
|
||||||
|
<summary>
|
||||||
|
是否存在临床数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetGlobalReadingInfoInDto.UsingOriginalData">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetGlobalReadingInfoInDto.UsingOriginalData">
|
||||||
<summary>
|
<summary>
|
||||||
当新答案为空的时候 是否是有原数据
|
当新答案为空的时候 是否是有原数据
|
||||||
@@ -5872,6 +5916,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -5950,6 +5999,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemAddOrEdit.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemAddOrEdit.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemAddOrEdit.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -6293,6 +6347,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -6343,6 +6402,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionSystemView.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionSystemView.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionSystemView.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -6678,6 +6742,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionSystemInDto.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionSystemInDto.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionSystemInDto.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -7003,6 +7072,11 @@
|
|||||||
限制编辑
|
限制编辑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.LimitShow">
|
||||||
|
<summary>
|
||||||
|
限制显示
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.MaxAnswerLength">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.MaxAnswerLength">
|
||||||
<summary>
|
<summary>
|
||||||
最大答案长度
|
最大答案长度
|
||||||
@@ -10689,6 +10763,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageClinicalDataToBeConfirmList(IRaCIS.Core.Application.Contracts.ImageClinicalDataToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageClinicalDataToBeConfirmList(IRaCIS.Core.Application.Contracts.ImageClinicalDataToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
@@ -10697,6 +10772,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetCRCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetCRCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
@@ -10714,6 +10790,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageReUploadToBeDoneList(IRaCIS.Core.Application.Contracts.ImageReUploadToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageReUploadToBeDoneList(IRaCIS.Core.Application.Contracts.ImageReUploadToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
@@ -10722,14 +10799,16 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageSubmittedToBeDoneList(IRaCIS.Core.Application.Contracts.ImageSubmittedToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageSubmittedToBeDoneList(IRaCIS.Core.Application.Contracts.ImageSubmittedToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
<summary>
|
<summary>
|
||||||
加急影像提交 --CRC 待办
|
加急影像提交 --CRC 待办
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageQualityToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQualityToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageQualityToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQualityToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
@@ -10738,14 +10817,16 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetQCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetQCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
<summary>
|
<summary>
|
||||||
QC 质疑
|
QC 质疑
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectVisitRepository"></param>
|
<param name="_subjectVisitRepository"></param>
|
||||||
|
<param name="_trialRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetIRImageReadingToBeDoneList(IRaCIS.Core.Application.Contracts.IRImageReadingToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetIRImageReadingToBeDoneList(IRaCIS.Core.Application.Contracts.IRImageReadingToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||||
@@ -10763,6 +10844,7 @@
|
|||||||
IR医学反馈
|
IR医学反馈
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
|
<param name="_taskMedicalReviewRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetMIMMedicalCommentsToBeDoneList(IRaCIS.Core.Application.Contracts.MedicalCommentsToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview})">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetMIMMedicalCommentsToBeDoneList(IRaCIS.Core.Application.Contracts.MedicalCommentsToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview})">
|
||||||
@@ -10771,6 +10853,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_taskMedicalReviewRepository"></param>
|
<param name="_taskMedicalReviewRepository"></param>
|
||||||
|
<param name="_trialReadingCriterionRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetMedicalCommentsFirstToBeDone(IRaCIS.Core.Application.Contracts.MedicalCommentsFirstToBeDoneQuery,IRaCIS.Core.Application.Interfaces.ITaskMedicalReviewService)">
|
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetMedicalCommentsFirstToBeDone(IRaCIS.Core.Application.Contracts.MedicalCommentsFirstToBeDoneQuery,IRaCIS.Core.Application.Interfaces.ITaskMedicalReviewService)">
|
||||||
@@ -11019,7 +11102,7 @@
|
|||||||
构造函数注入
|
构造函数注入
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.MediatR.Handlers.ConsistencyVerificationHandler.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Domain.Share.IUserInfo,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},AutoMapper.IMapper)">
|
<member name="M:IRaCIS.Core.Application.MediatR.Handlers.ConsistencyVerificationHandler.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Domain.Share.IUserInfo,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},AutoMapper.IMapper,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
构造函数注入
|
构造函数注入
|
||||||
</summary>
|
</summary>
|
||||||
@@ -11556,7 +11639,6 @@
|
|||||||
<summary>
|
<summary>
|
||||||
新增修改系统表格问题
|
新增修改系统表格问题
|
||||||
</summary>
|
</summary>
|
||||||
<param name="addOrEditReadingTableQuestionSystem"></param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.DeleteReadingTableQuestionSystem(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.DeleteReadingTableQuestionSystem(System.Guid)">
|
||||||
@@ -11581,11 +11663,12 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.VerifyCalculateRelation(System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.CalculateRelationDto},System.Guid,System.Guid,System.Int32)">
|
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.VerifyCalculateRelation(System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.CalculateRelationDto},System.Guid,System.Guid,System.Int32)">
|
||||||
<summary>
|
<summary>
|
||||||
验证计算关系
|
验证计算关系
|
||||||
</summary>
|
</summary>
|
||||||
<param name="relationList"></param>
|
<param name="relationList"></param>
|
||||||
<param name="QuestionId"></param>
|
<param name="QuestionId"></param>
|
||||||
<param name="originalId"></param>
|
<param name="originalId"></param>
|
||||||
|
<param name="count"></param>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.GetQuestionCalculateRelation(IRaCIS.Core.Application.Service.Reading.Dto.GetQuestionCalculateRelationInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.GetQuestionCalculateRelation(IRaCIS.Core.Application.Service.Reading.Dto.GetQuestionCalculateRelationInDto)">
|
||||||
@@ -11851,6 +11934,8 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="trialReadingCriterionId"></param>
|
<param name="trialReadingCriterionId"></param>
|
||||||
<param name="visitTaskId"></param>
|
<param name="visitTaskId"></param>
|
||||||
|
<param name="questionClassify"></param>
|
||||||
|
<param name="groupClassifyList"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
||||||
@@ -11893,11 +11978,18 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FindChildQuestion(IRaCIS.Core.Application.Service.Reading.Dto.TrialReadQuestionData,System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TrialReadQuestionData},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionTrial},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionAnswerInfo},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TableAnsweRowInfo},System.Collections.Generic.List{IRaCIS.Core.Domain.Models.OrganInfo},System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},System.Boolean,System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},System.Nullable{System.Guid})">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FindChildQuestion(IRaCIS.Core.Application.Service.Reading.Dto.TrialReadQuestionData,System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TrialReadQuestionData},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionTrial},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionAnswerInfo},System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.TableAnsweRowInfo},System.Collections.Generic.List{IRaCIS.Core.Domain.Models.OrganInfo},System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},System.Boolean,System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},System.Nullable{System.Guid})">
|
||||||
<summary>
|
<summary>
|
||||||
获取子元素
|
获取子元素
|
||||||
</summary>
|
</summary>
|
||||||
<param name="item"></param>
|
<param name="item"></param>
|
||||||
<param name="questionlists"></param>
|
<param name="questionlists"></param>
|
||||||
<param name="tableQuestionLists"></param>
|
<param name="tableQuestionLists"></param>
|
||||||
|
<param name="tableAnswers"></param>
|
||||||
|
<param name="tableAnsweRowInfos"></param>
|
||||||
|
<param name="organInfos"></param>
|
||||||
|
<param name="baseLineTableAnswer"></param>
|
||||||
|
<param name="isFirstChangeTask"></param>
|
||||||
|
<param name="lastTaskTableAnswer"></param>
|
||||||
|
<param name="TaskId"></param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SplitLesion(IRaCIS.Core.Application.Service.Reading.Dto.SplitLesionInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SplitLesion(IRaCIS.Core.Application.Service.Reading.Dto.SplitLesionInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
@@ -12382,6 +12474,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.TestService.OldLocalImageResizeJpg(IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
|
||||||
|
<summary>
|
||||||
|
维护OSS 影像数据
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Application.Contracts.DoctorSearchDTO">
|
<member name="T:IRaCIS.Application.Contracts.DoctorSearchDTO">
|
||||||
<summary>
|
<summary>
|
||||||
Reviewer 列表查询参数
|
Reviewer 列表查询参数
|
||||||
|
|||||||
Binary file not shown.
@@ -56,9 +56,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
|
|
||||||
|
|
||||||
public Guid SiteId { get; set; }
|
public Guid SiteId { get; set; }
|
||||||
|
|
||||||
|
public string BlindTrialSiteCode { get; set; }
|
||||||
public String TrialSiteCode { get; set; } = String.Empty;
|
public String TrialSiteCode { get; set; } = String.Empty;
|
||||||
public string SubjectCode { get; set; } = String.Empty;
|
public string SubjectCode { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string MedicalNo { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string BlindSubjectCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool IsPMSetBack { get; set; }
|
public bool IsPMSetBack { get; set; }
|
||||||
|
|
||||||
|
|
||||||
@@ -358,7 +364,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
|
||||||
|
public Guid? SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
public string? SubjectCode { get; set; } = null;
|
public string? SubjectCode { get; set; } = null;
|
||||||
|
|
||||||
@@ -431,6 +440,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
public DateTime? LatestReplyTimeBegin { get; set; }
|
public DateTime? LatestReplyTimeBegin { get; set; }
|
||||||
public DateTime? LatestReplyTimeEnd { get; set; }
|
public DateTime? LatestReplyTimeEnd { get; set; }
|
||||||
|
|
||||||
|
public string? RequestReReadingReason { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PIAuditTaskEnrollOrPdCommand
|
public class PIAuditTaskEnrollOrPdCommand
|
||||||
|
|||||||
@@ -78,120 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 产生医学审核
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[Obsolete]
|
|
||||||
public async Task<IResponseOutput> GenerateMedicalReviewTask(GenerateMedicalReviewTaskCommand generateCommand)
|
|
||||||
{
|
|
||||||
var trialId = generateCommand.TrialId;
|
|
||||||
|
|
||||||
//var mimUserList = await _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Guid? defalutMIMUserId = null /*mimUserList.FirstOrDefault()?.UserId*/;
|
|
||||||
|
|
||||||
//获取当前医生数据 已经生成的,和配置的数量
|
|
||||||
var taskTaskMedicalReviewRuleList = await _taskMedicalReviewRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider).ToListAsync();
|
|
||||||
|
|
||||||
foreach (var item in taskTaskMedicalReviewRuleList)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (item.IsEnable)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (item.PlanGlobalCount > item.GeneratedGlobalCount)
|
|
||||||
{
|
|
||||||
var needGenerateCount = item.PlanGlobalCount - item.GeneratedGlobalCount;
|
|
||||||
|
|
||||||
var canGenerateCount = item.ActualGlobalCount - item.GeneratedGlobalCount;
|
|
||||||
|
|
||||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
|
||||||
|
|
||||||
//分配给MIM
|
|
||||||
|
|
||||||
if (toGenerateCount > 0)
|
|
||||||
{
|
|
||||||
var toGenerateTaskList = item.ActualGlobalTaskList.ExceptBy(item.GeneratedGlobalTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
|
||||||
|
|
||||||
foreach (var toGenerateTask in toGenerateTaskList)
|
|
||||||
{
|
|
||||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.PlanJudgeCount > item.GeneratedJudgeCount)
|
|
||||||
{
|
|
||||||
var needGenerateCount = item.PlanJudgeCount - item.GeneratedJudgeCount;
|
|
||||||
|
|
||||||
var canGenerateCount = item.ActualJudgeCount - item.GeneratedGlobalCount;
|
|
||||||
|
|
||||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
|
||||||
|
|
||||||
if (toGenerateCount > 0)
|
|
||||||
{
|
|
||||||
var toGenerateTaskList = item.ActualJudgeTaskList.ExceptBy(item.GeneratedJudgeTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
|
||||||
|
|
||||||
foreach (var toGenerateTask in toGenerateTaskList)
|
|
||||||
{
|
|
||||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.PlanTumorCount > item.GeneratedTumorCount)
|
|
||||||
{
|
|
||||||
var needGenerateCount = item.PlanTumorCount - item.GeneratedTumorCount;
|
|
||||||
|
|
||||||
var canGenerateCount = item.ActualTumorCount - item.GeneratedGlobalCount;
|
|
||||||
|
|
||||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
|
||||||
|
|
||||||
if (toGenerateCount > 0)
|
|
||||||
{
|
|
||||||
var toGenerateTaskList = item.ActualTumorTaskList.ExceptBy(item.GeneratedTumorTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
|
||||||
|
|
||||||
foreach (var toGenerateTask in toGenerateTaskList)
|
|
||||||
{
|
|
||||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.PlanVisitCount > item.GeneratedVisitCount)
|
|
||||||
{
|
|
||||||
var needGenerateCount = item.PlanVisitCount - item.GeneratedVisitCount;
|
|
||||||
|
|
||||||
var canGenerateCount = item.ActualVisitCount - item.GeneratedGlobalCount;
|
|
||||||
|
|
||||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
|
||||||
|
|
||||||
if (toGenerateCount > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
var toGenerateTaskList = item.ActualVisitTaskList.ExceptBy(item.GeneratedVisitTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
|
||||||
|
|
||||||
foreach (var toGenerateTask in toGenerateTaskList)
|
|
||||||
{
|
|
||||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await _taskMedicalReviewRepository.SaveChangesAsync();
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,83 +233,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
&& t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.TaskState == TaskState.Effect
|
&& t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.TaskState == TaskState.Effect
|
||||||
&& t.SourceSubjectVisitId == subjectVisit.Id).ToList();
|
&& t.SourceSubjectVisitId == subjectVisit.Id).ToList();
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Double)
|
//只有单重阅片
|
||||||
{
|
if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Single)
|
||||||
|
|
||||||
|
|
||||||
VisitTask? task1 = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1);
|
|
||||||
VisitTask? task2 = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2);
|
|
||||||
|
|
||||||
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1))
|
|
||||||
{
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
|
||||||
{
|
|
||||||
TrialId = trialId,
|
|
||||||
SubjectId = subjectVisit.SubjectId,
|
|
||||||
IsUrgent = subjectVisit.IsUrgent,
|
|
||||||
TaskBlindName = blindTaskName,
|
|
||||||
TaskName = subjectVisit.VisitName,
|
|
||||||
VisitTaskNum = subjectVisit.VisitNum,
|
|
||||||
TaskUrgentType = taskUrgentType,
|
|
||||||
IsCanEditUrgentState = isCanEditUrgentState,
|
|
||||||
//CheckPassedTime = subjectVisit.CheckPassedTime,
|
|
||||||
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
|
||||||
Code = currentMaxCodeInt,
|
|
||||||
SourceSubjectVisitId = subjectVisit.Id,
|
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt, nameof(VisitTask)),
|
|
||||||
ReadingCategory = ReadingCategory.Visit,
|
|
||||||
|
|
||||||
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
|
||||||
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
|
||||||
IsClinicalDataSign = isClinicalDataSign
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))
|
|
||||||
{
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
|
||||||
|
|
||||||
|
|
||||||
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
|
||||||
{
|
|
||||||
TrialId = trialId,
|
|
||||||
SubjectId = subjectVisit.SubjectId,
|
|
||||||
IsUrgent = subjectVisit.IsUrgent,
|
|
||||||
TaskBlindName = blindTaskName,
|
|
||||||
TaskName = subjectVisit.VisitName,
|
|
||||||
TaskUrgentType = taskUrgentType,
|
|
||||||
IsCanEditUrgentState = isCanEditUrgentState,
|
|
||||||
VisitTaskNum = subjectVisit.VisitNum,
|
|
||||||
//CheckPassedTime = subjectVisit.CheckPassedTime,
|
|
||||||
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
|
||||||
Code = currentMaxCodeInt,
|
|
||||||
SourceSubjectVisitId = subjectVisit.Id,
|
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt, nameof(VisitTask)),
|
|
||||||
ReadingCategory = ReadingCategory.Visit,
|
|
||||||
|
|
||||||
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
|
||||||
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
|
||||||
IsClinicalDataSign = isClinicalDataSign
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Single)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
VisitTask? singleTask = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm);
|
VisitTask? singleTask = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm);
|
||||||
@@ -336,8 +261,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
ReadingCategory = ReadingCategory.Visit,
|
ReadingCategory = ReadingCategory.Visit,
|
||||||
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = isClinicalDataSign
|
IsClinicalDataSign = isClinicalDataSign,
|
||||||
});
|
|
||||||
|
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget)
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -351,12 +280,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||||
|
|
||||||
}
|
}
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,6 +549,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList);
|
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList);
|
||||||
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
|
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0)
|
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0)
|
||||||
{
|
{
|
||||||
@@ -661,7 +591,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = isClinicalDataSign
|
IsClinicalDataSign = isClinicalDataSign,
|
||||||
|
IsFrontTaskNeedSignButNotSign= isFrontTaskNeedSignButNotSign
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -681,11 +612,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId== trialReadingCriterionId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId== trialReadingCriterionId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
|
||||||
if (beforeBackVisitTask == null)
|
if (beforeBackVisitTask == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
|
||||||
|
|
||||||
|
|
||||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
@@ -765,7 +696,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -876,6 +811,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
// AllocateTime = DateTime.Now,
|
// AllocateTime = DateTime.Now,
|
||||||
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
||||||
|
|
||||||
|
SuggesteFinishedTime= reReadingVisitTask.SuggesteFinishedTime,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
generateTaskCommand.Action(newTask);
|
generateTaskCommand.Action(newTask);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using IRaCIS.Application.Services.BackGroundJob;
|
|||||||
using Magicodes.ExporterAndImporter.Core.Extension;
|
using Magicodes.ExporterAndImporter.Core.Extension;
|
||||||
using Hangfire;
|
using Hangfire;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Allocation
|
namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
{
|
{
|
||||||
@@ -103,7 +104,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
var list = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm)
|
var list = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm)
|
||||||
|
|
||||||
.OrderBy(t => t.ShowOrder)
|
.OrderBy(t => t.ShowOrder)
|
||||||
.Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, IsAutoCreate = t.IsAutoCreate, IsAdditionalAssessment = t.IsAdditionalAssessment, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, ReadingType = t.ReadingType, ReadingInfoSignTime = t.ReadingInfoSignTime })
|
.Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, IsAutoCreate = t.IsAutoCreate, IsAdditionalAssessment = t.IsAdditionalAssessment, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, ReadingType = t.ReadingType, ReadingInfoSignTime = t.ReadingInfoSignTime , IsReadingPeriod= t.IsReadingPeriod })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
||||||
@@ -209,8 +210,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||||
|
|
||||||
.WhereIf(trialConfig?.EnrollConfirmDefaultUserType == UserTypeEnum.MIM && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM, t => t.SourceSubjectVisit.IsBaseLine == true)
|
.WhereIf(trialConfig?.EnrollConfirmDefaultUserType == UserTypeEnum.MIM && trialConfig?.PDProgressDefaultUserType != UserTypeEnum.MIM && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM , t => t.SourceSubjectVisit.IsBaseLine == true)
|
||||||
.WhereIf(trialConfig?.PDProgressDefaultUserType == UserTypeEnum.MIM && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM, t => t.SourceSubjectVisit.IsBaseLine == false)
|
.WhereIf(trialConfig?.EnrollConfirmDefaultUserType != UserTypeEnum.MIM && trialConfig?.PDProgressDefaultUserType == UserTypeEnum.MIM && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM, t => t.SourceSubjectVisit.IsBaseLine == false)
|
||||||
.WhereIf(queryVisitTask.IsWaitPIAudit == true, t => t.FirstAuditUserId == null)
|
.WhereIf(queryVisitTask.IsWaitPIAudit == true, t => t.FirstAuditUserId == null)
|
||||||
.WhereIf(queryVisitTask.IsWaitPIAudit == false, t => t.FirstAuditUserId != null)
|
.WhereIf(queryVisitTask.IsWaitPIAudit == false, t => t.FirstAuditUserId != null)
|
||||||
.WhereIf(queryVisitTask.PIAuditState != null, t => t.PIAuditState == queryVisitTask.PIAuditState)
|
.WhereIf(queryVisitTask.PIAuditState != null, t => t.PIAuditState == queryVisitTask.PIAuditState)
|
||||||
@@ -226,6 +227,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
public async Task<IResponseOutput<PageOutput<PIReaingTaskView>>> GetPIReadingAuditList(VisitTaskQuery queryVisitTask)
|
public async Task<IResponseOutput<PageOutput<PIReaingTaskView>>> GetPIReadingAuditList(VisitTaskQuery queryVisitTask)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//CriterionType? criterionType = _trialReadingCriterionRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t=>t.CriterionType).FirstOrDefault();
|
||||||
|
|
||||||
var visitTaskQueryable = GetReadingTaskQueryable(queryVisitTask)
|
var visitTaskQueryable = GetReadingTaskQueryable(queryVisitTask)
|
||||||
.ProjectTo<PIReaingTaskView>(_mapper.ConfigurationProvider);
|
.ProjectTo<PIReaingTaskView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
@@ -237,6 +240,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
var questionList = _readingQuestionTrialRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.ReadingQuestionCriterionTrialId == queryVisitTask.TrialReadingCriterionId)
|
var questionList = _readingQuestionTrialRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.ReadingQuestionCriterionTrialId == queryVisitTask.TrialReadingCriterionId)
|
||||||
.Where(t => t.IsJudgeQuestion == true)
|
.Where(t => t.IsJudgeQuestion == true)
|
||||||
|
//.WhereIf(criterionType!=null&& criterionType!=CriterionType.SelfDefine,t=>t.IsJudgeQuestion==true)
|
||||||
|
// .WhereIf(criterionType != null && criterionType == CriterionType.SelfDefine, t => t.AssessmentResultEnum == AssessmentResultType.AssessmentResult)
|
||||||
.Select(t => new { QuestionId = t.Id, QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName ,t.DictionaryCode}).ToList();
|
.Select(t => new { QuestionId = t.Id, QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName ,t.DictionaryCode}).ToList();
|
||||||
|
|
||||||
trialTaskConfig!.OtherObj = questionList;
|
trialTaskConfig!.OtherObj = questionList;
|
||||||
@@ -418,6 +423,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||||
|
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.RequestReReadingReason), t => t.RequestReReadingReason.Contains(queryVisitTask.RequestReReadingReason))
|
||||||
|
|
||||||
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
||||||
|
|
||||||
.WhereIf(queryVisitTask.PIAuditState != null, t => t.OriginalReReadingTask.PIAuditState == queryVisitTask.PIAuditState)
|
.WhereIf(queryVisitTask.PIAuditState != null, t => t.OriginalReReadingTask.PIAuditState == queryVisitTask.PIAuditState)
|
||||||
@@ -642,13 +649,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
/// 获取有序阅片IQuery对象
|
/// 获取有序阅片IQuery对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
||||||
{
|
{
|
||||||
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
||||||
|
|
||||||
//Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId;
|
|
||||||
|
|
||||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||||
|
|
||||||
@@ -658,39 +663,40 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
var visitQuery = _visitTaskRepository
|
var visitQuery = _visitTaskRepository
|
||||||
.Where(x => x.TrialId == inDto.TrialId && x.TaskState == TaskState.Effect)
|
.Where(x => x.TrialId == inDto.TrialId && x.TaskState == TaskState.Effect)
|
||||||
|
.WhereIf(inDto.SubjectId!=null,t=>t.SubjectId==inDto.SubjectId)
|
||||||
//PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看
|
//PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline,
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline && readingDivisionEnum == ReadingDivisionEnum.PIandSR,
|
||||||
t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId))
|
t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||||
|
|
||||||
//PI 读随访的时候, subject 如果SR基线没阅片完,PI就不能看
|
//PI 读随访的时候, subject 如果SR基线没阅片完,PI就不能看
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllVisit,
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllVisit && readingDivisionEnum == ReadingDivisionEnum.PIandSR,
|
||||||
t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId))
|
t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR, t => t.Subject.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR, t => t.Subject.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
// 仅仅SR阅片 PI 没有任务列表
|
// 仅仅SR阅片 PI 没有任务列表
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.OnlySR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI, t => t.TrialId == Guid.Empty)
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.OnlySR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI, t => t.TrialId == Guid.Empty)
|
||||||
|
|
||||||
|
//PI查看 PI阅片所有基线
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline,
|
||||||
t => t.SourceSubjectVisit.IsBaseLine == true)
|
t => t.SourceSubjectVisit.IsBaseLine == true)
|
||||||
|
|
||||||
//PI 阅片所有
|
// PI查看 PI 阅片所有
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllBaselineandVisit,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllBaselineandVisit,
|
||||||
t => true)
|
t => true)
|
||||||
|
|
||||||
|
// PI查看 PI 阅片访视
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllVisit,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI && piReadingScopenEnum == PIReadingScopenEnum.AllVisit,
|
||||||
t => t.SourceSubjectVisit.IsBaseLine == false)
|
t => t.SourceSubjectVisit.IsBaseLine == false)
|
||||||
|
|
||||||
|
//SR查看 PI阅片所有基线
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline,
|
||||||
t => t.SourceSubjectVisit.IsBaseLine == false)
|
t => t.SourceSubjectVisit.IsBaseLine == false)
|
||||||
|
|
||||||
//SR 不阅片
|
//SR查看 PI 阅片所有
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaselineandVisit,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaselineandVisit,
|
||||||
t => t.TrialId == Guid.Empty)
|
t => t.TrialId == Guid.Empty)
|
||||||
|
//SR查看 PI 阅片访视
|
||||||
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllVisit,
|
.WhereIf(readingDivisionEnum == ReadingDivisionEnum.PIandSR && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllVisit,
|
||||||
t => t.SourceSubjectVisit.IsBaseLine == true)
|
t => t.SourceSubjectVisit.IsBaseLine == true)
|
||||||
|
|
||||||
@@ -844,7 +850,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
||||||
|
|
||||||
if (requestRecordList.Count() != baseLineTaskIdList.Count())
|
if (requestRecordList.Count != baseLineTaskIdList.Count)
|
||||||
{
|
{
|
||||||
//---后台数据有错误
|
//---后台数据有错误
|
||||||
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
|
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
|
||||||
@@ -967,6 +973,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="origenalTask"></param>
|
/// <param name="origenalTask"></param>
|
||||||
/// <param name="agreeReReadingCommand"></param>
|
/// <param name="agreeReReadingCommand"></param>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
private void ReReadingTaskTrackingDeal(VisitTask origenalTask, ConfirmReReadingCommand agreeReReadingCommand)
|
private void ReReadingTaskTrackingDeal(VisitTask origenalTask, ConfirmReReadingCommand agreeReReadingCommand)
|
||||||
{
|
{
|
||||||
if (origenalTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || origenalTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
if (origenalTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || origenalTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||||
@@ -1548,7 +1555,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
#region 方式二
|
#region 方式二
|
||||||
|
|
||||||
var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).FirstOrDefault();
|
//var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
var origenalTask = await _visitTaskRepository.FindAsync(task.Id);
|
||||||
|
|
||||||
|
|
||||||
foreach (var influenceTask in influenceTaskList)
|
foreach (var influenceTask in influenceTaskList)
|
||||||
{
|
{
|
||||||
@@ -1611,7 +1621,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
await SetMedicalReviewInvalidAsync(currentVisitList);
|
await SetMedicalReviewInvalidAsync(currentVisitList);
|
||||||
|
|
||||||
var origenalTask = currentVisitList.Where(t => t.Id == task.Id).First();
|
//var origenalTask = currentVisitList.Where(t => t.Id == task.Id).First();
|
||||||
|
|
||||||
|
var origenalTask = await _visitTaskRepository.FindAsync(task.Id);
|
||||||
|
|
||||||
foreach (var influenceTask in currentVisitList)
|
foreach (var influenceTask in currentVisitList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Contracts;
|
|||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
@@ -63,8 +64,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||||
|
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||||
|
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
||||||
@@ -83,7 +86,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
|
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
|
||||||
.ForMember(t=>t.PIReadingResultList,u=>u.MapFrom(c=>c.ReadingTaskQuestionAnswerList
|
.ForMember(t=>t.PIReadingResultList,u=>u.MapFrom(c=>c.ReadingTaskQuestionAnswerList
|
||||||
.Where(t=>t.ReadingQuestionTrial.IsJudgeQuestion==true ).Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
.Where(t=> /*t.ReadingQuestionCriterionTrial.CriterionType==CriterionType.SelfDefine? t.ReadingQuestionTrial.AssessmentResultEnum == AssessmentResultType.AssessmentResult:*/ t.ReadingQuestionTrial.IsJudgeQuestion==true)
|
||||||
|
.Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
||||||
|
|
||||||
CreateMap<VisitTask, PIReaingTaskView>().IncludeBase<VisitTask, ReadingTaskView>()
|
CreateMap<VisitTask, PIReaingTaskView>().IncludeBase<VisitTask, ReadingTaskView>()
|
||||||
.ForMember(o => o.FirstAuditUserName, t => t.MapFrom(u => u.FirstAuditUser.UserName))
|
.ForMember(o => o.FirstAuditUserName, t => t.MapFrom(u => u.FirstAuditUser.UserName))
|
||||||
@@ -165,13 +169,13 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<VisitTask, TaskMedicalReviewView>()
|
CreateMap<VisitTask, TaskMedicalReviewView>()
|
||||||
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u =>/* u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code));
|
||||||
|
|
||||||
CreateMap<VisitTask, GenerateMedicalReviewTaskView>()
|
CreateMap<VisitTask, GenerateMedicalReviewTaskView>()
|
||||||
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||||
.ForMember(o => o.GeneratedMedicalReviewCount, t => t.MapFrom(u => u.TaskMedicalReviewList.Count()))
|
.ForMember(o => o.GeneratedMedicalReviewCount, t => t.MapFrom(u => u.TaskMedicalReviewList.Count()))
|
||||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||||
.ForMember(o => o.IsGeneratedJudge, t => t.MapFrom(u => u.JudgeVisitTaskId != null))
|
.ForMember(o => o.IsGeneratedJudge, t => t.MapFrom(u => u.JudgeVisitTaskId != null))
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using IRaCIS.Application.Contracts;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
@@ -99,15 +100,58 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//---读取模板内容失败, 请将文件另存为docx格式尝试!
|
//---读取模板内容失败, 请将文件另存为docx格式尝试!
|
||||||
return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]);
|
return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = await _commonDocumentRepository.InsertOrUpdateAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
if (addOrEditCommonDocument.Id == null) //insert
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
var entity = await _commonDocumentRepository.InsertFromDTOAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
}
|
||||||
|
else //update
|
||||||
|
{
|
||||||
|
|
||||||
|
var dbbeforeEntity = await _commonDocumentRepository.UpdateFromDTOAsync(addOrEditCommonDocument, true, true, verifyExp1, verifyExp2);
|
||||||
|
|
||||||
|
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, dbbeforeEntity.Path);
|
||||||
|
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
File.Delete(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpDelete("{commonDocumentId:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeleteCommonDocument(Guid commonDocumentId)
|
||||||
|
{
|
||||||
|
var find= await _commonDocumentRepository.FirstOrDefaultNoTrackingAsync(t=>t.Id== commonDocumentId);
|
||||||
|
|
||||||
|
var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true,true);
|
||||||
|
|
||||||
|
if (find != null)
|
||||||
|
{
|
||||||
|
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, find.Path);
|
||||||
|
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
File.Delete(filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
public string Value { get; set; } = string.Empty;
|
public string Value { get; set; } = string.Empty;
|
||||||
public string ValueCN { get; set; } = string.Empty;
|
public string ValueCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string FrontType { get; set; } = string.Empty;
|
||||||
|
|
||||||
public int InternationalizationType { get; set; }
|
public int InternationalizationType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,19 +57,23 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class BatchAddInternationalizationDto
|
public class BatchInternationalizationDto
|
||||||
{
|
{
|
||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
public string Code { get; set; } = string.Empty;
|
public string Code { get; set; } = string.Empty;
|
||||||
public string Value { get; set; } = string.Empty;
|
public string Value { get; set; } = string.Empty;
|
||||||
|
public string FrontType { get; set; } = string.Empty;
|
||||||
public string ValueCN { get; set; } = string.Empty;
|
public string ValueCN { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InternationalizationSimpleDto
|
public class BatchAddInternationalizationDto : BatchInternationalizationDto
|
||||||
{
|
{
|
||||||
public string Code { get; set; } = string.Empty;
|
|
||||||
public string Value { get; set; } = string.Empty;
|
}
|
||||||
public string ValueCN { get; set; } = string.Empty;
|
|
||||||
|
public class InternationalizationSimpleDto: BatchInternationalizationDto
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ namespace IRaCIS.Application.Services
|
|||||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||||
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystem;
|
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystem;
|
||||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
||||||
private readonly IReadingQuestionService _readingQuestionService;
|
|
||||||
|
|
||||||
public DictionaryService(IRepository<Dictionary> sysDicRepository, IRepository<TrialDictionary> trialDictionaryRepository,
|
public DictionaryService(IRepository<Dictionary> sysDicRepository, IRepository<TrialDictionary> trialDictionaryRepository,
|
||||||
IRepository<Trial> trialRepository,
|
IRepository<Trial> trialRepository,
|
||||||
@@ -35,8 +34,7 @@ namespace IRaCIS.Application.Services
|
|||||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||||
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystem,
|
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystem,
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial
|
||||||
IReadingQuestionService readingQuestionService
|
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
@@ -52,7 +50,6 @@ namespace IRaCIS.Application.Services
|
|||||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||||
this._readingQuestionCriterionSystem = readingQuestionCriterionSystem;
|
this._readingQuestionCriterionSystem = readingQuestionCriterionSystem;
|
||||||
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
||||||
this._readingQuestionService = readingQuestionService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
var memoryStream2 = new MemoryStream();
|
var memoryStream2 = new MemoryStream();
|
||||||
wb.Write(memoryStream2);
|
wb.Write(memoryStream2,true);
|
||||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
return new FileStreamResult(memoryStream2, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
return new FileStreamResult(memoryStream2, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||||
@@ -755,6 +755,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||||
|
|
||||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||||
|
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||||
@@ -970,7 +971,6 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||||||
/// <param name="_commonDocumentRepository"></param>
|
/// <param name="_commonDocumentRepository"></param>
|
||||||
/// <param name="_dictionaryService"></param>
|
/// <param name="_dictionaryService"></param>
|
||||||
/// <param name="_trialRepository"></param>
|
/// <param name="_trialRepository"></param>
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> GetGroupAnalysisTaskList_Export(VisitTaskQuery queryVisitTask,
|
public async Task<IActionResult> GetGroupAnalysisTaskList_Export(VisitTaskQuery queryVisitTask,
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ using IRaCIS.Core.Application.Interfaces;
|
|||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using EasyCaching.Core;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using OfficeOpenXml.FormulaParsing.Utilities;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
@@ -19,28 +22,77 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[ApiExplorerSettings(GroupName = "Common")]
|
[ApiExplorerSettings(GroupName = "Common")]
|
||||||
public class InternationalizationService : BaseService, IInternationalizationService
|
public class InternationalizationService : BaseService, IInternationalizationService
|
||||||
{
|
{
|
||||||
|
private readonly IEasyCachingProvider _provider;
|
||||||
private readonly IRepository<Internationalization> _internationalizationRepository;
|
private readonly IRepository<Internationalization> _internationalizationRepository;
|
||||||
|
|
||||||
public InternationalizationService(IRepository<Internationalization> internationalizationRepository)
|
public InternationalizationService(IRepository<Internationalization> internationalizationRepository, IEasyCachingProvider provider)
|
||||||
{
|
{
|
||||||
_internationalizationRepository = internationalizationRepository;
|
_internationalizationRepository = internationalizationRepository;
|
||||||
|
_provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前端国际化内容接口
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
[HttpGet]
|
||||||
public async Task<List<InternationalizationSimpleDto>> GetFrontInternationalizationList()
|
public async Task<IEnumerable<InternationalizationSimpleDto>> GetFrontInternationalizationList()
|
||||||
{
|
{
|
||||||
|
var cacheList= _provider.Get<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front).Value;
|
||||||
|
|
||||||
var list = await _internationalizationRepository.Where(t => t.InternationalizationType == 0).Select(t => new InternationalizationSimpleDto()
|
if(cacheList != null && cacheList.Count!=0)
|
||||||
{
|
{
|
||||||
Code = t.Code,
|
return cacheList;
|
||||||
Value = t.Value,
|
}
|
||||||
ValueCN = t.ValueCN
|
else
|
||||||
}).ToListAsync();
|
{
|
||||||
|
var list = await _internationalizationRepository.Where(t => t.InternationalizationType == 0).Select(t => new InternationalizationSimpleDto()
|
||||||
|
{
|
||||||
|
Code = t.Code,
|
||||||
|
Value = t.Value,
|
||||||
|
ValueCN = t.ValueCN,
|
||||||
|
FrontType = t.FrontType,
|
||||||
|
Description = t.Description,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
return list;
|
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, list, TimeSpan.FromDays(1));
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前端批量提交,后端判断不存在就添加,存在就更新
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<IResponseOutput> BatchAddOrUpdateFrontInternationalization(List<BatchInternationalizationDto> batchList)
|
||||||
|
{
|
||||||
|
foreach (var item in batchList)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
{
|
||||||
|
var mapItem = _mapper.Map<Internationalization>(item);
|
||||||
|
mapItem.InternationalizationType = 0;
|
||||||
|
mapItem.State = 1;
|
||||||
|
|
||||||
|
await _internationalizationRepository.AddAsync(mapItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await _internationalizationRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
//清理缓存
|
||||||
|
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -63,6 +115,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后端之前批量添加接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="batchAdd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> BatchAddInternationalization(BatchAddInternationalization batchAdd)
|
public async Task<IResponseOutput> BatchAddInternationalization(BatchAddInternationalization batchAdd)
|
||||||
{
|
{
|
||||||
@@ -87,21 +144,39 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
await _internationalizationRepository.SaveChangesAsync();
|
await _internationalizationRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
//清理缓存
|
||||||
|
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前后端添加的时候,区分了,前端判断重复多了多了一个路由 路由+标识唯一
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="addOrEditInternationalization"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<IResponseOutput> AddOrUpdateInternationalization(InternationalizationAddOrEdit addOrEditInternationalization)
|
public async Task<IResponseOutput> AddOrUpdateInternationalization(InternationalizationAddOrEdit addOrEditInternationalization)
|
||||||
{
|
{
|
||||||
|
var internationalizationType = addOrEditInternationalization.InternationalizationType;
|
||||||
|
|
||||||
|
//后端验证标识重复与否
|
||||||
var verifyExp1 = new EntityVerifyExp<Internationalization>()
|
var verifyExp1 = new EntityVerifyExp<Internationalization>()
|
||||||
{
|
{
|
||||||
VerifyExp = t => t.Code == addOrEditInternationalization.Code && t.InternationalizationType == addOrEditInternationalization.InternationalizationType,
|
VerifyExp = t => t.Code == addOrEditInternationalization.Code && t.InternationalizationType == addOrEditInternationalization.InternationalizationType,
|
||||||
|
|
||||||
VerifyMsg = $"该类型已有{addOrEditInternationalization.Code}名称的国际化标识",
|
VerifyMsg = $"该类型已有{addOrEditInternationalization.Code}名称的国际化标识",
|
||||||
IsVerify = true
|
IsVerify = internationalizationType == 1
|
||||||
};
|
};
|
||||||
|
|
||||||
var entity = await _internationalizationRepository.InsertOrUpdateAsync(addOrEditInternationalization, true, verifyExp1);
|
//前端验证标识重复与否
|
||||||
|
var verifyExp2 = new EntityVerifyExp<Internationalization>()
|
||||||
|
{
|
||||||
|
VerifyExp = t => t.Code == addOrEditInternationalization.Code && t.InternationalizationType == addOrEditInternationalization.InternationalizationType && t.Description == addOrEditInternationalization.Description,
|
||||||
|
|
||||||
|
VerifyMsg = $"该类型已有{addOrEditInternationalization.Description}下的{addOrEditInternationalization.Code}名称的国际化标识",
|
||||||
|
IsVerify = internationalizationType == 0
|
||||||
|
};
|
||||||
|
|
||||||
|
var entity = await _internationalizationRepository.InsertOrUpdateAsync(addOrEditInternationalization, true, verifyExp1, verifyExp2);
|
||||||
|
|
||||||
if (addOrEditInternationalization.InternationalizationType == 1)
|
if (addOrEditInternationalization.InternationalizationType == 1)
|
||||||
{
|
{
|
||||||
@@ -109,6 +184,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//清理缓存
|
||||||
|
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -118,6 +196,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
public async Task<IResponseOutput> DeleteInternationalization(Guid internationalizationId)
|
public async Task<IResponseOutput> DeleteInternationalization(Guid internationalizationId)
|
||||||
{
|
{
|
||||||
var success = await _internationalizationRepository.DeleteFromQueryAsync(t => t.Id == internationalizationId, true);
|
var success = await _internationalizationRepository.DeleteFromQueryAsync(t => t.Id == internationalizationId, true);
|
||||||
|
|
||||||
|
//清理缓存
|
||||||
|
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,10 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
private readonly IRepository<SystemBasicData> _systemBasicDatarepository;
|
private readonly IRepository<SystemBasicData> _systemBasicDatarepository;
|
||||||
|
|
||||||
private readonly IWebHostEnvironment _hostEnvironment;
|
|
||||||
private readonly IRepository<User> _userRepository;
|
private readonly IRepository<User> _userRepository;
|
||||||
|
|
||||||
private readonly ITokenService _tokenService;
|
private readonly ITokenService _tokenService;
|
||||||
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
private readonly IRepository<UserType> _userTypeRepository;
|
private readonly IRepository<UserType> _userTypeRepository;
|
||||||
@@ -61,7 +59,6 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
public MailVerificationService(IRepository<VerificationCode> verificationCodeRepository,
|
public MailVerificationService(IRepository<VerificationCode> verificationCodeRepository,
|
||||||
IRepository<SystemBasicData> systemBasicDatarepository,
|
IRepository<SystemBasicData> systemBasicDatarepository,
|
||||||
IWebHostEnvironment hostEnvironment,
|
|
||||||
IRepository<User> userRepository,
|
IRepository<User> userRepository,
|
||||||
ITokenService tokenService,
|
ITokenService tokenService,
|
||||||
IRepository<Trial> trialRepository,
|
IRepository<Trial> trialRepository,
|
||||||
@@ -72,9 +69,7 @@ namespace IRaCIS.Application.Services
|
|||||||
_verificationCodeRepository = verificationCodeRepository;
|
_verificationCodeRepository = verificationCodeRepository;
|
||||||
_systemBasicDatarepository = systemBasicDatarepository;
|
_systemBasicDatarepository = systemBasicDatarepository;
|
||||||
|
|
||||||
_hostEnvironment = hostEnvironment;
|
|
||||||
|
|
||||||
_mapper = mapper;
|
|
||||||
|
|
||||||
_tokenService = tokenService;
|
_tokenService = tokenService;
|
||||||
_userRepository = userRepository;
|
_userRepository = userRepository;
|
||||||
@@ -163,7 +158,7 @@ namespace IRaCIS.Application.Services
|
|||||||
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
|
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
|
||||||
//主题
|
//主题
|
||||||
//---[来自展影IRC] 关于重置密码的提醒
|
//---[来自展影IRC] 关于重置密码的提醒
|
||||||
messageToSend.Subject = _localizer["Mail_IRCResettingPassword "];
|
messageToSend.Subject = _localizer["Mail_IRCResettingPassword"];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -182,8 +177,9 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(templateInfo,
|
builder.HtmlBody = string.Format(templateInfo,
|
||||||
|
"",
|
||||||
//---您正在进行邮箱重置密码操作
|
//---您正在进行邮箱重置密码操作
|
||||||
_localizer["Mail_ResettingPassword "],
|
_localizer["Mail_ResettingPassword"],
|
||||||
verificationCode
|
verificationCode
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -249,6 +245,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(templateInfo,
|
builder.HtmlBody = string.Format(templateInfo,
|
||||||
|
"",
|
||||||
//---您正在参与展影医疗IRC项目
|
//---您正在参与展影医疗IRC项目
|
||||||
_localizer["Mail_IRCProject"],
|
_localizer["Mail_IRCProject"],
|
||||||
verificationCode
|
verificationCode
|
||||||
@@ -315,6 +312,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(templateInfo,
|
builder.HtmlBody = string.Format(templateInfo,
|
||||||
|
"",
|
||||||
//---您正在参与展影医疗IRC项目中心调研工作
|
//---您正在参与展影医疗IRC项目中心调研工作
|
||||||
_localizer["Mail_CenterResearchReminder"],
|
_localizer["Mail_CenterResearchReminder"],
|
||||||
verificationCode
|
verificationCode
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<Internationalization, InternationalizationView>();
|
CreateMap<Internationalization, InternationalizationView>();
|
||||||
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
CreateMap<Internationalization, BatchInternationalizationDto>().ReverseMap();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<BatchAddInternationalizationDto, InternationalizationAddOrEdit>();
|
CreateMap<BatchAddInternationalizationDto, InternationalizationAddOrEdit>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
Task SendTrialQCQuestionEmailAsync(Guid trialId);
|
Task SendTrialQCQuestionEmailAsync(Guid trialId);
|
||||||
Task SendTrialImageQuestionAsync(Guid trialId);
|
Task SendTrialImageQuestionAsync(Guid trialId);
|
||||||
Task SendPIAuditResultAsync(Guid visitTaskId);
|
Task SendPIAuditResultAsync(Guid visitTaskId);
|
||||||
|
|
||||||
|
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 : BaseService, IEmailSendService
|
||||||
@@ -41,18 +43,19 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
|
|
||||||
private readonly IDictionaryService _dictionaryService;
|
|
||||||
private readonly IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig;
|
private readonly IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig;
|
||||||
|
|
||||||
public readonly static string EmailNamePlaceholder = "EmailNamePlaceholder";
|
public readonly static string EmailNamePlaceholder = "EmailNamePlaceholder";
|
||||||
|
|
||||||
public EmailSendService(IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository, IRepository<EmailNoticeConfig> emailNoticeConfigRepository, IRepository<Trial> trialRepository, IOptionsMonitor<SystemEmailSendConfig> systemEmailSendConfig, IDictionaryService dictionaryService)
|
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||||
|
|
||||||
|
public EmailSendService(IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository, IRepository<EmailNoticeConfig> emailNoticeConfigRepository, IRepository<Trial> trialRepository, IOptionsMonitor<SystemEmailSendConfig> systemEmailSendConfig,IRepository<Dictionary> dictionaryRepository)
|
||||||
{
|
{
|
||||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||||
_emailNoticeConfigRepository = emailNoticeConfigRepository;
|
_emailNoticeConfigRepository = emailNoticeConfigRepository;
|
||||||
_trialRepository = trialRepository;
|
_trialRepository = trialRepository;
|
||||||
_SystemEmailSendConfig = systemEmailSendConfig;
|
_SystemEmailSendConfig = systemEmailSendConfig;
|
||||||
_dictionaryService = dictionaryService;
|
_dictionaryRepository=dictionaryRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
//入组确认/PD确认
|
//入组确认/PD确认
|
||||||
@@ -309,7 +312,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var needTranslateDicNameList = answerList.Where(t => !string.IsNullOrEmpty(t.DictionaryCode)).Select(t => t.DictionaryCode).ToList();
|
var needTranslateDicNameList = answerList.Where(t => !string.IsNullOrEmpty(t.DictionaryCode)).Select(t => t.DictionaryCode).ToList();
|
||||||
|
|
||||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslateDicNameList.ToArray());
|
|
||||||
|
var searchList = await _dictionaryRepository.Where(t => needTranslateDicNameList.ToArray().Contains(t.Parent.Code) && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelectCopy>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||||
|
|
||||||
|
var translateDataList = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Func<bool, string, string, string> transFunc = (bool isNeedTranslate, string dicCode, string answer) =>
|
Func<bool, string, string, string> transFunc = (bool isNeedTranslate, string dicCode, string answer) =>
|
||||||
@@ -349,7 +356,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync();
|
.Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false)
|
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable==false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -414,7 +421,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
sendEmailConfig.HtmlBodyStr = htmlBodyStr.Replace(EmailNamePlaceholder, string.Join(isEn_us ? ", " : "、", toUserList.Select(t => t.FullName).ToList()));
|
sendEmailConfig.HtmlBodyStr = htmlBodyStr.Replace(EmailNamePlaceholder, string.Join(isEn_us ? ", " : "、", toUserList.Select(t => t.FullName).ToList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toUserList.Count() == 0)
|
if (toUserList.Count == 0)
|
||||||
{
|
{
|
||||||
//---没有收件人,无法发送邮件
|
//---没有收件人,无法发送邮件
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_NoRecipient"]);
|
throw new BusinessValidationFailedException(_localizer["TrialEmailN_NoRecipient"]);
|
||||||
@@ -463,6 +470,142 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async 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)
|
||||||
|
{
|
||||||
|
//找到配置
|
||||||
|
var trialEmailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.BusinessScenarioEnum == businessScenario, ignoreQueryFilters: true)
|
||||||
|
.Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable==false)
|
||||||
|
{
|
||||||
|
return (null, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var sendEmailConfig = new SMTPEmailConfig();
|
||||||
|
|
||||||
|
var (topicStr, htmlBodyStr, isEn_us, onlyToUserId) = topicAndHtmlFunc(trialEmailConfig);
|
||||||
|
|
||||||
|
|
||||||
|
sendEmailConfig.TopicDescription = topicStr;
|
||||||
|
sendEmailConfig.HtmlBodyStr = htmlBodyStr;
|
||||||
|
|
||||||
|
|
||||||
|
var blackUserIdList = trialEmailConfig.TrialEmailBlackUserList.Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
var toUserTypeEnumList = trialEmailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).ToList();
|
||||||
|
|
||||||
|
var copyUserTypeEnumList = trialEmailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(c => c.UserType).ToList();
|
||||||
|
|
||||||
|
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 toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
//收件人 有CRC CRA , CRC CRA的账户要按照中心发送
|
||||||
|
if (siteId == null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA) && onlyToUserId == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前场景收件人包含CRC CRA,但是没有siteId,请联系后端开发");
|
||||||
|
}
|
||||||
|
if (siteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
|
{
|
||||||
|
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
|
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//去除黑名单
|
||||||
|
toUserList = toUserList.Where(t => !blackUserIdList.Contains(t.UserId)).ToList();
|
||||||
|
|
||||||
|
var copyUserList = allUserList.Where(t => copyUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
|
.Where(t => !blackUserIdList.Contains(t.UserId)).ToList();
|
||||||
|
|
||||||
|
if (siteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
|
{
|
||||||
|
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
|
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onlyToUserId != null)
|
||||||
|
{
|
||||||
|
toUserList = toUserList.Where(t => t.UserId == onlyToUserId).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sendEmailConfig.HtmlBodyStr = htmlBodyStr.Replace(EmailNamePlaceholder, string.Join(isEn_us ? ", " : "、", toUserList.Select(t => t.FullName).ToList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toUserList.Count == 0)
|
||||||
|
{
|
||||||
|
//---没有收件人,无法发送邮件
|
||||||
|
throw new BusinessValidationFailedException(_localizer["TrialEmailN_NoRecipient"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (trialEmailConfig.FromEmail.Contains("@") && !string.IsNullOrEmpty(trialEmailConfig.FromEmail))
|
||||||
|
{
|
||||||
|
|
||||||
|
sendEmailConfig.FromEmailAddress = new MimeKit.MailboxAddress(trialEmailConfig.FromName, trialEmailConfig.FromEmail);
|
||||||
|
sendEmailConfig.AuthorizationCode = trialEmailConfig.AuthorizationCode;
|
||||||
|
sendEmailConfig.UserName = trialEmailConfig.FromEmail;
|
||||||
|
|
||||||
|
sendEmailConfig.Host = trialEmailConfig.SMTPServerAddress;
|
||||||
|
sendEmailConfig.Port = trialEmailConfig.SMTPServerPort;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//---项目发件邮箱配置有误,请核实
|
||||||
|
throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidEmailConfig"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in toUserList)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (item.EMail.Contains("@") && !string.IsNullOrEmpty(item.EMail))
|
||||||
|
{
|
||||||
|
|
||||||
|
sendEmailConfig.ToMailAddressList.Add(new MimeKit.MailboxAddress(item.FullName, item.EMail));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var item in copyUserList)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (item.EMail.Contains("@") && !string.IsNullOrEmpty(item.EMail))
|
||||||
|
{
|
||||||
|
|
||||||
|
sendEmailConfig.CopyToMailAddressList.Add(new MimeKit.MailboxAddress(item.FullName, item.EMail));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//邮件附件 这里是原格式发送,不是PDF
|
||||||
|
|
||||||
|
//if (trialEmailConfig.AttachCNPath != string.Empty && trialEmailConfig.AttachPath != string.Empty)
|
||||||
|
//{
|
||||||
|
// var phyPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, isEn_us? trialEmailConfig.AttachName: trialEmailConfig.AttachNameCN);
|
||||||
|
|
||||||
|
// //先预先生成了邮件,发送预先生成的邮件
|
||||||
|
// sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
|
// {
|
||||||
|
// FileName = $"{attachPrefix}_{Path.GetFileName(_userInfo.IsEn_Us ? trialEmailConfig.AttachName : trialEmailConfig.AttachNameCN)}",
|
||||||
|
|
||||||
|
// FileStream = File.OpenRead(phyPath),
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
return (trialEmailConfig, sendEmailConfig);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// <param name="isSystemDoc"></param>
|
/// <param name="isSystemDoc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
||||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId" })]
|
||||||
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
||||||
{
|
{
|
||||||
if (isSystemDoc)
|
if (isSystemDoc)
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ using IRaCIS.Core.Domain.Share.Common;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Spire.Doc;
|
using Spire.Doc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using SharpCompress.Common;
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
@@ -42,7 +47,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
private readonly IRepository<TrialUser> _trialUserRepository;
|
private readonly IRepository<TrialUser> _trialUserRepository;
|
||||||
private readonly IRepository<Subject> _subjectRepository;
|
private readonly IRepository<Subject> _subjectRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
private readonly IEmailSendService _emailSendService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TrialEmailBlackUser> trialEmailBlackUserRepository,
|
IRepository<TrialEmailBlackUser> trialEmailBlackUserRepository,
|
||||||
IRepository<EmailNoticeConfig> emailNoticeConfigRepository
|
IRepository<EmailNoticeConfig> emailNoticeConfigRepository
|
||||||
|
, IEmailSendService emailSendService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||||
@@ -67,6 +73,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
_subjectVisitRepository = subjectVisitRepository;
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
_trialEmailBlackUserRepository = trialEmailBlackUserRepository;
|
_trialEmailBlackUserRepository = trialEmailBlackUserRepository;
|
||||||
_emailNoticeConfigRepository = emailNoticeConfigRepository;
|
_emailNoticeConfigRepository = emailNoticeConfigRepository;
|
||||||
|
_emailSendService = emailSendService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -255,8 +262,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
public async Task<string> BaseBusinessScenarioSendEmailAsync(Guid visitTaskId, bool? isHandSend, EmailStoreSendMode emailStoreMode, string sendFileRelativePath)
|
public async Task<string> BaseBusinessScenarioSendEmailAsync(Guid visitTaskId, bool? isHandSend, EmailStoreSendMode emailStoreMode, string sendFileRelativePath)
|
||||||
{
|
{
|
||||||
|
var isEn_us = _userInfo.IsEn_Us;
|
||||||
EmailBusinessScenario? businessScenarioEnum = null;
|
EmailBusinessScenario businessScenarioEnum = EmailBusinessScenario.None;
|
||||||
|
|
||||||
#region 任务关联的项目配置 标准信息及配置,subject 信息
|
#region 任务关联的项目配置 标准信息及配置,subject 信息
|
||||||
var taskInfo = await _visitTaskRepository.Where(t => t.Id == visitTaskId).Select(t => new
|
var taskInfo = await _visitTaskRepository.Where(t => t.Id == visitTaskId).Select(t => new
|
||||||
@@ -352,286 +359,119 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 发收件人配置 确保无误
|
#region 邮件内容装配
|
||||||
|
|
||||||
|
Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc = trialEmailConfig =>
|
||||||
var emailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == taskInfo.TrialId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.BusinessScenarioEnum == businessScenarioEnum)
|
|
||||||
.Include(t => t.TrialEmailNoticeUserList).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
if (emailConfig == null || (emailConfig.IsAutoSend == false && isHandSend == null))
|
|
||||||
{
|
{
|
||||||
//throw new BusinessValidationFailedException("找不到该项目标准场景下邮件的配置");
|
var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, taskInfo.ResearchProgramNo, taskInfo.SubjectCode);
|
||||||
|
|
||||||
return string.Empty;
|
var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN,
|
||||||
}
|
StaticData.EmailSend.EmailNamePlaceholder, taskInfo.ResearchProgramNo, taskInfo.SubjectCode);
|
||||||
|
|
||||||
|
|
||||||
var sendEmailConfig = new SMTPEmailConfig();
|
return (topicStr, htmlBodyStr, isEn_us, null);
|
||||||
|
};
|
||||||
//收件人 如果是CRC CRA 要按照中心发送
|
|
||||||
var toUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
var (trialEmailConfig, sendEmailConfig) = await _emailSendService.BuildEmailConfig(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId);
|
||||||
var toUserList = _repository.Where<TrialSiteUser>(t => t.TrialId == taskInfo.TrialId && toUserTypeEnumList.Contains(t.User.UserTypeEnum) && t.SiteId == taskInfo.SiteId).Select(t => new { t.User.EMail, t.User.FullName }).ToList();
|
|
||||||
|
|
||||||
var copyUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(c => c.UserType).ToList();
|
|
||||||
var copyUserList = _repository.Where<TrialUser>(t => t.TrialId == taskInfo.TrialId && copyUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
if (toUserList.Count() == 0)
|
|
||||||
{
|
|
||||||
//---没有收件人,无法发送邮件
|
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_NoRecipient"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (emailConfig.FromEmail.Contains("@") && !string.IsNullOrEmpty(emailConfig.FromEmail))
|
|
||||||
{
|
|
||||||
|
|
||||||
sendEmailConfig.FromEmailAddress = new MimeKit.MailboxAddress(emailConfig.FromName, emailConfig.FromEmail);
|
|
||||||
sendEmailConfig.AuthorizationCode = emailConfig.AuthorizationCode;
|
|
||||||
sendEmailConfig.UserName = emailConfig.FromEmail;
|
|
||||||
|
|
||||||
sendEmailConfig.Host = emailConfig.SMTPServerAddress;
|
|
||||||
sendEmailConfig.Port = emailConfig.SMTPServerPort;
|
|
||||||
|
|
||||||
|
|
||||||
//测试
|
|
||||||
//sendEmailConfig.ToMailAddressList.Add(new MimeKit.MailboxAddress("ddd", "872297557@qq.com"));
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//---项目发件邮箱配置有误,请核实
|
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidEmailConfig"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in toUserList)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (item.EMail.Contains("@") && !string.IsNullOrEmpty(item.EMail))
|
|
||||||
{
|
|
||||||
|
|
||||||
sendEmailConfig.ToMailAddressList.Add(new MimeKit.MailboxAddress(item.FullName, item.EMail));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach (var item in copyUserList)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (item.EMail.Contains("@") && !string.IsNullOrEmpty(item.EMail))
|
|
||||||
{
|
|
||||||
|
|
||||||
sendEmailConfig.CopyToMailAddressList.Add(new MimeKit.MailboxAddress(item.FullName, item.EMail));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 确保 邮件Html存在
|
|
||||||
|
|
||||||
//邮件附件
|
|
||||||
var path = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, _userInfo.IsEn_Us ? emailConfig.AttachPath : emailConfig.AttachCNPath);
|
|
||||||
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
//---找不到该项目标准场景下邮件模板
|
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_EmailTemplateNotFound"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pathToFile = _hostEnvironment.WebRootPath
|
|
||||||
+ Path.DirectorySeparatorChar.ToString()
|
|
||||||
+ "EmailTemplate"
|
|
||||||
+ Path.DirectorySeparatorChar.ToString()
|
|
||||||
//+ "SubjectEnrollConfirmOrPDProgress.html";
|
|
||||||
+ (_userInfo.IsEn_Us ? "SubjectEnrollConfirmOrPDProgress_US.html" : "SubjectEnrollConfirmOrPDProgress.html");
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 不同场景 Tile 设置
|
|
||||||
|
|
||||||
if (businessScenarioEnum == EmailBusinessScenario.EnrollConfirmed)
|
//自动发送
|
||||||
|
if (sendEmailConfig != null && trialEmailConfig !=null)
|
||||||
{
|
{
|
||||||
sendEmailConfig.TopicDescription = _localizer["TrialEmailN_EnrollmentConfirmation", taskInfo.ResearchProgramNo, taskInfo.SubjectCode];
|
#region 不同标准 不同项目配置 发送邮件的时机 处理具体逻辑
|
||||||
|
|
||||||
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
var answer = "否";
|
||||||
|
var isNeedSend = true;
|
||||||
|
var minUserIdList = _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == taskInfo.TrialId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//入组确认 根据每个标准配置的是否自动发送,发送邮件与否
|
||||||
|
if (businessScenarioEnum == EmailBusinessScenario.EnrollConfirmed)
|
||||||
{
|
{
|
||||||
var templateInfo = SourceReader.ReadToEnd();
|
if (await _repository.Where<ReadingTableQuestionAnswer>().AnyAsync(x => x.VisitTaskId == visitTaskId && x.Answer == TargetState.Exist.GetEnumInt() &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && x.ReadingQuestionTrial.LesionType == LesionType.TargetLesion))
|
||||||
|
|
||||||
sendEmailConfig.HtmlBodyStr = string.Format(templateInfo,
|
|
||||||
//--- 附件为疾病进展确认报告,请查收
|
|
||||||
_localizer["TrialEmailN_SubjectDiseaseProgression"]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (businessScenarioEnum == EmailBusinessScenario.PDConfirmed)
|
|
||||||
{
|
|
||||||
sendEmailConfig.TopicDescription = _localizer["TrialEmailN_PDReport", taskInfo.ResearchProgramNo, taskInfo.SubjectCode];
|
|
||||||
|
|
||||||
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
|
||||||
{
|
|
||||||
var templateInfo = SourceReader.ReadToEnd();
|
|
||||||
|
|
||||||
|
|
||||||
sendEmailConfig.HtmlBodyStr = string.Format(templateInfo,
|
|
||||||
//--- 附件为疾病进展确认报告,请查收
|
|
||||||
_localizer["TrialEmailN_SubjectDiseaseProgression"]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region 不同标准 不同项目配置 发送邮件的时机 处理具体逻辑
|
|
||||||
|
|
||||||
var answer = "否";
|
|
||||||
var isNeedSend = true;
|
|
||||||
var minUserIdList = _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == taskInfo.TrialId).Select(t => t.UserId).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//入组确认 根据每个标准配置的是否自动发送,发送邮件与否
|
|
||||||
if (businessScenarioEnum == EmailBusinessScenario.EnrollConfirmed)
|
|
||||||
{
|
|
||||||
if (await _repository.Where<ReadingTableQuestionAnswer>().AnyAsync(x => x.VisitTaskId == visitTaskId && x.Answer == TargetState.Exist.GetEnumInt() &&
|
|
||||||
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && x.ReadingQuestionTrial.LesionType == LesionType.TargetLesion))
|
|
||||||
{
|
|
||||||
answer = "是";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//如果其他阅片人已经做了,说明发送了入组确认报告,第二个人做完就不发送了
|
|
||||||
|
|
||||||
//入组确认一直交给第一个人,如果第一个人重阅 还未做完,第二个人先做完了,此时不发
|
|
||||||
|
|
||||||
var existFirstEnrollTask = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.IsAnalysisCreate == false
|
|
||||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId).OrderBy(t => t.SignTime).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
//入组确认的医生已确定
|
|
||||||
if ((existFirstEnrollTask != null) && (taskInfo.DoctorUserId != existFirstEnrollTask.DoctorUserId))
|
|
||||||
{
|
|
||||||
isNeedSend = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
|
||||||
|
|
||||||
|
|
||||||
if (answer == "是")
|
|
||||||
{
|
{
|
||||||
//把另外一个人的任务设置为不加急(如果项目加急是否 subject 加急是否)
|
answer = "是";
|
||||||
var urgent = _repository.Where<SubjectVisit>(t => t.Id == taskInfo.SourceSubjectVisitId).Select(t => new { IsSubjectUrgent = t.Subject.IsUrgent, t.Trial.IsUrgent }).FirstOrDefault();
|
|
||||||
|
|
||||||
if (urgent?.IsUrgent == false || urgent?.IsSubjectUrgent == false)
|
|
||||||
{
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false &&
|
|
||||||
t.Id != visitTaskId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId, u => new VisitTask() { IsUrgent = false });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//如果其他阅片人已经做了,说明发送了入组确认报告,第二个人做完就不发送了
|
||||||
|
|
||||||
|
//入组确认一直交给第一个人,如果第一个人重阅 还未做完,第二个人先做完了,此时不发
|
||||||
|
|
||||||
|
var existFirstEnrollTask = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.IsAnalysisCreate == false
|
||||||
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId).OrderBy(t => t.SignTime).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
//入组确认的医生已确定
|
||||||
|
if ((existFirstEnrollTask != null) && (taskInfo.DoctorUserId != existFirstEnrollTask.DoctorUserId))
|
||||||
|
{
|
||||||
|
isNeedSend = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
||||||
|
|
||||||
|
|
||||||
|
if (answer == "是")
|
||||||
|
{
|
||||||
|
//把另外一个人的任务设置为不加急(如果项目加急是否 subject 加急是否)
|
||||||
|
var urgent = _repository.Where<SubjectVisit>(t => t.Id == taskInfo.SourceSubjectVisitId).Select(t => new { IsSubjectUrgent = t.Subject.IsUrgent, t.Trial.IsUrgent }).FirstOrDefault();
|
||||||
|
|
||||||
|
if (urgent?.IsUrgent == false || urgent?.IsSubjectUrgent == false)
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false &&
|
||||||
|
t.Id != visitTaskId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId, u => new VisitTask() { IsUrgent = false });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (businessScenarioEnum == EmailBusinessScenario.PDConfirmed)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (businessScenarioEnum == EmailBusinessScenario.PDConfirmed)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//有序
|
|
||||||
|
|
||||||
if (taskInfo.IsReadingTaskViewInOrder)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
//有序
|
||||||
|
|
||||||
//双重
|
if (taskInfo.IsReadingTaskViewInOrder)
|
||||||
if (taskInfo.ReadingType == ReadingMethod.Double)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//仲裁在访视上 就没有全局阅片 没有阅片期
|
|
||||||
if (taskInfo.ArbitrationRule == ArbitrationRule.Visit)
|
//双重
|
||||||
|
if (taskInfo.ReadingType == ReadingMethod.Double)
|
||||||
{
|
{
|
||||||
//找到 访视,裁判 所有有效任务(不可能有全局的) 访视和裁判任务的SourceSubjectVisitId 一样
|
|
||||||
var taskList = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect &&
|
|
||||||
(t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
//这里要求 到这里已经如果有裁判 已经生成裁判了保存数据库
|
//仲裁在访视上 就没有全局阅片 没有阅片期
|
||||||
//双人阅片,没有产生裁判 第二个人读完发
|
if (taskInfo.ArbitrationRule == ArbitrationRule.Visit)
|
||||||
if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit) == 2)
|
|
||||||
{
|
{
|
||||||
|
//找到 访视,裁判 所有有效任务(不可能有全局的) 访视和裁判任务的SourceSubjectVisitId 一样
|
||||||
answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
var taskList = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect &&
|
||||||
|
(t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
//这里要求 到这里已经如果有裁判 已经生成裁判了保存数据库
|
||||||
|
//双人阅片,没有产生裁判 第二个人读完发
|
||||||
}
|
if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit) == 2)
|
||||||
//双人 产生裁判,并且裁判完成 发
|
|
||||||
else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1)
|
|
||||||
{
|
|
||||||
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
|
|
||||||
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
|
|
||||||
|
|
||||||
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
isNeedSend = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//仲裁在阅片期
|
|
||||||
else if (taskInfo.ArbitrationRule == ArbitrationRule.Reading)
|
|
||||||
{
|
|
||||||
//是访视任务 不可能是裁判任务(访视上不会生成裁判),也不会是全局任务(全局任务 SourceSubjectVisitId=null )
|
|
||||||
if (taskInfo.SourceSubjectVisitId != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
//访视类型的任务 根本就不需要发送邮件
|
|
||||||
|
|
||||||
isNeedSend = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
//是全局任务 或者全局的裁判任务 (如果是全局任务,那么此时裁判任务已经生成)
|
|
||||||
else if (taskInfo.SouceReadModuleId != null)
|
|
||||||
{
|
|
||||||
var taskList = await _visitTaskRepository.Where(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.SouceReadModuleId == taskInfo.SouceReadModuleId
|
|
||||||
&& (t.ReadingCategory == ReadingCategory.Global || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
|
||||||
|
|
||||||
//两个全局没有裁判
|
|
||||||
if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Global) == 2)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
||||||
|
|
||||||
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
|
||||||
}
|
|
||||||
//双人全局产生裁判
|
|
||||||
else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Global).Count() == 2)
|
|
||||||
{
|
|
||||||
|
|
||||||
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
|
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
||||||
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Global, taskInfo.CriterionType);
|
|
||||||
|
}
|
||||||
|
//双人 产生裁判,并且裁判完成 发
|
||||||
|
else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1)
|
||||||
|
{
|
||||||
|
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First()!.JudgeResultTaskId!.Value;
|
||||||
|
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
|
||||||
|
|
||||||
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
||||||
|
|
||||||
@@ -641,256 +481,350 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
isNeedSend = false;
|
isNeedSend = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//仲裁在阅片期
|
||||||
|
else if (taskInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||||
|
{
|
||||||
|
//是访视任务 不可能是裁判任务(访视上不会生成裁判),也不会是全局任务(全局任务 SourceSubjectVisitId=null )
|
||||||
|
if (taskInfo.SourceSubjectVisitId != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
//访视类型的任务 根本就不需要发送邮件
|
||||||
|
|
||||||
|
isNeedSend = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
//是全局任务 或者全局的裁判任务 (如果是全局任务,那么此时裁判任务已经生成)
|
||||||
|
else if (taskInfo.SouceReadModuleId != null)
|
||||||
|
{
|
||||||
|
var taskList = await _visitTaskRepository.Where(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.SouceReadModuleId == taskInfo.SouceReadModuleId
|
||||||
|
&& (t.ReadingCategory == ReadingCategory.Global || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
||||||
|
|
||||||
|
//两个全局没有裁判
|
||||||
|
if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Global) == 2)
|
||||||
|
{
|
||||||
|
|
||||||
|
answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
||||||
|
|
||||||
|
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
||||||
|
}
|
||||||
|
//双人全局产生裁判
|
||||||
|
else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Global).Count() == 2)
|
||||||
|
{
|
||||||
|
|
||||||
|
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId!.Value;
|
||||||
|
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Global, taskInfo.CriterionType);
|
||||||
|
|
||||||
|
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isNeedSend = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//---发送PD 进展邮件中发现任务数据有问题!
|
||||||
|
throw new BusinessValidationFailedException(_localizer["TrialEmailN_PDProgressEmailTask"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//---发送PD 进展邮件中发现任务数据有问题!
|
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_PDProgressEmailTask"]);
|
//---双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查!
|
||||||
|
throw new BusinessValidationFailedException(_localizer["TrialEmailN_DoubleBlindedError"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//屏蔽单重阅片添加
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
isNeedSend = false;
|
||||||
//---双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查!
|
return string.Empty;
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialEmailN_DoubleBlindedError"]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 发邮件屏蔽单重的
|
||||||
|
////单重
|
||||||
|
//else if (taskInfo.ReadingType == ReadingMethod.Single)
|
||||||
|
//{
|
||||||
|
// //仲裁在访视上 或者在阅片期
|
||||||
|
// if (taskInfo.ArbitrationRule != ArbitrationRule.None)
|
||||||
|
// {
|
||||||
|
|
||||||
|
//---单重有序阅片配置有误(不应该有仲裁对象配置),请核查!
|
||||||
|
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSet"]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// //要求PD 确认的访视 是截止访视 还是非截止访视(根据该访视有没有配置阅片期来判断)
|
||||||
|
|
||||||
|
// if (taskInfo.ReadingCategory == ReadingCategory.Visit)
|
||||||
|
// {
|
||||||
|
// //存在阅片期 那么就是截止访视
|
||||||
|
// if (await _repository.Where<ReadModule>(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.SubjectVisitId == taskInfo.SourceSubjectVisitId && t.ReadingSetType == ReadingSetType.ImageReading).AnyAsync())
|
||||||
|
// {
|
||||||
|
// isNeedSend = false;
|
||||||
|
// }
|
||||||
|
// else//非截止访视 在访视读完后,发送
|
||||||
|
// {
|
||||||
|
// answer = await TranslatePdStateAsync(visitTaskId, ReadingCategory.Visit, taskInfo.CriterionType);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //截止访视 在访视读完,并完成全局阅片后发送全局的结果
|
||||||
|
// else if (taskInfo.ReadingCategory == ReadingCategory.Global)
|
||||||
|
// {
|
||||||
|
// answer = await TranslatePdStateAsync(visitTaskId, ReadingCategory.Global, taskInfo.CriterionType);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
//---单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查!
|
||||||
|
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSequenced"]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
||||||
|
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
//---有序阅片配置有误(应为单重或者双重阅片),请核查!
|
||||||
|
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_BlindedSequencedReading"]);
|
||||||
|
//}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//屏蔽无序阅片添加
|
||||||
//屏蔽单重阅片添加
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isNeedSend = false;
|
isNeedSend = false;
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 发邮件屏蔽单重的
|
#region 发送邮件屏蔽无序的
|
||||||
////单重
|
// //无序
|
||||||
//else if (taskInfo.ReadingType == ReadingMethod.Single)
|
//else
|
||||||
//{
|
//{
|
||||||
// //仲裁在访视上 或者在阅片期
|
// //单重
|
||||||
// if (taskInfo.ArbitrationRule != ArbitrationRule.None)
|
|
||||||
// {
|
|
||||||
|
|
||||||
//---单重有序阅片配置有误(不应该有仲裁对象配置),请核查!
|
|
||||||
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSet"]);
|
// if (taskInfo.ReadingType == ReadingMethod.Single && taskInfo.ArbitrationRule == ArbitrationRule.None)
|
||||||
|
// {
|
||||||
|
// answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
||||||
|
|
||||||
|
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
||||||
// }
|
// }
|
||||||
|
// //双重 截止访视只在阅片期的时候存在 要求PD确认的访视 肯定是非截止访视
|
||||||
|
// else if (taskInfo.ReadingType == ReadingMethod.Double && taskInfo.ArbitrationRule == ArbitrationRule.Visit)
|
||||||
// //要求PD 确认的访视 是截止访视 还是非截止访视(根据该访视有没有配置阅片期来判断)
|
|
||||||
|
|
||||||
// if (taskInfo.ReadingCategory == ReadingCategory.Visit)
|
|
||||||
// {
|
// {
|
||||||
// //存在阅片期 那么就是截止访视
|
// //在两位阅片人读完访视后,如果有裁判者等裁判读完,如果无裁判则等第二个人的读完
|
||||||
// if (await _repository.Where<ReadModule>(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.SubjectVisitId == taskInfo.SourceSubjectVisitId && t.ReadingSetType == ReadingSetType.ImageReading).AnyAsync())
|
|
||||||
|
// var taskList = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect
|
||||||
|
// && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
||||||
|
|
||||||
|
// //这里要求 到这里已经如果有裁判 已经生成裁判了保存数据库
|
||||||
|
// if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit) == 2)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
||||||
|
|
||||||
|
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
||||||
|
// }
|
||||||
|
// else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1)
|
||||||
|
// {
|
||||||
|
// var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
|
||||||
|
// answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
|
||||||
|
|
||||||
|
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
// {
|
// {
|
||||||
// isNeedSend = false;
|
// isNeedSend = false;
|
||||||
// }
|
// }
|
||||||
// else//非截止访视 在访视读完后,发送
|
|
||||||
// {
|
|
||||||
// answer = await TranslatePdStateAsync(visitTaskId, ReadingCategory.Visit, taskInfo.CriterionType);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //截止访视 在访视读完,并完成全局阅片后发送全局的结果
|
|
||||||
// else if (taskInfo.ReadingCategory == ReadingCategory.Global)
|
|
||||||
// {
|
|
||||||
// answer = await TranslatePdStateAsync(visitTaskId, ReadingCategory.Global, taskInfo.CriterionType);
|
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
//---单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查!
|
//---无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查!
|
||||||
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSequenced"]);
|
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_UnblindedSequencedReading"]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
//---有序阅片配置有误(应为单重或者双重阅片),请核查!
|
|
||||||
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_BlindedSequencedReading"]);
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//屏蔽无序阅片添加
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isNeedSend = false;
|
isNeedSend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region MiniWord 组织字典 发送
|
||||||
|
|
||||||
|
|
||||||
|
if (emailStoreMode == EmailStoreSendMode.NotStoreLocalOnlySentEmail)
|
||||||
|
{
|
||||||
|
|
||||||
|
var phyPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, sendFileRelativePath);
|
||||||
|
|
||||||
|
var attachPrefix = $"{taskInfo.SubjectCode}";
|
||||||
|
|
||||||
|
//先预先生成了邮件,发送预先生成的邮件
|
||||||
|
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
|
{
|
||||||
|
FileName = $"{attachPrefix}_{Path.GetFileNameWithoutExtension(_userInfo.IsEn_Us ? trialEmailConfig.AttachName : trialEmailConfig!.AttachNameCN)}.pdf",
|
||||||
|
|
||||||
|
FileStream = File.OpenRead(phyPath),
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(sendEmailConfig);
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 发送邮件屏蔽无序的
|
var value = new Dictionary<string, object>()
|
||||||
// //无序
|
{
|
||||||
//else
|
["SponsorName"] = taskInfo.SponsorName,
|
||||||
//{
|
["ResearchProgramNo"] = taskInfo.ResearchProgramNo,
|
||||||
// //单重
|
["TrialSiteCode"] = taskInfo.TrialSiteCode,
|
||||||
|
["SubjectCode"] = taskInfo.SubjectCode,
|
||||||
|
["VisitName"] = taskInfo.SourceSubjectVisitId != null ? taskInfo.VisitName : taskInfo.ModuleVisitName,
|
||||||
|
["EarliestScanDate"] = taskInfo.SourceSubjectVisitId != null ? taskInfo.VisitEarliestScanDate?.ToString("yyyy-MM-dd") : taskInfo.ModuleEarliestScanDate?.ToString("yyyy-MM-dd"),
|
||||||
|
["SignTime"] = taskInfo.SignTime?.ToString("yyyy-MM-dd"),
|
||||||
|
["Result"] = answer
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var path = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, _userInfo.IsEn_Us ? trialEmailConfig.AttachPath : trialEmailConfig.AttachCNPath);
|
||||||
|
|
||||||
|
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId, true);
|
||||||
|
|
||||||
|
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
||||||
|
{
|
||||||
|
|
||||||
|
MemoryStream wordMemoryStream = new MemoryStream();
|
||||||
|
|
||||||
|
|
||||||
// if (taskInfo.ReadingType == ReadingMethod.Single && taskInfo.ArbitrationRule == ArbitrationRule.None)
|
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
|
||||||
// {
|
|
||||||
// answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List<Guid>() { visitTaskId }, minUserIdList);
|
{
|
||||||
// }
|
Document document = new Document();
|
||||||
// //双重 截止访视只在阅片期的时候存在 要求PD确认的访视 肯定是非截止访视
|
|
||||||
// else if (taskInfo.ReadingType == ReadingMethod.Double && taskInfo.ArbitrationRule == ArbitrationRule.Visit)
|
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
|
||||||
// {
|
|
||||||
// //在两位阅片人读完访视后,如果有裁判者等裁判读完,如果无裁判则等第二个人的读完
|
document.SaveToFile(serverFilePath, FileFormat.PDF);
|
||||||
|
}
|
||||||
// var taskList = await _visitTaskRepository.Where(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect
|
else
|
||||||
// && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Judge)).ToListAsync();
|
{
|
||||||
|
var wordStoreServerPath = Path.Combine(Path.GetDirectoryName(serverFilePath), Path.GetFileNameWithoutExtension(serverFilePath) + ".docx");
|
||||||
// //这里要求 到这里已经如果有裁判 已经生成裁判了保存数据库
|
|
||||||
// if (taskList.Count == 2 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit) == 2)
|
using (FileStream fileStream = new FileStream(wordStoreServerPath, FileMode.Create, FileAccess.Write))
|
||||||
// {
|
{
|
||||||
|
wordMemoryStream.WriteTo(fileStream);
|
||||||
// answer = await TranslatePdStateAsync(visitTaskId, taskInfo.ReadingCategory, taskInfo.CriterionType);
|
}
|
||||||
|
FileConvertHelper.ConvertWordToPdf(wordStoreServerPath, Path.GetDirectoryName(serverFilePath));
|
||||||
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
|
|
||||||
// }
|
File.Delete(wordStoreServerPath);
|
||||||
// else if (taskList.Count == 3 && taskList.Count(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) == 3 && taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Count() == 1)
|
}
|
||||||
// {
|
|
||||||
// var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
|
|
||||||
// answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
|
|
||||||
|
}
|
||||||
// isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
|
//手动生成发送的邮件内容,但是并不发送
|
||||||
|
if (emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
||||||
|
{
|
||||||
|
isNeedSend = false;
|
||||||
|
|
||||||
|
return relativePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//正常的即时生成邮件 并发送邮件
|
||||||
|
if (isNeedSend)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
MemoryStream wordMemoryStream = new MemoryStream();
|
||||||
|
MemoryStream pdfMemoryStream = new MemoryStream();
|
||||||
|
|
||||||
|
|
||||||
|
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
|
||||||
|
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
{
|
||||||
|
Document document = new Document();
|
||||||
|
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
|
||||||
|
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var wordStoreServerPath = Path.Combine(Path.GetDirectoryName(serverFilePath), Path.GetFileNameWithoutExtension(serverFilePath) + ".docx");
|
||||||
|
|
||||||
|
using (FileStream fileStream = new FileStream(wordStoreServerPath, FileMode.Create, FileAccess.Write))
|
||||||
|
{
|
||||||
|
wordMemoryStream.WriteTo(fileStream);
|
||||||
|
}
|
||||||
|
FileConvertHelper.ConvertWordToPdf(wordStoreServerPath, Path.GetDirectoryName(serverFilePath));
|
||||||
|
|
||||||
|
File.Delete(wordStoreServerPath);
|
||||||
|
|
||||||
|
using (FileStream fileStream = new FileStream(serverFilePath, FileMode.Open, FileAccess.Read))
|
||||||
|
{
|
||||||
|
fileStream.CopyTo(pdfMemoryStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pdfMemoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
|
{
|
||||||
|
FileName = $"{taskInfo.SubjectCode}_{Path.GetFileNameWithoutExtension(_userInfo.IsEn_Us ? trialEmailConfig.AttachName : trialEmailConfig.AttachNameCN)}.pdf",
|
||||||
|
|
||||||
|
FileStream = pdfMemoryStream
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(sendEmailConfig);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// isNeedSend = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
//---无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查!
|
|
||||||
// throw new BusinessValidationFailedException(_localizer["TrialEmailN_UnblindedSequencedReading"]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isNeedSend = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region MiniWord 组织字典 发送
|
|
||||||
|
|
||||||
|
|
||||||
if (emailStoreMode == EmailStoreSendMode.NotStoreLocalOnlySentEmail)
|
|
||||||
{
|
|
||||||
|
|
||||||
var phyPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, sendFileRelativePath);
|
|
||||||
|
|
||||||
|
|
||||||
//先预先生成了邮件,发送预先生成的邮件
|
|
||||||
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
|
||||||
{
|
|
||||||
FileName = $"{taskInfo.SubjectCode}_{Path.GetFileNameWithoutExtension(_userInfo.IsEn_Us ? emailConfig.AttachName : emailConfig.AttachNameCN)}.pdf",
|
|
||||||
|
|
||||||
FileStream = File.OpenRead(phyPath),
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(sendEmailConfig);
|
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
var value = new Dictionary<string, object>()
|
|
||||||
{
|
|
||||||
["SponsorName"] = taskInfo.SponsorName,
|
|
||||||
["ResearchProgramNo"] = taskInfo.ResearchProgramNo,
|
|
||||||
["TrialSiteCode"] = taskInfo.TrialSiteCode,
|
|
||||||
["SubjectCode"] = taskInfo.SubjectCode,
|
|
||||||
["VisitName"] = taskInfo.SourceSubjectVisitId != null ? taskInfo.VisitName : taskInfo.ModuleVisitName,
|
|
||||||
["EarliestScanDate"] = taskInfo.SourceSubjectVisitId != null ? taskInfo.VisitEarliestScanDate?.ToString("yyyy-MM-dd") : taskInfo.ModuleEarliestScanDate?.ToString("yyyy-MM-dd"),
|
|
||||||
["SignTime"] = taskInfo.SignTime?.ToString("yyyy-MM-dd"),
|
|
||||||
["Result"] = answer
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId, true);
|
|
||||||
|
|
||||||
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
|
||||||
{
|
|
||||||
|
|
||||||
MemoryStream wordMemoryStream = new MemoryStream();
|
|
||||||
|
|
||||||
Document document = new Document();
|
|
||||||
|
|
||||||
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
|
|
||||||
|
|
||||||
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
|
|
||||||
|
|
||||||
document.SaveToFile(serverFilePath, FileFormat.PDF);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//手动生成发送的邮件内容,但是并不发送
|
|
||||||
if (emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
|
||||||
{
|
|
||||||
isNeedSend = false;
|
|
||||||
|
|
||||||
return relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//正常的即时生成邮件 并发送邮件
|
|
||||||
if (isNeedSend)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
MemoryStream memoryStream = new MemoryStream();
|
|
||||||
MemoryStream pdfMemoryStream = new MemoryStream();
|
|
||||||
|
|
||||||
|
|
||||||
MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value);
|
|
||||||
Document document = new Document();
|
|
||||||
|
|
||||||
document.LoadFromStream(memoryStream, FileFormat.Docx);
|
|
||||||
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
|
|
||||||
pdfMemoryStream.Seek(0, SeekOrigin.Begin);
|
|
||||||
|
|
||||||
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
|
||||||
{
|
|
||||||
FileName = $"{taskInfo.SubjectCode}_{Path.GetFileNameWithoutExtension(_userInfo.IsEn_Us ? emailConfig.AttachName : emailConfig.AttachNameCN)}.pdf",
|
|
||||||
|
|
||||||
FileStream = pdfMemoryStream
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(sendEmailConfig);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return string.Empty;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,7 +961,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Visit);
|
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Visit);
|
||||||
|
|
||||||
var filePath = await BaseBusinessScenarioSendEmailAsync(task.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
var filePath = await BaseBusinessScenarioSendEmailAsync(task!.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
||||||
|
|
||||||
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
||||||
}
|
}
|
||||||
@@ -1036,7 +970,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Judge);
|
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Judge);
|
||||||
|
|
||||||
var filePath = await BaseBusinessScenarioSendEmailAsync(task.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
var filePath = await BaseBusinessScenarioSendEmailAsync(task!.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
||||||
|
|
||||||
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
||||||
}
|
}
|
||||||
@@ -1073,7 +1007,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Global);
|
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Global);
|
||||||
|
|
||||||
var filePath = await BaseBusinessScenarioSendEmailAsync(task.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
var filePath = await BaseBusinessScenarioSendEmailAsync(task!.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
||||||
|
|
||||||
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
||||||
}
|
}
|
||||||
@@ -1082,7 +1016,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Judge);
|
var task = taskList.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Judge);
|
||||||
|
|
||||||
var filePath = await BaseBusinessScenarioSendEmailAsync(task.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
var filePath = await BaseBusinessScenarioSendEmailAsync(task!.Id, true, EmailStoreSendMode.OnlyStoreLocalNotSentEmail, string.Empty);
|
||||||
|
|
||||||
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
return ResponseOutput.Ok(new { RelativePath = filePath, TaskName = task.TaskName, VisitTaskId = task.Id });
|
||||||
}
|
}
|
||||||
@@ -1388,13 +1322,14 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="queryEmailNoticeConfig"></param>
|
/// <param name="queryEmailNoticeConfig"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
||||||
{
|
{
|
||||||
var emailNoticeConfigQueryable = _emailNoticeConfigRepository
|
var emailNoticeConfigQueryable = _emailNoticeConfigRepository
|
||||||
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
||||||
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
||||||
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
||||||
|
.WhereIf(queryEmailNoticeConfig.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryEmailNoticeConfig.CriterionTypeEnum)
|
||||||
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = queryEmailNoticeConfig.TrialId });
|
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = queryEmailNoticeConfig.TrialId });
|
||||||
|
|
||||||
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
|
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
public bool IsReading { get; set; } = true;
|
public bool IsReading { get; set; } = true;
|
||||||
|
|
||||||
|
public string SliceThickness { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string ImageResizePath { get; set; }
|
public string ImageResizePath { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -38,8 +40,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public class DicomTrialSiteSubjectInfo
|
public class DicomTrialSiteSubjectInfo
|
||||||
{
|
{
|
||||||
public string TrialSiteCode { get; set; } = string.Empty;
|
public string TrialSiteCode { get; set; } = string.Empty;
|
||||||
public string SiteCode { get; set; } = string.Empty;
|
public string TrialSiteAliasName { get; set; } = string.Empty;
|
||||||
public string SiteName { get; set; } = string.Empty;
|
|
||||||
public string SubjectCode { get; set; } = string.Empty;
|
public string SubjectCode { get; set; } = string.Empty;
|
||||||
public int? SubjectAge { get; set; }
|
public int? SubjectAge { get; set; }
|
||||||
public string SubjectSex { get; set; } = string.Empty;
|
public string SubjectSex { get; set; } = string.Empty;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
//[JsonIgnore]
|
//[JsonIgnore]
|
||||||
//public int NoneDicomCode { get; set; }
|
//public int NoneDicomCode { get; set; }
|
||||||
|
|
||||||
|
public string RecordPath { get; set; } = string.Empty;
|
||||||
public bool IsDicom { get; set; }
|
public bool IsDicom { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +174,16 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string[]? VisitPlanArray { get; set; }
|
public string[]? VisitPlanArray { get; set; }
|
||||||
|
|
||||||
}
|
public Guid? VisitTaskId { get; set; }
|
||||||
|
|
||||||
|
public bool? IsDicom { get; set; }
|
||||||
|
|
||||||
|
public string? Uploader { get; set; }
|
||||||
|
|
||||||
|
public bool? IsSuccess { get; set; }
|
||||||
|
|
||||||
|
public string? StudyCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class PreArchiveDicomStudyCommand
|
public class PreArchiveDicomStudyCommand
|
||||||
@@ -215,6 +225,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public int FailedFileCount { get; set; }
|
public int FailedFileCount { get; set; }
|
||||||
|
|
||||||
|
public string RecordPath { get; set; }
|
||||||
|
|
||||||
public AddOrUpdateStudyDto Study { get; set; }
|
public AddOrUpdateStudyDto Study { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||||
private readonly IEasyCachingProvider _provider;
|
private readonly IEasyCachingProvider _provider;
|
||||||
|
|
||||||
private readonly IWebHostEnvironment _hostEnvironment;
|
|
||||||
|
|
||||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||||
|
|
||||||
@@ -31,12 +30,10 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
public DicomArchiveService(IRepository<DicomStudy> studyRepository,
|
public DicomArchiveService(IRepository<DicomStudy> studyRepository,
|
||||||
IRepository<DicomSeries> seriesRepository,
|
IRepository<DicomSeries> seriesRepository,
|
||||||
IRepository<DicomInstance> instanceRepository,
|
IRepository<DicomInstance> instanceRepository,
|
||||||
IWebHostEnvironment hostEnvironment,
|
|
||||||
IRepository<Dictionary> dictionaryRepository,
|
IRepository<Dictionary> dictionaryRepository,
|
||||||
IEasyCachingProvider provider, IDistributedLockProvider distributedLockProvider)
|
IEasyCachingProvider provider, IDistributedLockProvider distributedLockProvider)
|
||||||
{
|
{
|
||||||
_distributedLockProvider = distributedLockProvider;
|
_distributedLockProvider = distributedLockProvider;
|
||||||
_hostEnvironment = hostEnvironment;
|
|
||||||
_studyRepository = studyRepository;
|
_studyRepository = studyRepository;
|
||||||
|
|
||||||
_seriesRepository = seriesRepository;
|
_seriesRepository = seriesRepository;
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
studyMonitor.UploadFinishedTime = DateTime.Now;
|
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||||
studyMonitor.IsSuccess = true;
|
studyMonitor.IsSuccess = incommand.FailedFileCount==0;
|
||||||
|
studyMonitor.RecordPath=incommand.RecordPath;
|
||||||
|
|
||||||
//上传
|
//上传
|
||||||
if (studyMonitor.IsDicomReUpload == false)
|
if (studyMonitor.IsDicomReUpload == false)
|
||||||
@@ -209,6 +210,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
series.SubjectId = incommand.SubjectId;
|
series.SubjectId = incommand.SubjectId;
|
||||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||||
|
|
||||||
|
//前端传递的数量不准,上传的时候,把失败的也加进来了,以实际数组的数字为准
|
||||||
|
series.InstanceCount = seriesItem.InstanceList.Count;
|
||||||
|
|
||||||
await _dicomSeriesRepository.AddAsync(series);
|
await _dicomSeriesRepository.AddAsync(series);
|
||||||
|
|
||||||
foreach (var instanceItem in seriesItem.InstanceList)
|
foreach (var instanceItem in seriesItem.InstanceList)
|
||||||
@@ -241,6 +245,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
|
|
||||||
var study = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
var study = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||||
|
|
||||||
|
//重传的时候也要赋值检查Id
|
||||||
|
studyMonitor.StudyId = study.Id;
|
||||||
|
studyMonitor.StudyCode = study.StudyCode;
|
||||||
|
|
||||||
//特殊处理逻辑
|
//特殊处理逻辑
|
||||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(study.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(study.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
||||||
@@ -457,6 +464,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||||
|
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom )
|
||||||
|
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
|
||||||
|
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
|
||||||
|
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.StudyCode), t => t.StudyCode.Contains(studyQuery.StudyCode))
|
||||||
.Select(t => new UnionStudyMonitorModel()
|
.Select(t => new UnionStudyMonitorModel()
|
||||||
{
|
{
|
||||||
TrialId = t.TrialId,
|
TrialId = t.TrialId,
|
||||||
@@ -489,7 +500,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
ArchiveFinishedTime = t.ArchiveFinishedTime,
|
ArchiveFinishedTime = t.ArchiveFinishedTime,
|
||||||
|
|
||||||
|
|
||||||
|
RecordPath=t.RecordPath,
|
||||||
|
|
||||||
IsDicomReUpload = t.IsDicomReUpload,
|
IsDicomReUpload = t.IsDicomReUpload,
|
||||||
StudyId = t.Id,
|
StudyId = t.Id,
|
||||||
@@ -723,7 +734,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
{
|
{
|
||||||
|
|
||||||
// $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误",
|
// $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误",
|
||||||
result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitBeforePrevError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), before?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid });
|
result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitBeforePrevError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")!, before?.ToString("yyyy-MM-dd")!], StudyInstanceUid = waitUploadItem.StudyInstanceUid });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,7 +744,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
if (after != null && waitUploadItem.StudyDate != null && after < waitUploadItem.StudyDate)
|
if (after != null && waitUploadItem.StudyDate != null && after < waitUploadItem.StudyDate)
|
||||||
{
|
{
|
||||||
// $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误"
|
// $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误"
|
||||||
result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitAfterSubseqError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), after?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid });
|
result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitAfterSubseqError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")!, after?.ToString("yyyy-MM-dd")!], StudyInstanceUid = waitUploadItem.StudyInstanceUid });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
||||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
||||||
|
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t=>t.FailedFileCount>0)))
|
||||||
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()) ));
|
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()) ));
|
||||||
|
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<DicomInstance, DicomInstanceDTO>()
|
CreateMap<DicomInstance, DicomInstanceDTO>()
|
||||||
.ForMember(o => o.IsDeleted, t => t.MapFrom(u => u.DicomSerie.IsDeleted))
|
.ForMember(o => o.IsDeleted, t => t.MapFrom(u => u.DicomSerie.IsDeleted))
|
||||||
|
.ForMember(o => o.SliceThickness, t => t.MapFrom(u => u.DicomSerie.SliceThickness))
|
||||||
.ForMember(o => o.IsReading, t => t.MapFrom(u => u.DicomSerie.IsReading));
|
.ForMember(o => o.IsReading, t => t.MapFrom(u => u.DicomSerie.IsReading));
|
||||||
CreateMap<DicomStudy, DicomStudyDTO>();
|
CreateMap<DicomStudy, DicomStudyDTO>();
|
||||||
CreateMap<DicomSeries, DicomSeriesDTO>();
|
CreateMap<DicomSeries, DicomSeriesDTO>();
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||||||
public T Data { get; set; }
|
public T Data { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public SignDTO SignInfo { get; set; }
|
public SignDTO? SignInfo { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//找到上一条Id
|
//找到上一条Id
|
||||||
|
|
||||||
|
|
||||||
var currentInspection = await _dataInspectionRepository.Where(t => t.Id == id).Select(t => new { t.GeneralId, t.ObjectRelationParentId, t.CreateTime }).FirstOrDefaultAsync();
|
var currentInspection = await _dataInspectionRepository.Where(t => t.Id == id).Select(t => new { t.GeneralId, t.ObjectRelationParentId, t.CreateTime }).FirstNotNullAsync();
|
||||||
|
|
||||||
var beforeId = await _dataInspectionRepository.Where(x => x.GeneralId == currentInspection.GeneralId && x.CreateTime <= currentInspection.CreateTime && x.Id != id).OrderByDescending(x => x.CreateTime).Select(t => t.Id)
|
var beforeId = await _dataInspectionRepository.Where(x => x.GeneralId == currentInspection.GeneralId && x.CreateTime <= currentInspection.CreateTime && x.Id != id).OrderByDescending(x => x.CreateTime).Select(t => t.Id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
@@ -214,11 +214,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 翻译稽查数据
|
/// 翻译稽查数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dto">传入Dto</param>
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="currentInspectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<List<string>> SetInspectionEnumValueDataList(SetInspectionEnumValueDto dto, Guid currentInspectionId)
|
private async Task<List<string>> SetInspectionEnumValueDataList(SetInspectionEnumValueDto dto, Guid currentInspectionId)
|
||||||
{
|
{
|
||||||
@@ -241,7 +241,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var listIdentification = auditDatas.Select(x => x.Identification).Distinct().ToList();
|
var listIdentification = auditDatas.Select(x => x.Identification).Distinct().ToList();
|
||||||
foreach (var item in auditDatas)
|
foreach (var item in auditDatas)
|
||||||
{
|
{
|
||||||
Dictionary<string, object> jsonDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(item.JsonStr);
|
Dictionary<string, object> jsonDict = (JsonConvert.DeserializeObject<Dictionary<string, object>>(item.JsonStr)).IfNullThrowException();
|
||||||
|
|
||||||
if (!jsonDict.ContainsKey(nameof(InspectionJsonDetail.CommonData)))
|
if (!jsonDict.ContainsKey(nameof(InspectionJsonDetail.CommonData)))
|
||||||
{
|
{
|
||||||
@@ -319,9 +319,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
str = await GetInspectionEnumValue(listIdentification, str);
|
str = await GetInspectionEnumValue(listIdentification, item.Identification, str);
|
||||||
str = await SetEnum(dto.TrialId, listIdentification, str);
|
str = await SetEnum(dto.TrialId, listIdentification, item.Identification, str);
|
||||||
str = await SetDataInspectionDateType(listIdentification, str);
|
str = await SetDataInspectionDateType(listIdentification, item.Identification, str);
|
||||||
|
|
||||||
jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject<object>(str);
|
jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject<object>(str);
|
||||||
|
|
||||||
@@ -331,9 +331,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
str2 = await GetInspectionEnumValue(listIdentification, str2);
|
str2 = await GetInspectionEnumValue(listIdentification, item.Identification, str2);
|
||||||
str2 = await SetEnum(dto.TrialId, listIdentification, str2);
|
str2 = await SetEnum(dto.TrialId, listIdentification, item.Identification, str2);
|
||||||
str2 = await SetDataInspectionDateType(listIdentification, str2);
|
str2 = await SetDataInspectionDateType(listIdentification, item.Identification, str2);
|
||||||
|
|
||||||
jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject<object>(str2);
|
jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject<object>(str2);
|
||||||
#endregion
|
#endregion
|
||||||
@@ -366,7 +366,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
resultJsonStrList.Add(auditData?.JsonStr);
|
resultJsonStrList.Add(auditData?.JsonStr);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (resultJsonStrList.Count() < 2)
|
if (resultJsonStrList.Count < 2)
|
||||||
{
|
{
|
||||||
resultJsonStrList.Add(String.Empty);
|
resultJsonStrList.Add(String.Empty);
|
||||||
}
|
}
|
||||||
@@ -386,7 +386,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
if (relationParentInspection != null)
|
if (relationParentInspection != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
Dictionary<string, object> jsonDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail);
|
Dictionary<string, object> jsonDic = (JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail)).IfNullThrowConvertException();
|
||||||
|
|
||||||
|
|
||||||
//避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀
|
//避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀
|
||||||
@@ -456,20 +456,23 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <param name="identificationList"></param>
|
/// <param name="identificationList"></param>
|
||||||
/// <param name="jsonStr"></param>
|
/// <param name="jsonStr"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<string> SetDataInspectionDateType(List<string> identificationList, string jsonStr)
|
private async Task<string> SetDataInspectionDateType(List<string> identificationList,string identification, string jsonStr)
|
||||||
{
|
{
|
||||||
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identificationList.Contains(x.Identification))
|
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identificationList.Contains(x.Identification))
|
||||||
join child in _frontAuditConfigRepository.AsQueryable().Where(x => x.EnumType == "Date" && x.IsEnable) on parent.Id equals child.ParentId
|
join child in _frontAuditConfigRepository.AsQueryable().Where(x => x.EnumType == "Date" && x.IsEnable) on parent.Id equals child.ParentId
|
||||||
select new DateDto()
|
select new DateDto()
|
||||||
{
|
{
|
||||||
Code = child.Code,
|
Identification= parent.Identification,
|
||||||
|
|
||||||
|
Code = child.Code,
|
||||||
DateType = child.DateType,
|
DateType = child.DateType,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
list = list.GroupBy(x => new { x.Code }, (key, lst) => new DateDto()
|
list = list.GroupBy(x => new { x.Code }, (key, lst) => new DateDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
Code = key.Code,
|
Code = key.Code,
|
||||||
DateType = lst.Max(x => x.DateType),
|
DateType = lst.FirstOrDefault(y => y.Identification == identification)?.DateType ?? lst.Max(x => x.DateType),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
|
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
|
||||||
@@ -519,27 +522,29 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
///// <param name="ForeignKeyValue">外键value</param>
|
///// <param name="ForeignKeyValue">外键value</param>
|
||||||
///// <param name="ForeignKeyText">要查询的外键值</param>
|
///// <param name="ForeignKeyText">要查询的外键值</param>
|
||||||
///// <param name="value">传入的纸</param>
|
///// <param name="value">传入的纸</param>
|
||||||
private async Task<string> GetInspectionEnumValue(List<string> identificationList, string jsonStr)
|
private async Task<string> GetInspectionEnumValue(List<string> identificationList,string identification, string jsonStr)
|
||||||
{
|
{
|
||||||
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
|
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
|
||||||
join p in _frontAuditConfigRepository.Where(x => x.EnumType == "Foreign" && x.IsEnable) on u.Id equals p.ParentId
|
join p in _frontAuditConfigRepository.Where(x => x.EnumType == "Foreign" && x.IsEnable) on u.Id equals p.ParentId
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
Key = p.Code,
|
Key = p.Code,
|
||||||
ForeignKeyValue = p.ForeignKeyValue,
|
Identification=u.Identification,
|
||||||
|
ForeignKeyValue = p.ForeignKeyValue,
|
||||||
ForeignKeyText = p.ForeignKeyText,
|
ForeignKeyText = p.ForeignKeyText,
|
||||||
ForeignKeyTable = p.ForeignKeyTableName
|
ForeignKeyTable = p.ForeignKeyTableName
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
|
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
|
||||||
{
|
{
|
||||||
Key = key.Key,
|
Key = key.Key,
|
||||||
ForeignKeyValue = lst.Max(x => x.ForeignKeyValue),
|
Identification=string.Empty,
|
||||||
ForeignKeyText = lst.Max(x => x.ForeignKeyText),
|
ForeignKeyValue= lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyValue ?? lst.Max(x => x.ForeignKeyValue),
|
||||||
ForeignKeyTable = lst.Max(x => x.ForeignKeyTable),
|
ForeignKeyText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyText ?? lst.Max(x => x.ForeignKeyText),
|
||||||
|
ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable),
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var jsonDataValueDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
|
var jsonDataValueDic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr)).IfNullThrowConvertException();
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
if (!jsonDataValueDic.ContainsKey(item.Key))
|
if (!jsonDataValueDic.ContainsKey(item.Key))
|
||||||
@@ -585,7 +590,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <param name="identificationList">标识</param>
|
/// <param name="identificationList">标识</param>
|
||||||
/// <param name="jsonStr">Json对象</param>
|
/// <param name="jsonStr">Json对象</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string jsonStr)
|
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string identification, string jsonStr)
|
||||||
{
|
{
|
||||||
if (jsonStr == null || jsonStr == "null")
|
if (jsonStr == null || jsonStr == "null")
|
||||||
{
|
{
|
||||||
@@ -598,27 +603,41 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
join p in _frontAuditConfigRepository.Where(x => (x.DictionaryCode != string.Empty && x.EnumType == "Dictionary") || (x.DataType == "Table") && x.IsEnable) on u.Id equals p.ParentId
|
join p in _frontAuditConfigRepository.Where(x => (x.DictionaryCode != string.Empty && x.EnumType == "Dictionary") || (x.DataType == "Table") && x.IsEnable) on u.Id equals p.ParentId
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
//前端展示类型
|
Key = p.Code,
|
||||||
DataType = p.DataType,
|
Identification = u.Identification,
|
||||||
TableConfigJsonStr = p.TableConfigJsonStr,
|
//前端展示类型
|
||||||
Key = p.Code,
|
DataType = p.DataType,
|
||||||
|
|
||||||
|
TableConfigJsonStr = p.TableConfigJsonStr,
|
||||||
|
|
||||||
Code = p.DictionaryCode,
|
Code = p.DictionaryCode,
|
||||||
Type = p.DictionaryType
|
Type = p.DictionaryType
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
//两条不同的标识 但是里面配置有相同的翻译字典
|
//两条不同的标识 但是里面配置有相同的翻译字典
|
||||||
list = list.Distinct().ToList();
|
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
|
||||||
|
{
|
||||||
|
Key = key.Key,
|
||||||
|
Identification = string.Empty,
|
||||||
|
DataType = lst.FirstOrDefault(y => y.Identification == identification)?.DataType ?? lst.Max(x => x.DataType),
|
||||||
|
TableConfigJsonStr = lst.FirstOrDefault(y => y.Identification == identification)?.TableConfigJsonStr ?? lst.Max(x => x.TableConfigJsonStr),
|
||||||
|
Code = lst.FirstOrDefault(y => y.Identification == identification)?.Code ?? lst.Max(x => x.Code),
|
||||||
|
Type = lst.FirstOrDefault(y => y.Identification == identification)?.Type ?? lst.Max(x => x.Type),
|
||||||
|
|
||||||
// 添加单双审
|
|
||||||
var trialtype = await _trialRepository.AsQueryable().Where(x => x.Id == trialId).Select(x => x.QCProcessEnum).FirstOrDefaultAsync();
|
}).ToList();
|
||||||
|
|
||||||
|
// 添加单双审
|
||||||
|
var trialtype = await _trialRepository.AsQueryable().Where(x => x.Id == trialId).Select(x => x.QCProcessEnum).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (!list.Any(x => x.Key == "AuditState"))
|
if (!list.Any(x => x.Key == "AuditState"))
|
||||||
{
|
{
|
||||||
list.Add(new
|
list.Add(new
|
||||||
{
|
{
|
||||||
DataType = string.Empty,
|
Key = "AuditState",
|
||||||
TableConfigJsonStr = string.Empty,
|
Identification = string.Empty,
|
||||||
Key = "AuditState",
|
DataType = string.Empty,
|
||||||
|
TableConfigJsonStr = string.Empty,
|
||||||
Code = trialtype == TrialQCProcess.SingleAudit ? "AuditStatePE" : "AuditStateRC",
|
Code = trialtype == TrialQCProcess.SingleAudit ? "AuditStatePE" : "AuditStateRC",
|
||||||
Type = "Code",
|
Type = "Code",
|
||||||
});
|
});
|
||||||
@@ -881,7 +900,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
DateType = child.DateType,
|
DateType = child.DateType,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(Data.JsonDetail);
|
var JsonData = (JsonConvert.DeserializeObject<IDictionary<string, object>>(Data.JsonDetail)).IfNullThrowException();
|
||||||
|
|
||||||
foreach (var item in JsonData.Keys)
|
foreach (var item in JsonData.Keys)
|
||||||
{
|
{
|
||||||
@@ -892,12 +911,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
if (datefirst.DateType == FrontAuditDateType.Date.GetDescription())
|
if (datefirst.DateType == FrontAuditDateType.Date.GetDescription())
|
||||||
{
|
{
|
||||||
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd");
|
JsonData[item] = DateTime.Parse(JsonData[item].ToString()!).ToString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (datefirst.DateType == FrontAuditDateType.DateTime.GetDescription())
|
if (datefirst.DateType == FrontAuditDateType.DateTime.GetDescription())
|
||||||
{
|
{
|
||||||
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
|
JsonData[item] = DateTime.Parse(JsonData[item].ToString()!).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
@@ -1076,7 +1095,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<string>> GetModuleTypeDescriptionList(Guid moduleTypeId)
|
public async Task<List<string>> GetModuleTypeDescriptionList(Guid moduleTypeId)
|
||||||
{
|
{
|
||||||
var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.DescriptionCN, x.Sort }).OrderBy(t => t.Sort).Select(t => _userInfo.IsEn_Us? t.Description:t.DescriptionCN).Distinct().ToListAsync();
|
var result =( await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.DescriptionCN, x.Sort }).OrderBy(t => t.Sort).ToListAsync()
|
||||||
|
).Select(t => _userInfo.IsEn_Us? t.Description:t.DescriptionCN).Distinct().ToList();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||||||
{
|
{
|
||||||
//_repository.GetQueryable.GetQueryable < DataInspection >
|
//_repository.GetQueryable.GetQueryable < DataInspection >
|
||||||
|
|
||||||
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == dto.TrialId).AsNoTracking().FirstOrDefaultAsync();
|
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == dto.TrialId).AsNoTracking().FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
trialData.TrialFinishTime = trialData.TrialFinishTime == null ? DateTime.Now : trialData.TrialFinishTime;
|
trialData.TrialFinishTime = trialData.TrialFinishTime == null ? DateTime.Now : trialData.TrialFinishTime;
|
||||||
@@ -84,9 +84,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||||||
data.Identification.ToLower()
|
data.Identification.ToLower()
|
||||||
equals
|
equals
|
||||||
leftfrontAuditConfig.Identification.ToLower()
|
leftfrontAuditConfig.Identification.ToLower()
|
||||||
join moduleTypec in _repository.GetQueryable<Dictionary>() on new { ModuleType = leftfrontAuditConfig.ModuleTypeId.Value } equals new { ModuleType = moduleTypec.Id } into moduleTypectemp
|
join moduleTypec in _repository.GetQueryable<Dictionary>() on new { ModuleType = leftfrontAuditConfig.ModuleTypeId!.Value } equals new { ModuleType = moduleTypec.Id } into moduleTypectemp
|
||||||
from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty()
|
from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty()
|
||||||
join OptTypec in _repository.GetQueryable<Dictionary>() on new { ModuleType = leftfrontAuditConfig.OptTypeId.Value } equals new { ModuleType = OptTypec.Id } into optTypetemp
|
join OptTypec in _repository.GetQueryable<Dictionary>() on new { ModuleType = leftfrontAuditConfig.OptTypeId!.Value } equals new { ModuleType = OptTypec.Id } into optTypetemp
|
||||||
from leftOptType in optTypetemp.DefaultIfEmpty()
|
from leftOptType in optTypetemp.DefaultIfEmpty()
|
||||||
|
|
||||||
select new GetDataInspectionOutDto()
|
select new GetDataInspectionOutDto()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using IRaCIS.Core.Infrastructure.Extention;
|
|||||||
|
|
||||||
namespace IRaCIS.Application.Contracts
|
namespace IRaCIS.Application.Contracts
|
||||||
{
|
{
|
||||||
public class SiteDTO: SiteCommand
|
public class SiteDTO : SiteCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,9 @@ namespace IRaCIS.Application.Contracts
|
|||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string SiteName { get; set; } = String.Empty;
|
public string SiteName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string SiteNameCN { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string City { get; set; } = String.Empty;
|
public string City { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string Province { get; set; } = string.Empty;
|
public string Province { get; set; } = string.Empty;
|
||||||
|
|||||||
@@ -3,18 +3,20 @@ using IRaCIS.Application.Contracts;
|
|||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using Microsoft.Data.Sqlite;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
[ ApiExplorerSettings(GroupName = "Institution")]
|
[ApiExplorerSettings(GroupName = "Institution")]
|
||||||
public class HospitalService : BaseService, IHospitalService
|
public class HospitalService : BaseService, IHospitalService
|
||||||
{
|
{
|
||||||
private readonly IRepository<Hospital> _hospitalRepository;
|
private readonly IRepository<Hospital> _hospitalRepository;
|
||||||
|
private readonly IRepository<Site> _siteRepository;
|
||||||
|
|
||||||
public HospitalService(IRepository<Hospital> hospitalRepository )
|
public HospitalService(IRepository<Hospital> hospitalRepository, IRepository<Site> siteRepository)
|
||||||
{
|
{
|
||||||
_hospitalRepository = hospitalRepository;
|
_hospitalRepository = hospitalRepository;
|
||||||
|
_siteRepository = siteRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 获取所有医院列表 </summary>
|
/// <summary> 获取所有医院列表 </summary>
|
||||||
@@ -37,13 +39,24 @@ namespace IRaCIS.Application.Services
|
|||||||
var exp1 = new EntityVerifyExp<Hospital>()
|
var exp1 = new EntityVerifyExp<Hospital>()
|
||||||
{
|
{
|
||||||
VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null,
|
VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null,
|
||||||
//---已经存在同名的医院,请确认。
|
//---当前中心已经添加到其他医院了。
|
||||||
VerifyMsg = _localizer["Hospital_SiteAdded"]
|
VerifyMsg = _localizer["Hospital_SiteAdded"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp,exp1);
|
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp, exp1);
|
||||||
|
|
||||||
|
//手动解绑医院与site的关系
|
||||||
|
if (hospitalCommand.SiteId == null && hospital.SiteId != null)
|
||||||
|
{
|
||||||
|
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospital.SiteId, u => new Site() { HospitalId = null });
|
||||||
|
}
|
||||||
|
|
||||||
|
//手动绑
|
||||||
|
if (hospitalCommand.SiteId != null)
|
||||||
|
{
|
||||||
|
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospitalCommand.SiteId, u => new Site() { HospitalId = hospital.Id });
|
||||||
|
}
|
||||||
return ResponseOutput.Ok(hospital.Id.ToString());
|
return ResponseOutput.Ok(hospital.Id.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -55,11 +68,6 @@ namespace IRaCIS.Application.Services
|
|||||||
public async Task<IResponseOutput> DeleteHospital(Guid hospitalId)
|
public async Task<IResponseOutput> DeleteHospital(Guid hospitalId)
|
||||||
{
|
{
|
||||||
|
|
||||||
//if (_userRepository.Find().Any(t => t.OrganizationId == hospitalId))
|
|
||||||
//{
|
|
||||||
// return ResponseOutput.NotOk("该医院下存在用户,暂时无法删除。");
|
|
||||||
//}
|
|
||||||
|
|
||||||
var success = await _hospitalRepository.BatchDeleteNoTrackingAsync(x => x.Id == hospitalId);
|
var success = await _hospitalRepository.BatchDeleteNoTrackingAsync(x => x.Id == hospitalId);
|
||||||
|
|
||||||
return ResponseOutput.Result(success);
|
return ResponseOutput.Result(success);
|
||||||
@@ -67,12 +75,12 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
/// <summary> 分页获取医院列表 </summary>
|
/// <summary> 分页获取医院列表 </summary>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
||||||
{
|
{
|
||||||
|
|
||||||
var hospitalQueryable =
|
var hospitalQueryable =
|
||||||
_hospitalRepository
|
_hospitalRepository
|
||||||
.WhereIf(hospitalSearchModel.HospitalName!=null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
.WhereIf(hospitalSearchModel.HospitalName != null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
||||||
.WhereIf(hospitalSearchModel.City != null, t => t.City.Contains(hospitalSearchModel.City!) || t.HospitalNameCN.Contains(hospitalSearchModel.City!))
|
.WhereIf(hospitalSearchModel.City != null, t => t.City.Contains(hospitalSearchModel.City!) || t.HospitalNameCN.Contains(hospitalSearchModel.City!))
|
||||||
.WhereIf(hospitalSearchModel.Province != null, t => t.Province.Contains(hospitalSearchModel.Province!) || t.HospitalNameCN.Contains(hospitalSearchModel.Province!))
|
.WhereIf(hospitalSearchModel.Province != null, t => t.Province.Contains(hospitalSearchModel.Province!) || t.HospitalNameCN.Contains(hospitalSearchModel.Province!))
|
||||||
.ProjectTo<HospitalDTO>(_mapper.ConfigurationProvider);
|
.ProjectTo<HospitalDTO>(_mapper.ConfigurationProvider);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using IRaCIS.Core.Infra.EFCore;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
@@ -13,12 +14,14 @@ namespace IRaCIS.Application.Services
|
|||||||
private readonly IRepository<Site> _siteRepository;
|
private readonly IRepository<Site> _siteRepository;
|
||||||
private readonly IRepository<TrialSiteUser> _trialSiteUserRepository;
|
private readonly IRepository<TrialSiteUser> _trialSiteUserRepository;
|
||||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||||
|
private readonly IRepository<Hospital> _hospitalRepository;
|
||||||
|
|
||||||
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider)
|
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider, IRepository<Hospital> hospitalRepository)
|
||||||
{
|
{
|
||||||
_siteRepository = siteRepository;
|
_siteRepository = siteRepository;
|
||||||
_trialSiteUserRepository = trialSiteUserRepository;
|
_trialSiteUserRepository = trialSiteUserRepository;
|
||||||
_distributedLockProvider = distributedLockProvider;
|
_distributedLockProvider = distributedLockProvider;
|
||||||
|
_hospitalRepository = hospitalRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 分页获取研究中心列表 </summary>
|
/// <summary> 分页获取研究中心列表 </summary>
|
||||||
@@ -31,8 +34,8 @@ namespace IRaCIS.Application.Services
|
|||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.AliasName), t => t.AliasName.Contains(searchModel.AliasName))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.AliasName), t => t.AliasName.Contains(searchModel.AliasName))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Country.Contains(searchModel.Province))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
||||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider);
|
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||||
|
|
||||||
|
|
||||||
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
||||||
@@ -67,20 +70,27 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
siteCommand.Code = await _siteRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1;
|
siteCommand.Code = await _siteRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1;
|
||||||
|
|
||||||
siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(User));
|
siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(Site));
|
||||||
}
|
}
|
||||||
|
|
||||||
var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);
|
var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);
|
||||||
|
|
||||||
|
//手动解绑医院与site的关系
|
||||||
|
if (siteCommand.HospitalId == null && site.HospitalId != null)
|
||||||
|
{
|
||||||
|
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == site.HospitalId, u => new Hospital() { SiteId = null });
|
||||||
|
}
|
||||||
|
|
||||||
|
//手动绑
|
||||||
|
if (siteCommand.HospitalId != null)
|
||||||
|
{
|
||||||
|
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok(site.Id.ToString());
|
return ResponseOutput.Ok(site.Id.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 删除研究中心 </summary>
|
/// <summary> 删除研究中心 </summary>
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
public Guid? LoginUserId { get; set; }
|
public Guid? LoginUserId { get; set; }
|
||||||
|
|
||||||
public Guid? OptUserId { get; set; }
|
public Guid? OptUserId { get; set; }
|
||||||
|
|
||||||
|
public string IPRegion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
///<summary>UserLogQuery 列表查询参数模型</summary>
|
///<summary>UserLogQuery 列表查询参数模型</summary>
|
||||||
@@ -47,10 +49,17 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
|
|
||||||
public string? LoginFaildName { get; set; }
|
public string? LoginFaildName { get; set; }
|
||||||
|
|
||||||
|
public string? LoginUserName { get; set; }
|
||||||
|
|
||||||
public DateTime? BeginDate { get; set; }
|
public DateTime? BeginDate { get; set; }
|
||||||
|
|
||||||
public DateTime? EndDate { get; set; }
|
public DateTime? EndDate { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? LoginUserTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public Guid? UserTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid? UserId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using Microsoft.Identity.Client;
|
|||||||
using static IRaCIS.Core.Domain.Share.StaticData;
|
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
|
using EasyCaching.Core;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
@@ -25,7 +26,7 @@ namespace IRaCIS.Application.Services
|
|||||||
private readonly IRepository<UserLog> _userLogRepository;
|
private readonly IRepository<UserLog> _userLogRepository;
|
||||||
|
|
||||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IEasyCachingProvider _cache;
|
||||||
|
|
||||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
IMailVerificationService mailVerificationService,
|
IMailVerificationService mailVerificationService,
|
||||||
IRepository<VerificationCode> verificationCodeRepository,
|
IRepository<VerificationCode> verificationCodeRepository,
|
||||||
IMemoryCache cache,
|
IEasyCachingProvider cache,
|
||||||
IRepository<TrialUser> userTrialRepository,
|
IRepository<TrialUser> userTrialRepository,
|
||||||
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
|
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
|
||||||
IRepository<UserLog> userLogRepository
|
IRepository<UserLog> userLogRepository
|
||||||
@@ -128,7 +129,7 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
|
|
||||||
//检查手机或者邮箱是否有效
|
//检查手机或者邮箱是否有效
|
||||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
|
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||||
{
|
{
|
||||||
//---Please input a legal email
|
//---Please input a legal email
|
||||||
return ResponseOutput.NotOk(_localizer["User_LegalEmail"]);
|
return ResponseOutput.NotOk(_localizer["User_LegalEmail"]);
|
||||||
@@ -310,7 +311,7 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
|
|
||||||
//检查手机或者邮箱是否有效
|
//检查手机或者邮箱是否有效
|
||||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
|
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||||
{
|
{
|
||||||
|
|
||||||
//---请输入一个正确的邮箱。
|
//---请输入一个正确的邮箱。
|
||||||
@@ -629,7 +630,7 @@ namespace IRaCIS.Application.Services
|
|||||||
string cacheKey = $"{cachePrefix}{userName}";
|
string cacheKey = $"{cachePrefix}{userName}";
|
||||||
|
|
||||||
// 从缓存中获取登录失败次数
|
// 从缓存中获取登录失败次数
|
||||||
int? failCount = _cache.Get<int?>(cacheKey);
|
int? failCount = _cache.Get<int?>(cacheKey).Value;
|
||||||
|
|
||||||
if (failCount == null)
|
if (failCount == null)
|
||||||
{
|
{
|
||||||
@@ -644,7 +645,8 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId = Guid.Empty, LoginFaildName = userName,LoginPassword=password, OptType = UserOptType.AccountLocked }, true);
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId = Guid.Empty, LoginFaildName = userName,LoginPassword=password, OptType = UserOptType.AccountLocked }, true);
|
||||||
|
|
||||||
throw new BusinessValidationFailedException($"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。");
|
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
||||||
|
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var userLoginReturnModel = new LoginReturnDTO();
|
var userLoginReturnModel = new LoginReturnDTO();
|
||||||
@@ -659,7 +661,9 @@ namespace IRaCIS.Application.Services
|
|||||||
failCount++;
|
failCount++;
|
||||||
_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||||
|
|
||||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId=Guid.Empty, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
var errorPwdUserId = await _userRepository.Where(u => u.UserName == userName).Select(t => t.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = errorPwdUserId, OptUserId=Guid.Empty, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
||||||
|
|
||||||
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
|
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
|
||||||
|
|
||||||
@@ -692,15 +696,22 @@ namespace IRaCIS.Application.Services
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<UserLogView>> GetUserLogList(UserLogQuery inQuery)
|
public async Task<PageOutput<UserLogView>> GetUserLogList(UserLogQuery inQuery)
|
||||||
{
|
{
|
||||||
|
DateTime? trialCreateTime = inQuery.TrialId != null ? _repository.Where<Trial>(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null;
|
||||||
|
|
||||||
var userLogQueryable =
|
var userLogQueryable =
|
||||||
_userLogRepository
|
_userLogRepository
|
||||||
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && c.UserId == t.LoginUserId))
|
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && (c.UserId == t.LoginUserId || c.UserId == t.OptUserId)))
|
||||||
|
.WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime)
|
||||||
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
||||||
|
.WhereIf(inQuery.UserId != null, t => t.LoginUserId == inQuery.UserId)
|
||||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.LoginUser.UserName.Contains(inQuery.LoginUserName!))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!))
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
|
||||||
|
.WhereIf(inQuery.LoginUserTypeEnum != null, t => t.LoginUser.UserTypeEnum == inQuery.LoginUserTypeEnum)
|
||||||
|
.WhereIf(inQuery.UserTypeId != null, t => t.LoginUser.UserTypeId == inQuery.UserTypeId)
|
||||||
|
|
||||||
.ProjectTo<UserLogView>(_mapper.ConfigurationProvider);
|
.ProjectTo<UserLogView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc);
|
var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc);
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||||||
|
|
||||||
public string ModalityForEdit { get; set; } = string.Empty;
|
public string ModalityForEdit { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public bool IsHaveUploadFailed { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QASeriesInfoDto
|
public class QASeriesInfoDto
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
[DictionaryTranslateAttribute("YesOrNo")]
|
[DictionaryTranslateAttribute("YesOrNo")]
|
||||||
public bool IsSuccess { get; set; }
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
public string Note = string.Empty;
|
public string Note { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1099,6 +1099,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public int? Age { get; set; }
|
public int? Age { get; set; }
|
||||||
public string Sex { get; set; } = string.Empty;
|
public string Sex { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public bool IsHaveUploadFailed { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1383,6 +1385,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public DateTime? SubmitTime { get; set; }
|
public DateTime? SubmitTime { get; set; }
|
||||||
|
|
||||||
|
public string SubmitUserName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string SubmitUserRealName { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string CurrentActionUserName { get; set; } = String.Empty;
|
public string CurrentActionUserName { get; set; } = String.Empty;
|
||||||
public string PreliminaryAuditUserName { get; set; } = String.Empty;
|
public string PreliminaryAuditUserName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSet;
|
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSet;
|
||||||
private readonly IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository;
|
private readonly IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository;
|
||||||
private readonly IRepository<TrialQCQuestion> _trialQCQuestionRepository;
|
private readonly IRepository<TrialQCQuestion> _trialQCQuestionRepository;
|
||||||
private readonly IRepository<UserUploadFile> _UserUploadFileRepository;
|
private readonly IRepository<InspectionFile> _consistencyCheckFileRepository;
|
||||||
|
|
||||||
private IReadingImageTaskService _IReadingImageTaskService;
|
private IReadingImageTaskService _IReadingImageTaskService;
|
||||||
|
|
||||||
@@ -30,14 +30,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
IRepository<TrialQCQuestionAnswer> trialQCQuestionAnswerRepository,
|
IRepository<TrialQCQuestionAnswer> trialQCQuestionAnswerRepository,
|
||||||
IRepository<TrialQCQuestion> trialQCQuestionRepository,
|
IRepository<TrialQCQuestion> trialQCQuestionRepository,
|
||||||
IReadingImageTaskService IReadingImageTaskService,
|
IReadingImageTaskService IReadingImageTaskService,
|
||||||
IRepository<UserUploadFile> UserUploadFileRepository
|
IRepository<InspectionFile> consistencyCheckFileRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._IReadingImageTaskService = IReadingImageTaskService;
|
this._IReadingImageTaskService = IReadingImageTaskService;
|
||||||
_subjectVisitRepository = subjectVisitRepository;
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
this._trialQCQuestionAnswerRepository = trialQCQuestionAnswerRepository;
|
this._trialQCQuestionAnswerRepository = trialQCQuestionAnswerRepository;
|
||||||
this._trialQCQuestionRepository = trialQCQuestionRepository;
|
this._trialQCQuestionRepository = trialQCQuestionRepository;
|
||||||
this._UserUploadFileRepository = UserUploadFileRepository;
|
this._consistencyCheckFileRepository = consistencyCheckFileRepository;
|
||||||
_trialRepository = trialRepository;
|
_trialRepository = trialRepository;
|
||||||
this._clinicalDataTrialSet = clinicalDataTrialSet;
|
this._clinicalDataTrialSet = clinicalDataTrialSet;
|
||||||
}
|
}
|
||||||
@@ -851,7 +851,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<GetUserUploadFileDto>> GetUserUploadFile(GetUserUploadFileInDto indto)
|
public async Task<PageOutput<GetUserUploadFileDto>> GetUserUploadFile(GetUserUploadFileInDto indto)
|
||||||
{
|
{
|
||||||
var query = _repository.Where<UserUploadFile>(t => t.TrialId == indto.TrialId)
|
var query = _repository.Where<InspectionFile>(t => t.TrialId == indto.TrialId)
|
||||||
.ProjectTo<GetUserUploadFileDto>(_mapper.ConfigurationProvider);
|
.ProjectTo<GetUserUploadFileDto>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
|
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
|
||||||
|
|||||||
@@ -891,7 +891,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (nextIQCQuality.VisitId != null)
|
if (nextIQCQuality.VisitId != null)
|
||||||
{
|
{
|
||||||
var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstOrDefaultAsync();
|
var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync();
|
||||||
if (!visit.IsTake)
|
if (!visit.IsTake)
|
||||||
{
|
{
|
||||||
await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true);
|
await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true);
|
||||||
@@ -925,7 +925,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
return new GetNextIQCQualityOutDto() { };
|
return new GetNextIQCQualityOutDto() { };
|
||||||
break;
|
break;
|
||||||
case TrialQCProcess.SingleAudit:
|
case TrialQCProcess.SingleAudit:
|
||||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState != SubmitStateEnum.None && x.TrialId == inDto.TrialId && (x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake))).Include(x => x.Subject).ToListAsync();
|
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId!= _userInfo.Id&&(x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake))).Include(x => x.Subject).ToListAsync();
|
||||||
|
|
||||||
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId).OrderBy(x => x.VisitNum).FirstOrDefault();
|
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId).OrderBy(x => x.VisitNum).FirstOrDefault();
|
||||||
if (subjectVisit != null)
|
if (subjectVisit != null)
|
||||||
@@ -953,7 +953,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
break;
|
break;
|
||||||
case TrialQCProcess.DoubleAudit:
|
case TrialQCProcess.DoubleAudit:
|
||||||
|
|
||||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState != SubmitStateEnum.None && x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.Id && (x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.QCPassed))).Include(x => x.Subject).ToListAsync();
|
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||||
|
((x.CurrentActionUserId == _userInfo.Id)||(!x.IsTake&& x.AuditState != AuditStateEnum.QCPassed&& (x.PreliminaryAuditUserId != _userInfo.Id)))
|
||||||
|
).Include(x => x.Subject).ToListAsync();
|
||||||
if (subjectVisit != null)
|
if (subjectVisit != null)
|
||||||
{
|
{
|
||||||
return new GetNextIQCQualityOutDto()
|
return new GetNextIQCQualityOutDto()
|
||||||
@@ -1172,7 +1174,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
//普通提交
|
//普通提交
|
||||||
if (dbSubjectVisitList.Count() == 1)
|
if (dbSubjectVisitList.Count == 1)
|
||||||
{
|
{
|
||||||
var sv = dbSubjectVisitList[0];
|
var sv = dbSubjectVisitList[0];
|
||||||
|
|
||||||
@@ -1181,7 +1183,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
if (sv.PDState == PDStateEnum.PDProgress)
|
if (sv.PDState == PDStateEnum.PDProgress)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (nameList.Count() > 0)
|
if (nameList.Count > 0)
|
||||||
{
|
{
|
||||||
//$"当前访视要求进行疾病进展确认。请在提交当前访视前,先处理未提交的前序访视:{string.Join('、', nameList)}。"
|
//$"当前访视要求进行疾病进展确认。请在提交当前访视前,先处理未提交的前序访视:{string.Join('、', nameList)}。"
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_DiseaseProgressConfirmation", string.Join('、', nameList)], 1, ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_DiseaseProgressConfirmation", string.Join('、', nameList)], 1, ApiResponseCodeEnum.NeedTips);
|
||||||
@@ -1189,7 +1191,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (nameList.Count() > 0)
|
if (nameList.Count > 0)
|
||||||
{
|
{
|
||||||
//$"在提交当前访视后,请尽快处理尚未提交的前序访视:{string.Join('、', nameList)}。"
|
//$"在提交当前访视后,请尽快处理尚未提交的前序访视:{string.Join('、', nameList)}。"
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_UnsubmittedVisits", string.Join('、', nameList)], 0, ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_UnsubmittedVisits", string.Join('、', nameList)], 0, ApiResponseCodeEnum.NeedTips);
|
||||||
@@ -1222,7 +1224,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
var trialId = cRCRequestToQCCommand.TrialId;
|
var trialId = cRCRequestToQCCommand.TrialId;
|
||||||
|
|
||||||
var trialConfig = (await _trialRepository
|
var trialConfig = (await _trialRepository
|
||||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsEnrollementQualificationConfirm,t.IsPDProgressView, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
||||||
.FirstOrDefaultAsync(t => t.TrialId == cRCRequestToQCCommand.TrialId)).IfNullThrowException();
|
.FirstOrDefaultAsync(t => t.TrialId == cRCRequestToQCCommand.TrialId)).IfNullThrowException();
|
||||||
|
|
||||||
//找到符合配置的标准 确认的并且签名的、双重,有序,阅片期仲裁
|
//找到符合配置的标准 确认的并且签名的、双重,有序,阅片期仲裁
|
||||||
@@ -1245,7 +1247,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
|
|
||||||
//单个提交提示信息
|
//单个提交提示信息
|
||||||
if (dbSubjectVisitList.Count() == 1 && dbSubjectVisitList.First().SubmitState == SubmitStateEnum.Submitted)
|
if (dbSubjectVisitList.Count == 1 && dbSubjectVisitList.First().SubmitState == SubmitStateEnum.Submitted)
|
||||||
{
|
{
|
||||||
//---当前访视的影像数据,已经由其他CRC提交。
|
//---当前访视的影像数据,已经由其他CRC提交。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_ImagesSubmitted"], 3, ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_ImagesSubmitted"], 3, ApiResponseCodeEnum.NeedTips);
|
||||||
@@ -1305,10 +1307,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
//已确认临床数据完整性
|
//已确认临床数据完整性
|
||||||
dbSubjectVisit.IsConfirmedClinicalData = true;
|
dbSubjectVisit.IsConfirmedClinicalData = true;
|
||||||
|
|
||||||
|
// 根据项目配置 设置访视的入组确认和pd进展
|
||||||
|
|
||||||
// CRC 上传的基线数据签名
|
dbSubjectVisit.IsEnrollmentConfirm= dbSubjectVisit.IsBaseLine && trialConfig.IsEnrollementQualificationConfirm ?true:false;
|
||||||
|
|
||||||
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
dbSubjectVisit.PDState = dbSubjectVisit.IsBaseLine==false && trialConfig.IsPDProgressView ? PDStateEnum.PDProgress:PDStateEnum.None;
|
||||||
|
|
||||||
|
// CRC 上传的基线数据签名
|
||||||
|
|
||||||
|
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
||||||
|
|
||||||
(x.ClinicalDataTrialSet.ClinicalDataLevel== ClinicalLevel.Subject|| x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)&&
|
(x.ClinicalDataTrialSet.ClinicalDataLevel== ClinicalLevel.Subject|| x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)&&
|
||||||
|
|
||||||
@@ -1353,40 +1360,40 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
//dbSubjectVisit.Subject.IsMissingImages = await _subjectVisitRepository.AnyAsync(t => (t.VisitNum < maxVisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false));
|
//dbSubjectVisit.Subject.IsMissingImages = await _subjectVisitRepository.AnyAsync(t => (t.VisitNum < maxVisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false));
|
||||||
|
|
||||||
//项目或者Subject IsUrgent 提交时 访视也设置为紧急
|
//项目或者Subject IsUrgent 提交时 访视也设置为紧急
|
||||||
if (trialConfig.IsUrgent || dbSubjectVisit.Subject.IsUrgent || (dbSubjectVisit.PDState == PDStateEnum.PDProgress && !dbSubjectVisit.IsBaseLine) || (dbSubjectVisit.IsEnrollmentConfirm && dbSubjectVisit.IsBaseLine))
|
if (trialConfig.IsUrgent || dbSubjectVisit.Subject.IsUrgent || (dbSubjectVisit.IsEnrollmentConfirm && dbSubjectVisit.IsBaseLine))
|
||||||
{
|
{
|
||||||
if (dbSubjectVisit.PDState == PDStateEnum.PDProgress)
|
//if (dbSubjectVisit.PDState == PDStateEnum.PDProgress)
|
||||||
{
|
//{
|
||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitNum <= dbSubjectVisit.VisitNum, x => new SubjectVisit()
|
// await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitNum <= dbSubjectVisit.VisitNum, x => new SubjectVisit()
|
||||||
{
|
// {
|
||||||
IsUrgent = true
|
// IsUrgent = true
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId &&
|
||||||
|
// dbSubjectVisit.VisitNum <= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||||
|
// && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||||
|
// {
|
||||||
|
|
||||||
|
// IsUrgent = true,
|
||||||
|
// TaskUrgentType = TaskUrgentType.PDProgress,
|
||||||
|
// IsCanEditUrgentState = false,
|
||||||
|
// });
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId)&& x.SubjectId == dbSubjectVisit.SubjectId&&
|
// await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
||||||
dbSubjectVisit.VisitNum<= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum+0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
// && x.VisitTaskNum < dbSubjectVisit.VisitNum // 当前的访视 全局 裁判 及之前 全都加急
|
||||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
// && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||||
{
|
// {
|
||||||
|
|
||||||
IsUrgent = true,
|
// IsUrgent = true,
|
||||||
TaskUrgentType = TaskUrgentType.PDProgress,
|
// TaskUrgentType = TaskUrgentType.Other,
|
||||||
IsCanEditUrgentState=false,
|
// TaskUrgentRemake = "后续访视设为pd",
|
||||||
});
|
// IsCanEditUrgentState = false,
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
if (dbSubjectVisit.IsEnrollmentConfirm)
|
||||||
&& x.VisitTaskNum < dbSubjectVisit.VisitNum // 当前的访视 全局 裁判 及之前 全都加急
|
|
||||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
|
||||||
{
|
|
||||||
|
|
||||||
IsUrgent = true,
|
|
||||||
TaskUrgentType = TaskUrgentType.Other,
|
|
||||||
TaskUrgentRemake= "后续访视设为pd",
|
|
||||||
IsCanEditUrgentState = false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (dbSubjectVisit.IsEnrollmentConfirm)
|
|
||||||
{
|
{
|
||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.Id == dbSubjectVisit.Id, x => new SubjectVisit()
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.Id == dbSubjectVisit.Id, x => new SubjectVisit()
|
||||||
{
|
{
|
||||||
@@ -1418,14 +1425,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
dbSubjectVisit.IsUrgent = true;
|
dbSubjectVisit.IsUrgent = true;
|
||||||
|
|
||||||
|
|
||||||
//PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
////PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
||||||
|
|
||||||
var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
//var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
||||||
|
|
||||||
previosSVlist.ForEach(t =>
|
//previosSVlist.ForEach(t =>
|
||||||
{
|
//{
|
||||||
t.IsUrgent = true;
|
// t.IsUrgent = true;
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||||
|
|
||||||
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-mm-dd hh:mm:ss") + " :" + c.TalkContent))))
|
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + " :" + c.TalkContent))))
|
||||||
.ForMember(d => d.ModalityList, c => c.MapFrom(s =>
|
.ForMember(d => d.ModalityList, c => c.MapFrom(s =>
|
||||||
(s.NoneDicomStudyList.Select(t => t.Modality)
|
(s.NoneDicomStudyList.Select(t => t.Modality)
|
||||||
.Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct()))
|
.Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct()))
|
||||||
@@ -364,6 +364,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
||||||
.ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status))
|
.ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status))
|
||||||
.ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count()))
|
.ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count()))
|
||||||
|
|
||||||
|
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.UserName))
|
||||||
|
.ForMember(d => d.SubmitUserRealName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
||||||
|
|
||||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.CurrentActionUser.UserName))
|
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.CurrentActionUser.UserName))
|
||||||
.ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.PreliminaryAuditUser.UserName))
|
.ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.PreliminaryAuditUser.UserName))
|
||||||
.ForMember(d => d.ReviewAuditUserName, u => u.MapFrom(s => s.ReviewAuditUser.UserName))
|
.ForMember(d => d.ReviewAuditUserName, u => u.MapFrom(s => s.ReviewAuditUser.UserName))
|
||||||
@@ -391,6 +395,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count() > 0)
|
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count() > 0)
|
||||||
|| t.PreviousSurgeryList.Any()))
|
|| t.PreviousSurgeryList.Any()))
|
||||||
|
|
||||||
|
.ForMember(d => d.IsHaveUploadFailed, u => u.MapFrom(t => t.StudyList.SelectMany(c=>c.DicomStudyMonitorList).Any(h => h.FailedFileCount>0) ))
|
||||||
|
|
||||||
//.ForMember(d => d.VisitName, u => u.MapFrom(t =>t.InPlan? t.VisitStage.VisitName : t.VisitName))
|
//.ForMember(d => d.VisitName, u => u.MapFrom(t =>t.InPlan? t.VisitStage.VisitName : t.VisitName))
|
||||||
//.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum))
|
//.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum))
|
||||||
//.ForMember(d => d.VisitDay, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitDay : t.VisitDay))
|
//.ForMember(d => d.VisitDay, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitDay : t.VisitDay))
|
||||||
@@ -494,7 +500,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
;
|
;
|
||||||
|
|
||||||
// 一致性核查文件
|
// 一致性核查文件
|
||||||
CreateMap<UserUploadFile, GetUserUploadFileDto>()
|
CreateMap<InspectionFile, GetUserUploadFileDto>()
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -523,7 +523,28 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
|
||||||
inDto.TrialReadingCriterionId = readModule.TrialReadingCriterionId;
|
inDto.TrialReadingCriterionId = readModule.TrialReadingCriterionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 有全局就查全局 有肿瘤学就查肿瘤学
|
||||||
|
|
||||||
|
var clinicalDataLevelList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring).Select(x => x.ClinicalDataLevel).Distinct().ToListAsync();
|
||||||
|
|
||||||
|
var existsCRCStructuring = clinicalDataLevelList.Any(x=>x== ClinicalLevel.OncologyRead|| x == ClinicalLevel.ImageRead);
|
||||||
|
|
||||||
|
|
||||||
|
ReadingSetType? readingSetType = null;
|
||||||
|
if (clinicalDataLevelList.Contains(ClinicalLevel.ImageRead) && !clinicalDataLevelList.Contains(ClinicalLevel.OncologyRead))
|
||||||
|
{
|
||||||
|
readingSetType = ReadingSetType.ImageReading;
|
||||||
|
}
|
||||||
|
else if (clinicalDataLevelList.Contains(ClinicalLevel.OncologyRead) && !clinicalDataLevelList.Contains(ClinicalLevel.ImageRead))
|
||||||
|
{
|
||||||
|
readingSetType = ReadingSetType.TumorReading;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
|
.Where(x=> existsCRCStructuring)
|
||||||
|
.WhereIf(inDto.ReadModuleId==null,x=>x.TrialReadingCriterion.IsConfirm)
|
||||||
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
|
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
|
||||||
.WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
|
.WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
|
||||||
.WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
|
.WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
|
||||||
@@ -532,6 +553,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
|
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
|
||||||
.WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime)
|
.WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime)
|
||||||
.WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime)
|
.WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime)
|
||||||
|
.WhereIf(readingSetType != null, x => x.ReadingSetType== readingSetType)
|
||||||
.Select(x => new GetCRCConfirmListOutDto()
|
.Select(x => new GetCRCConfirmListOutDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <param name="questions"></param>
|
/// <param name="questions"></param>
|
||||||
/// <param name="tableQuestions"></param>
|
/// <param name="tableQuestions"></param>
|
||||||
|
/// <param name="answers"></param>
|
||||||
|
/// <param name="tableAnswers"></param>
|
||||||
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
|
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
|
||||||
{
|
{
|
||||||
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
|
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
|
||||||
|
|||||||
+115
-93
@@ -111,7 +111,7 @@ namespace IRaCIS.Application.Services
|
|||||||
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
|
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
|
||||||
entity.IsBlind = null;
|
entity.IsBlind = null;
|
||||||
entity.IsComplete = null;
|
entity.IsComplete = null;
|
||||||
entity.FileCount = entity.ReadingClinicalDataPDFList.Count();
|
entity.FileCount = entity.ReadingClinicalDataPDFList.Count;
|
||||||
await _readingClinicalDataRepository.AddAsync(entity, true);
|
await _readingClinicalDataRepository.AddAsync(entity, true);
|
||||||
var success = await _readingClinicalDataRepository.SaveChangesAsync();
|
var success = await _readingClinicalDataRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(entity.Id);
|
return ResponseOutput.Ok(entity.Id);
|
||||||
@@ -190,23 +190,24 @@ namespace IRaCIS.Application.Services
|
|||||||
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.WhereIf(!inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(!inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
||||||
.Include(x=>x.ClinicalDataTrialSet)
|
.Include(x => x.ClinicalDataTrialSet)
|
||||||
.OrderBy(x=>x.ClinicalDataTrialSet.CreateTime)
|
.OrderBy(x => x.ClinicalDataTrialSet.CreateTime)
|
||||||
.Select(x => new GetCRCClinicalDataOutDto()
|
.Select(x => new GetCRCClinicalDataOutDto()
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us) ,
|
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
||||||
ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||||
ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id,
|
ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id,
|
||||||
FileName = x.ClinicalDataTrialSet.FileName,
|
FileName = x.ClinicalDataTrialSet.FileName,
|
||||||
UploadRole = x.ClinicalDataTrialSet.UploadRole,
|
UploadRole = x.ClinicalDataTrialSet.UploadRole,
|
||||||
Path = x.ClinicalDataTrialSet.Path,
|
Path = x.ClinicalDataTrialSet.Path,
|
||||||
IsBlind = x.IsBlind,
|
IsBlind = x.IsBlind,
|
||||||
IsComplete = x.IsComplete,
|
IsComplete = x.IsComplete,
|
||||||
ClinicalFromList=x.Subject.ClinicalFormList.Where(y=>y.ReadingId==x.ReadingId&&y.ClinicalDataTrialSetId==x.ClinicalDataTrialSetId).Select(y=> new ClinicalFromData() {
|
ClinicalFromList = x.Subject.ClinicalFormList.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||||
CheckDate=y.CheckDate,
|
{
|
||||||
ClinicalFormId=y.Id
|
CheckDate = y.CheckDate,
|
||||||
|
ClinicalFormId = y.Id
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
PDFFileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
PDFFileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
||||||
{
|
{
|
||||||
@@ -287,7 +288,7 @@ namespace IRaCIS.Application.Services
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
data.IsBlind = inDto.IsBlind;
|
data.IsBlind = inDto.IsBlind;
|
||||||
data.IsComplete=inDto.IsComplete;
|
data.IsComplete = inDto.IsComplete;
|
||||||
data.IsSign = true;
|
data.IsSign = true;
|
||||||
data.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned;
|
data.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned;
|
||||||
|
|
||||||
@@ -304,7 +305,24 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
await this.iServiceProvider.GetService<IReadingImageTaskService>().AddOncologyTask(readingId);
|
await this.iServiceProvider.GetService<IReadingImageTaskService>().AddOncologyTask(readingId);
|
||||||
|
|
||||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
//如果先生成了任务,再签名subject级别 PM 临床数据,那么会导致其他标准的任务签名状态无法得到维护
|
||||||
|
|
||||||
|
if (await _repository.AnyAsync<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId && t.UploadRole == UploadRole.PM && t.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||||
|
{
|
||||||
|
var needDealTrialReadingCriterionIdList = _repository.Where<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId)
|
||||||
|
.SelectMany(t => t.TrialClinicalDataSetCriteriaList)
|
||||||
|
.Select(u => u.TrialReadingCriterionId).Distinct().ToList();
|
||||||
|
|
||||||
|
foreach (var trialReadingCriterionId in needDealTrialReadingCriterionIdList)
|
||||||
|
{
|
||||||
|
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, trialReadingCriterionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseOutput.Result(result);
|
return ResponseOutput.Result(result);
|
||||||
}
|
}
|
||||||
@@ -313,7 +331,7 @@ namespace IRaCIS.Application.Services
|
|||||||
public async Task DealVisiTaskClinicalDataSignedAsync(Guid trialId, Guid subjectId, Guid readingId, bool isVisit, Guid trialReadingCritrialId)
|
public async Task DealVisiTaskClinicalDataSignedAsync(Guid trialId, Guid subjectId, Guid readingId, bool isVisit, Guid trialReadingCritrialId)
|
||||||
{
|
{
|
||||||
//获取确认的临床数据配置
|
//获取确认的临床数据配置
|
||||||
var trialClinicalDataSetList = _clinicalDataTrialSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
var trialClinicalDataSetList = _clinicalDataTrialSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||||
|
|
||||||
//var criterionType = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCritrialId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
//var criterionType = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCritrialId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
||||||
|
|
||||||
@@ -366,7 +384,7 @@ namespace IRaCIS.Application.Services
|
|||||||
//影像学
|
//影像学
|
||||||
if (readModule.ReadingSetType == ReadingSetType.ImageReading)
|
if (readModule.ReadingSetType == ReadingSetType.ImageReading)
|
||||||
{
|
{
|
||||||
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId) && t.ClinicalDataLevel == ClinicalLevel.ImageRead).Count();
|
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId) && t.ClinicalDataLevel == ClinicalLevel.ImageRead && t.UploadRole == UploadRole.PM).Count();
|
||||||
|
|
||||||
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
||||||
crcReadModuleSign =
|
crcReadModuleSign =
|
||||||
@@ -376,12 +394,11 @@ namespace IRaCIS.Application.Services
|
|||||||
&& x.ClinicalUploadType == ClinicalUploadType.Structuring
|
&& x.ClinicalUploadType == ClinicalUploadType.Structuring
|
||||||
&& x.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId)) || readModule.IsPMConfirm;
|
&& x.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId)) || readModule.IsPMConfirm;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//肿瘤学
|
//肿瘤学
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead).Count();
|
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCritrialId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead && t.UploadRole == UploadRole.PM).Count();
|
||||||
|
|
||||||
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
||||||
crcReadModuleSign =
|
crcReadModuleSign =
|
||||||
@@ -415,7 +432,7 @@ namespace IRaCIS.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
//有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态
|
//有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态
|
||||||
if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
|
if (_readingQuestionCriterionTrialRepository.Any(t => t.Id == trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -430,7 +447,7 @@ namespace IRaCIS.Application.Services
|
|||||||
(t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
|
(t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
|
||||||
|
|
||||||
// 前序存在 未一致性核查未通过的
|
// 前序存在 未一致性核查未通过的
|
||||||
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum>sv.VisitNum)
|
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)
|
||||||
|
|
||||||
))
|
))
|
||||||
.Select(t => t.Id);
|
.Select(t => t.Id);
|
||||||
@@ -512,7 +529,7 @@ namespace IRaCIS.Application.Services
|
|||||||
inDto.UploadRole = UploadRole.PM;
|
inDto.UploadRole = UploadRole.PM;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadModule readModule = null;
|
ReadModule? readModule = null;
|
||||||
if (inDto.IsVisit == false)
|
if (inDto.IsVisit == false)
|
||||||
{
|
{
|
||||||
readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId).FirstOrDefaultAsync();
|
readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId).FirstOrDefaultAsync();
|
||||||
@@ -537,14 +554,14 @@ namespace IRaCIS.Application.Services
|
|||||||
.WhereIf(inDto.IsVisit && inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(inDto.IsVisit && inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.WhereIf(inDto.IsVisit && !inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(inDto.IsVisit && !inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||||
.WhereIf(readModule != null, x => x.ClinicalDataLevel == keyValuePairs[readModule.ModuleType])
|
.WhereIf(readModule != null, x => x.ClinicalDataLevel == keyValuePairs[readModule!.ModuleType])
|
||||||
.WhereIf(inDto.TrialReadingCriterionId!=null,x=>x.TrialClinicalDataSetCriteriaList.Any(y=>y.TrialReadingCriterionId== inDto.TrialReadingCriterionId))
|
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||||
//.WhereIf(criterion!=null,x=>x.CriterionEnumListStr.Contains($"|{(int)criterion.CriterionType}|"))
|
//.WhereIf(criterion!=null,x=>x.CriterionEnumListStr.Contains($"|{(int)criterion.CriterionType}|"))
|
||||||
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||||
{
|
{
|
||||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
ClinicalDataSetEnName=x.ClinicalDataSetEnName,
|
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||||
ClinicalUploadType = x.ClinicalUploadType,
|
ClinicalUploadType = x.ClinicalUploadType,
|
||||||
FileName = x.FileName,
|
FileName = x.FileName,
|
||||||
Path = x.Path,
|
Path = x.Path,
|
||||||
@@ -659,7 +676,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
return (result, new
|
return (result, new
|
||||||
{
|
{
|
||||||
IsCanAddClinicalData = clinicalDataList.Count() > 0,
|
IsCanAddClinicalData = clinicalDataList.Count > 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,53 +723,55 @@ namespace IRaCIS.Application.Services
|
|||||||
var result = new List<GetReadingClinicalDataListOutDto>();
|
var result = new List<GetReadingClinicalDataListOutDto>();
|
||||||
if (!inDto.IsOnlyGetCRCReadModule)
|
if (!inDto.IsOnlyGetCRCReadModule)
|
||||||
{
|
{
|
||||||
result = await resultQuery.ToListAsync();
|
result = await resultQuery.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||||
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId??default(Guid))).ToListAsync();
|
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId ?? default(Guid))).ToListAsync();
|
||||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x => {
|
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x =>
|
||||||
|
{
|
||||||
|
|
||||||
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId&&y.ClinicalDataTrialSetId==x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||||
{
|
{
|
||||||
CheckDate = y.CheckDate,
|
CheckDate = y.CheckDate,
|
||||||
ClinicalFormId = y.Id
|
ClinicalFormId = y.Id
|
||||||
}).ToList();
|
}).ToList();
|
||||||
x.FileCount = x.ClinicalFromList.Count();
|
x.FileCount = x.ClinicalFromList.Count;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 这里处理CRC上传 阅片期的临床数据
|
// 这里处理CRC上传 阅片期的临床数据
|
||||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId)
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId)
|
||||||
.WhereIf(inDto.SelectIsSign,x=>x.IsPMConfirm)
|
.WhereIf(inDto.SelectIsSign, x => x.IsPMConfirm)
|
||||||
.WhereIf(!inDto.SelectIsSign, x => x.IsCRCConfirm)
|
.WhereIf(!inDto.SelectIsSign, x => x.IsCRCConfirm)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (readModule != null)
|
if (readModule != null)
|
||||||
{
|
{
|
||||||
var moduleCriterionFromList = await _readModuleCriterionFromRepository
|
var moduleCriterionFromList = await _readModuleCriterionFromRepository
|
||||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||||
.Where(x => x.ReadModuleId == readModule.Id).Select(x => new{
|
.Where(x => x.ReadModuleId == readModule.Id).Select(x => new
|
||||||
ClinicalFormId= x.ClinicalFormId,
|
{
|
||||||
CheckDate= x.ClinicalForm.CheckDate,
|
ClinicalFormId = x.ClinicalFormId,
|
||||||
ClinicalDataTrialSetId= x.ClinicalForm.ClinicalDataTrialSetId
|
CheckDate = x.ClinicalForm.CheckDate,
|
||||||
|
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
||||||
|
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring)
|
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring)
|
||||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead)
|
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead)
|
||||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||||
.Where(x=>x.TrialClinicalDataSetCriteriaList.Any(y=>y.TrialReadingCriterionId==readModule.TrialReadingCriterionId))
|
.Where(x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == readModule.TrialReadingCriterionId))
|
||||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||||
SubjectId = inDto.SubjectId,
|
SubjectId = inDto.SubjectId,
|
||||||
ReadingId = default(Guid),
|
ReadingId = default(Guid),
|
||||||
IsCRCApplicationRevoke=readModule.IsCRCApplicationRevoke,
|
IsCRCApplicationRevoke = readModule.IsCRCApplicationRevoke,
|
||||||
IsCRCConfirm= readModule.IsCRCConfirm,
|
IsCRCConfirm = readModule.IsCRCConfirm,
|
||||||
IsPMConfirm= readModule.IsPMConfirm,
|
IsPMConfirm = readModule.IsPMConfirm,
|
||||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||||
ClinicalDataTrialSetId = x.Id,
|
ClinicalDataTrialSetId = x.Id,
|
||||||
@@ -763,6 +782,7 @@ namespace IRaCIS.Application.Services
|
|||||||
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
||||||
IsNeedMerge = true,
|
IsNeedMerge = true,
|
||||||
ReadModuleId = readModule.Id,
|
ReadModuleId = readModule.Id,
|
||||||
|
TrialClinicalDataSetCriteriaList = x.TrialClinicalDataSetCriteriaList,
|
||||||
//FileCount = x.FileCount,
|
//FileCount = x.FileCount,
|
||||||
|
|
||||||
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
||||||
@@ -791,8 +811,8 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
result.AddRange(clinicalresult);
|
result.AddRange(clinicalresult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -813,7 +833,7 @@ namespace IRaCIS.Application.Services
|
|||||||
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
||||||
break;
|
break;
|
||||||
case GetClinicalType.CRCConfirm:
|
case GetClinicalType.CRCConfirm:
|
||||||
result = result.Where(x => x.UploadRole == UploadRole.CRC&&x.IsCRCConfirm&&!x.IsPMConfirm).ToList();
|
result = result.Where(x => x.UploadRole == UploadRole.CRC && x.IsCRCConfirm && !x.IsPMConfirm).ToList();
|
||||||
break;
|
break;
|
||||||
case GetClinicalType.HasSign:
|
case GetClinicalType.HasSign:
|
||||||
result = result.Where(x => x.IsSign).ToList();
|
result = result.Where(x => x.IsSign).ToList();
|
||||||
@@ -849,15 +869,15 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
|
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
|
||||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||||
.WhereIf(inDto.ClinicalDataTrialSetId!=null, x=>x.ClinicalDataTrialSetId==inDto.TrialReadingCriterionId)
|
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.TrialReadingCriterionId)
|
||||||
.Where(x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t=>t.TrialReadingCriterionId==inDto.TrialReadingCriterionId))
|
.Where(x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||||
{
|
{
|
||||||
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||||
SubjectId = x.SubjectId,
|
SubjectId = x.SubjectId,
|
||||||
ReadingId = x.ReadingId,
|
ReadingId = x.ReadingId,
|
||||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
ClinicalDataSetEnName =x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||||
ClinicalDataTrialSetId = x.ClinicalDataTrialSetId,
|
ClinicalDataTrialSetId = x.ClinicalDataTrialSetId,
|
||||||
IsSign = x.IsSign,
|
IsSign = x.IsSign,
|
||||||
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
||||||
@@ -884,88 +904,90 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||||
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId ?? default(Guid))).ToListAsync();
|
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId ?? default(Guid))).ToListAsync();
|
||||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x => {
|
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x =>
|
||||||
|
{
|
||||||
|
|
||||||
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||||
{
|
{
|
||||||
CheckDate = y.CheckDate,
|
CheckDate = y.CheckDate,
|
||||||
ClinicalFormId = y.Id
|
ClinicalFormId = y.Id
|
||||||
}).ToList();
|
}).ToList();
|
||||||
x.FileCount = x.ClinicalFromList.Count();
|
x.FileCount = x.ClinicalFromList.Count;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 这里处理CRC上传 阅片期的临床数据
|
// 这里处理CRC上传 阅片期的临床数据
|
||||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId&&x.IsCRCConfirm)
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId && x.IsCRCConfirm)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (readModule != null)
|
if (readModule != null)
|
||||||
{
|
{
|
||||||
var moduleCriterionFromList = await _readModuleCriterionFromRepository.Where(x => x.ReadModuleId == readModule.Id)
|
var moduleCriterionFromList = await _readModuleCriterionFromRepository.Where(x => x.ReadModuleId == readModule.Id)
|
||||||
|
|
||||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.TrialReadingCriterionId)
|
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.TrialReadingCriterionId)
|
||||||
.Select(x => new {
|
.Select(x => new
|
||||||
ClinicalFormId = x.ClinicalFormId,
|
{
|
||||||
CheckDate = x.ClinicalForm.CheckDate,
|
ClinicalFormId = x.ClinicalFormId,
|
||||||
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
CheckDate = x.ClinicalForm.CheckDate,
|
||||||
|
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
||||||
|
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC&&x.ClinicalUploadType== ClinicalUploadType.Structuring)
|
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring)
|
||||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading,x=>x.ClinicalDataLevel== ClinicalLevel.ImageRead)
|
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead)
|
||||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||||
.Where(x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == readModule.TrialReadingCriterionId))
|
.Where(x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == readModule.TrialReadingCriterionId))
|
||||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||||
SubjectId = inDto.SubjectId,
|
SubjectId = inDto.SubjectId,
|
||||||
ReadingId = default(Guid),
|
ReadingId = default(Guid),
|
||||||
IsCRCApplicationRevoke= readModule.IsCRCApplicationRevoke,
|
IsCRCApplicationRevoke = readModule.IsCRCApplicationRevoke,
|
||||||
IsCRCConfirm = readModule.IsCRCConfirm,
|
IsCRCConfirm = readModule.IsCRCConfirm,
|
||||||
IsPMConfirm=readModule.IsPMConfirm,
|
IsPMConfirm = readModule.IsPMConfirm,
|
||||||
|
|
||||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||||
ClinicalDataTrialSetId = x.Id,
|
ClinicalDataTrialSetId = x.Id,
|
||||||
IsSign = readModule.IsPMConfirm,
|
IsSign = readModule.IsPMConfirm,
|
||||||
ClinicalUploadType = x.ClinicalUploadType,
|
ClinicalUploadType = x.ClinicalUploadType,
|
||||||
Id = default(Guid),
|
Id = default(Guid),
|
||||||
UploadRole = x.UploadRole,
|
UploadRole = x.UploadRole,
|
||||||
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
||||||
IsNeedMerge = true,
|
IsNeedMerge = true,
|
||||||
ReadModuleId = readModule.Id,
|
ReadModuleId = readModule.Id,
|
||||||
//FileCount = x.FileCount,
|
//FileCount = x.FileCount,
|
||||||
|
|
||||||
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
||||||
|
|
||||||
//FileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
//FileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
||||||
//{
|
//{
|
||||||
// Id = y.Id,
|
// Id = y.Id,
|
||||||
// FileName = y.FileName,
|
// FileName = y.FileName,
|
||||||
// Path = y.Path,
|
// Path = y.Path,
|
||||||
// CreateTime = y.CreateTime,
|
// CreateTime = y.CreateTime,
|
||||||
//}).ToList()
|
//}).ToList()
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
clinicalresult.ForEach(x =>
|
clinicalresult.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.FileCount = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Count();
|
x.FileCount = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Count();
|
||||||
x.ClinicalFromList = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).OrderBy(y => y.CheckDate).Select(x => new ClinicalFromData
|
x.ClinicalFromList = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).OrderBy(y => y.CheckDate).Select(x => new ClinicalFromData
|
||||||
{
|
{
|
||||||
CheckDate = x.CheckDate,
|
CheckDate = x.CheckDate,
|
||||||
ClinicalFormId = x.ClinicalFormId
|
ClinicalFormId = x.ClinicalFormId
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
x.IsSign = readModule.IsPMConfirm ?true : false;
|
x.IsSign = readModule.IsPMConfirm ? true : false;
|
||||||
x.ReadingClinicalDataState = readModule.IsPMConfirm ? ReadingClinicalDataStatus.HaveSigned : ReadingClinicalDataStatus.HaveChecked;
|
x.ReadingClinicalDataState = readModule.IsPMConfirm ? ReadingClinicalDataStatus.HaveSigned : ReadingClinicalDataStatus.HaveChecked;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
result.AddRange(clinicalresult);
|
result.AddRange(clinicalresult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (inDto.GetClinicalType != null)
|
if (inDto.GetClinicalType != null)
|
||||||
@@ -976,7 +998,7 @@ namespace IRaCIS.Application.Services
|
|||||||
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
||||||
break;
|
break;
|
||||||
case GetClinicalType.CRCConfirm:
|
case GetClinicalType.CRCConfirm:
|
||||||
result = result.Where(x => x.UploadRole == UploadRole.CRC&&x.IsCRCConfirm&&!x.IsPMConfirm).ToList();
|
result = result.Where(x => x.UploadRole == UploadRole.CRC && x.IsCRCConfirm && !x.IsPMConfirm).ToList();
|
||||||
break;
|
break;
|
||||||
case GetClinicalType.HasSign:
|
case GetClinicalType.HasSign:
|
||||||
result = result.Where(x => x.IsSign).ToList();
|
result = result.Where(x => x.IsSign).ToList();
|
||||||
|
|||||||
@@ -1162,7 +1162,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// 是否是第一次转化的任务
|
/// 是否是第一次转化的任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFirstChangeTask { get; set; } = false;
|
public bool IsFirstChangeTask { get; set; } = false;
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否存在临床数据
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExistsClinicalData { get; set; } = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class GetVisitReadingQuestionOutDto
|
public class GetVisitReadingQuestionOutDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -395,6 +395,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
|
|
||||||
public Arm ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
|
public bool IsExistsClinicalData { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MedicalReviewAuditState AuditState { get; set; }
|
public MedicalReviewAuditState AuditState { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
@@ -346,6 +347,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -454,6 +460,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1000,6 +1011,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1029,7 +1045,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
public List<string> RelevanceValueList { get; set; }
|
public List<string> RelevanceValueList { get; set; }
|
||||||
public List<CalculateInfo> CalculateQuestionList { get; set; }
|
public List<CalculateInfo> CalculateQuestionList { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
public class ReadingQuestionSystemView
|
public class ReadingQuestionSystemView
|
||||||
{
|
{
|
||||||
@@ -1058,6 +1075,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1560,6 +1582,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1916,6 +1943,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限制显示
|
||||||
|
/// </summary>
|
||||||
|
public LimitShow LimitShow { get; set; } = LimitShow.AllShow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大答案长度
|
/// 最大答案长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1954,7 +1986,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
public List<string> ParentTriggerValueList { get; set; }
|
public List<string> ParentTriggerValueList { get; set; }
|
||||||
public List<string> RelevanceValueList { get; set; }
|
public List<string> RelevanceValueList { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class GetSystemCriterionSelectDto
|
public class GetSystemCriterionSelectDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,5 +21,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Interface
|
|||||||
|
|
||||||
Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
|
Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
|
||||||
|
|
||||||
|
Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-4
@@ -33,6 +33,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
private readonly IReadingImageTaskService _iReadingImageTaskService;
|
private readonly IReadingImageTaskService _iReadingImageTaskService;
|
||||||
private readonly IRepository<User> _userTaskRepository;
|
private readonly IRepository<User> _userTaskRepository;
|
||||||
private readonly IVisitTaskService _visitTaskService;
|
private readonly IVisitTaskService _visitTaskService;
|
||||||
|
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||||
private readonly IRepository<ReadingMedicalReviewDialog> _readingMedicalReviewDialogRepository;
|
private readonly IRepository<ReadingMedicalReviewDialog> _readingMedicalReviewDialogRepository;
|
||||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
||||||
@@ -52,6 +53,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||||
IRepository<User> userTaskRepository,
|
IRepository<User> userTaskRepository,
|
||||||
IVisitTaskService visitTaskService,
|
IVisitTaskService visitTaskService,
|
||||||
|
IReadingClinicalDataService readingClinicalDataService,
|
||||||
IRepository<TaskMedicalReview> taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> taskMedicalReviewRepository,
|
||||||
IRepository<ReadingMedicalReviewDialog> readingMedicalReviewDialogRepository,
|
IRepository<ReadingMedicalReviewDialog> readingMedicalReviewDialogRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial,
|
||||||
@@ -71,6 +73,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||||
this._userTaskRepository = userTaskRepository;
|
this._userTaskRepository = userTaskRepository;
|
||||||
this._visitTaskService = visitTaskService;
|
this._visitTaskService = visitTaskService;
|
||||||
|
this._readingClinicalDataService = readingClinicalDataService;
|
||||||
this._taskMedicalReviewRepository = taskMedicalReviewRepository;
|
this._taskMedicalReviewRepository = taskMedicalReviewRepository;
|
||||||
this._readingMedicalReviewDialogRepository = readingMedicalReviewDialogRepository;
|
this._readingMedicalReviewDialogRepository = readingMedicalReviewDialogRepository;
|
||||||
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
||||||
@@ -109,6 +112,17 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
medicalReviewInfo.VisitTaskId = taskInfo.Id;
|
medicalReviewInfo.VisitTaskId = taskInfo.Id;
|
||||||
|
|
||||||
|
var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
SubjectId = taskInfo.SubjectId,
|
||||||
|
TrialId = taskInfo.TrialId,
|
||||||
|
VisitTaskId = taskInfo.Id,
|
||||||
|
});
|
||||||
|
|
||||||
|
medicalReviewInfo.IsExistsClinicalData = clinicalDataList.Count > 0;
|
||||||
|
|
||||||
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
|
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
|
||||||
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate?taskInfo.BlindSubjectCode: taskInfo.Subject.Code;
|
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate?taskInfo.BlindSubjectCode: taskInfo.Subject.Code;
|
||||||
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
|
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
|
||||||
@@ -466,8 +480,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_SaveQuestion"]);
|
throw new BusinessValidationFailedException(_localizer["MedicalReview_SaveQuestion"]);
|
||||||
}
|
}
|
||||||
|
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
|
||||||
|
|
||||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
LatestReplyUserId = (inDto.IsSendDialog && !medicalReview.IsSendMessage && inDto.IsHaveQuestion) ? _userInfo.Id : null,
|
||||||
IsHaveQuestion = inDto.IsHaveQuestion,
|
IsHaveQuestion = inDto.IsHaveQuestion,
|
||||||
Questioning = inDto.Questioning,
|
Questioning = inDto.Questioning,
|
||||||
IsSendMessage = inDto.IsSendDialog && inDto.IsHaveQuestion,
|
IsSendMessage = inDto.IsSendDialog && inDto.IsHaveQuestion,
|
||||||
@@ -476,9 +494,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
AuditAdviceEnum = inDto.AuditAdviceEnum,
|
AuditAdviceEnum = inDto.AuditAdviceEnum,
|
||||||
SaveConclusionTime = DateTime.Now,
|
SaveConclusionTime = DateTime.Now,
|
||||||
|
|
||||||
});
|
}); ;
|
||||||
|
|
||||||
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync();
|
|
||||||
if (inDto.IsSendDialog&& !medicalReview.IsSendMessage && inDto.IsHaveQuestion)
|
if (inDto.IsSendDialog&& !medicalReview.IsSendMessage && inDto.IsHaveQuestion)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -511,6 +528,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
{
|
{
|
||||||
|
LatestReplyUserId=_userInfo.Id,
|
||||||
IsClosedDialog = inDto.IsClosedDialog,
|
IsClosedDialog = inDto.IsClosedDialog,
|
||||||
MedicalDialogCloseEnum=inDto.MedicalDialogCloseEnum,
|
MedicalDialogCloseEnum=inDto.MedicalDialogCloseEnum,
|
||||||
DialogCloseReason=inDto.DialogCloseReason,
|
DialogCloseReason=inDto.DialogCloseReason,
|
||||||
@@ -547,6 +565,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_invalid"]);
|
throw new BusinessValidationFailedException(_localizer["MedicalReview_invalid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
|
{
|
||||||
|
LatestReplyUserId = _userInfo.Id,
|
||||||
|
});
|
||||||
|
|
||||||
var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync();
|
var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync();
|
||||||
ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog()
|
ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog()
|
||||||
{
|
{
|
||||||
@@ -600,6 +623,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
{
|
{
|
||||||
|
LatestReplyUserId=_userInfo.Id,
|
||||||
IsClosedDialog = true,
|
IsClosedDialog = true,
|
||||||
MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading,
|
MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading,
|
||||||
|
|
||||||
@@ -613,6 +637,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
{
|
{
|
||||||
|
LatestReplyUserId=_userInfo.Id,
|
||||||
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
||||||
});
|
});
|
||||||
ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog()
|
ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog()
|
||||||
@@ -740,10 +765,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||||
{
|
{
|
||||||
|
LatestReplyUserId = _userInfo.Id,
|
||||||
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
||||||
DisagreeReason = inDto.DisagreeReason,
|
DisagreeReason = inDto.DisagreeReason,
|
||||||
IsApplyHeavyReading=inDto.IsApplyHeavyReading,
|
IsApplyHeavyReading = inDto.IsApplyHeavyReading,
|
||||||
});
|
}); ;
|
||||||
|
|
||||||
var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync();
|
var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync();
|
||||||
await _readingMedicalReviewDialogRepository.AddAsync(new ReadingMedicalReviewDialog()
|
await _readingMedicalReviewDialogRepository.AddAsync(new ReadingMedicalReviewDialog()
|
||||||
|
|||||||
+2
-2
@@ -59,7 +59,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.WhereIf(inDto.CriterionTypeEnum != null, x => x.CriterionTypeEnum==inDto.CriterionTypeEnum)
|
.WhereIf(inDto.CriterionTypeEnum != null, x => x.CriterionTypeEnum==inDto.CriterionTypeEnum)
|
||||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.CriterionTypeEnum== criterionEnum || x.IsGeneral==true)
|
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.CriterionTypeEnum== criterionEnum || x.IsGeneral==true)
|
||||||
.WhereIf(inDto.IsGeneral != null, x => x.IsGeneral == inDto.IsGeneral)
|
.WhereIf(inDto.IsGeneral != null, x => x.IsGeneral == inDto.IsGeneral)
|
||||||
.WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType.Value)
|
.WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType!.Value)
|
||||||
.ProjectTo<ReadingMedicineSystemQuestionView>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder);
|
.ProjectTo<ReadingMedicineSystemQuestionView>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder);
|
||||||
|
|
||||||
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, new string[2] { "LanguageType desc", "ShowOrder asc" });
|
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, new string[2] { "LanguageType desc", "ShowOrder asc" });
|
||||||
@@ -516,7 +516,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
|
await _readingMedicineTrialQuestionRepository.AddRangeAsync(_mapper.Map<List<ReadingMedicineTrialQuestion>>(needList));
|
||||||
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -368,7 +368,6 @@ namespace IRaCIS.Application.Services
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 新增修改系统表格问题
|
/// 新增修改系统表格问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="addOrEditReadingTableQuestionSystem"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateReadingTableQuestionSystem(ReadingTableQuestionSystemAddOrEdit addOrEditReadingTableQuestionSystem)
|
public async Task<IResponseOutput> AddOrUpdateReadingTableQuestionSystem(ReadingTableQuestionSystemAddOrEdit addOrEditReadingTableQuestionSystem)
|
||||||
@@ -481,11 +480,12 @@ namespace IRaCIS.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证计算关系
|
/// 验证计算关系
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="relationList"></param>
|
/// <param name="relationList"></param>
|
||||||
/// <param name="QuestionId"></param>
|
/// <param name="QuestionId"></param>
|
||||||
/// <param name="originalId"></param>
|
/// <param name="originalId"></param>
|
||||||
|
/// <param name="count"></param>
|
||||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
private void VerifyCalculateRelation(List<CalculateRelationDto> relationList,Guid QuestionId,Guid originalId,int count=1)
|
private void VerifyCalculateRelation(List<CalculateRelationDto> relationList,Guid QuestionId,Guid originalId,int count=1)
|
||||||
{
|
{
|
||||||
@@ -877,7 +877,7 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
var question = x.Clone();
|
var question = x.Clone();
|
||||||
question.ReadingQuestionCriterionSystemId = inDto.ToSystemCriterionId;
|
question.ReadingQuestionCriterionSystemId = inDto.ToSystemCriterionId;
|
||||||
question.Id = questionRelation[question.Id.Value];
|
question.Id = questionRelation[question.Id!.Value];
|
||||||
if (question.ParentId != null)
|
if (question.ParentId != null)
|
||||||
{
|
{
|
||||||
question.ParentId = questionRelation[question.ParentId ?? default(Guid)];
|
question.ParentId = questionRelation[question.ParentId ?? default(Guid)];
|
||||||
@@ -1013,8 +1013,8 @@ namespace IRaCIS.Application.Services
|
|||||||
SynchronizeTime = DateTime.Now,
|
SynchronizeTime = DateTime.Now,
|
||||||
IsMustGlobalReading = systemCriterion.IsMustGlobalReading,
|
IsMustGlobalReading = systemCriterion.IsMustGlobalReading,
|
||||||
IseCRFShowInDicomReading=systemCriterion.IseCRFShowInDicomReading,
|
IseCRFShowInDicomReading=systemCriterion.IseCRFShowInDicomReading,
|
||||||
IsGlobalReading = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsGlobalReading,
|
//IsGlobalReading = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsGlobalReading,
|
||||||
IsReadingPeriod = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsReadingPeriod,
|
//IsReadingPeriod = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsReadingPeriod,
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+104
-64
@@ -63,12 +63,10 @@ namespace IRaCIS.Application.Services
|
|||||||
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileSystem;
|
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileSystem;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly ISchedulerFactory _schedulerFactory;
|
private readonly ISchedulerFactory _schedulerFactory;
|
||||||
private readonly IMemoryCache _cache;
|
|
||||||
private readonly ITrialEmailNoticeConfigService _trialEmailNoticeConfigService;
|
private readonly ITrialEmailNoticeConfigService _trialEmailNoticeConfigService;
|
||||||
|
|
||||||
|
|
||||||
public ReadingImageTaskService(
|
public ReadingImageTaskService(
|
||||||
IMapper mapper,
|
|
||||||
IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<Trial> TrialRepository,
|
IRepository<Trial> TrialRepository,
|
||||||
@@ -91,7 +89,6 @@ namespace IRaCIS.Application.Services
|
|||||||
IRepository<User> userRepository,
|
IRepository<User> userRepository,
|
||||||
IEasyCachingProvider provider,
|
IEasyCachingProvider provider,
|
||||||
IRepository<ReadingCustomTag> readingCustomTagRepository,
|
IRepository<ReadingCustomTag> readingCustomTagRepository,
|
||||||
IMemoryCache cache,
|
|
||||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||||
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
||||||
@@ -109,7 +106,6 @@ namespace IRaCIS.Application.Services
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
_schedulerFactory = schedulerFactory;
|
_schedulerFactory = schedulerFactory;
|
||||||
base._mapper = mapper;
|
|
||||||
this._noneDicomStudyRepository = noneDicomStudyRepository;
|
this._noneDicomStudyRepository = noneDicomStudyRepository;
|
||||||
this._visitTaskRepository = visitTaskRepository;
|
this._visitTaskRepository = visitTaskRepository;
|
||||||
this._trialRepository = TrialRepository;
|
this._trialRepository = TrialRepository;
|
||||||
@@ -145,7 +141,6 @@ namespace IRaCIS.Application.Services
|
|||||||
this._readingQuestionSystem = ReadingQuestionSystem;
|
this._readingQuestionSystem = ReadingQuestionSystem;
|
||||||
this._noneDicomStudyFileSystem = noneDicomStudyFileSystem;
|
this._noneDicomStudyFileSystem = noneDicomStudyFileSystem;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._cache = cache;
|
|
||||||
this._trialEmailNoticeConfigService = trialEmailNoticeConfigService;
|
this._trialEmailNoticeConfigService = trialEmailNoticeConfigService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -544,7 +539,21 @@ namespace IRaCIS.Application.Services
|
|||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
if (!taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder)
|
foreach (var item in result)
|
||||||
|
{
|
||||||
|
var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
SubjectId = taskInfo.SubjectId,
|
||||||
|
TrialId = taskInfo.TrialId,
|
||||||
|
VisitTaskId = item.VisitTaskId,
|
||||||
|
});
|
||||||
|
|
||||||
|
item.IsExistsClinicalData = clinicalDataList.Count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder)
|
||||||
{
|
{
|
||||||
result = result.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToList();
|
result = result.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToList();
|
||||||
}
|
}
|
||||||
@@ -708,9 +717,9 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
//await AddDefaultValueToTask(inDto.VisitTaskId);
|
//await AddDefaultValueToTask(inDto.VisitTaskId);
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||||
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
|
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
|
||||||
|
|
||||||
return (result, new
|
return (result, new
|
||||||
{
|
{
|
||||||
|
|
||||||
ReadingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync()
|
ReadingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync()
|
||||||
@@ -722,6 +731,8 @@ namespace IRaCIS.Application.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialReadingCriterionId"></param>
|
/// <param name="trialReadingCriterionId"></param>
|
||||||
/// <param name="visitTaskId"></param>
|
/// <param name="visitTaskId"></param>
|
||||||
|
/// <param name="questionClassify"></param>
|
||||||
|
/// <param name="groupClassifyList"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[NonDynamicMethod]
|
[NonDynamicMethod]
|
||||||
public async Task<List<DicomReadingQuestionAnswer>> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId)
|
public async Task<List<DicomReadingQuestionAnswer>> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId)
|
||||||
@@ -751,6 +762,16 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (taskinfo.VisitTaskNum == 0)
|
||||||
|
{
|
||||||
|
questions = questions.Where(x => x.LimitShow == LimitShow.AllShow || x.LimitShow == LimitShow.BaseLineShow).ToList();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
questions = questions.Where(x => x.LimitShow == LimitShow.AllShow || x.LimitShow == LimitShow.FollowShow).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
questions.ForEach(x =>
|
questions.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.CrterionDictionaryGroup = ReadingCommon.GetCrterionDictionaryGroup(taskinfo.IsConvertedTask);
|
x.CrterionDictionaryGroup = ReadingCommon.GetCrterionDictionaryGroup(taskinfo.IsConvertedTask);
|
||||||
@@ -826,10 +847,7 @@ namespace IRaCIS.Application.Services
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<GetTableAnswerRowInfoOutDto>> GetTableAnswerRowInfoList(GetTableAnswerRowInfoInDto inDto)
|
public async Task<List<GetTableAnswerRowInfoOutDto>> GetTableAnswerRowInfoList(GetTableAnswerRowInfoInDto inDto)
|
||||||
{
|
{
|
||||||
await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto()
|
|
||||||
{
|
|
||||||
VisitTaskId = inDto.VisitTaskId
|
|
||||||
});
|
|
||||||
var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId)
|
var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId)
|
||||||
.WhereIf(inDto.QuestionId != null, x => x.QuestionId == inDto.QuestionId)
|
.WhereIf(inDto.QuestionId != null, x => x.QuestionId == inDto.QuestionId)
|
||||||
.ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex)
|
.ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex)
|
||||||
@@ -978,8 +996,18 @@ namespace IRaCIS.Application.Services
|
|||||||
if (inDto.TaskId != null)
|
if (inDto.TaskId != null)
|
||||||
{
|
{
|
||||||
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
if (taskInfo.VisitTaskNum == 0)
|
||||||
|
{
|
||||||
|
qusetionList = qusetionList.Where(x => x.LimitShow == LimitShow.AllShow || x.LimitShow == LimitShow.BaseLineShow).ToList();
|
||||||
|
|
||||||
qusetionList.ForEach(x =>
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qusetionList = qusetionList.Where(x => x.LimitShow == LimitShow.AllShow || x.LimitShow == LimitShow.FollowShow).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qusetionList.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.CrterionDictionaryGroup = ReadingCommon.GetCrterionDictionaryGroup(taskInfo.IsConvertedTask);
|
x.CrterionDictionaryGroup = ReadingCommon.GetCrterionDictionaryGroup(taskInfo.IsConvertedTask);
|
||||||
});
|
});
|
||||||
@@ -1111,7 +1139,7 @@ namespace IRaCIS.Application.Services
|
|||||||
var firstData = newPageQusetionList.FirstOrDefault();
|
var firstData = newPageQusetionList.FirstOrDefault();
|
||||||
var page = new TrialReadQuestionData()
|
var page = new TrialReadQuestionData()
|
||||||
{
|
{
|
||||||
PageName = firstData.PageName,
|
PageName = firstData!.PageName,
|
||||||
IsPage = true,
|
IsPage = true,
|
||||||
IsPublicPage = firstData.IsPublicPage,
|
IsPublicPage = firstData.IsPublicPage,
|
||||||
};
|
};
|
||||||
@@ -1126,8 +1154,8 @@ namespace IRaCIS.Application.Services
|
|||||||
groupList.Add(page);
|
groupList.Add(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.PublicPage = groupList.Where(x => x.IsPublicPage.Value).ToList();
|
result.PublicPage = groupList.Where(x => x.IsPublicPage!.Value).ToList();
|
||||||
result.MultiPage = groupList.Where(x => !x.IsPublicPage.Value).ToList();
|
result.MultiPage = groupList.Where(x => !x.IsPublicPage!.Value).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1151,12 +1179,19 @@ namespace IRaCIS.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取子元素
|
/// 获取子元素
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <param name="questionlists"></param>
|
/// <param name="questionlists"></param>
|
||||||
/// <param name="tableQuestionLists"></param>
|
/// <param name="tableQuestionLists"></param>
|
||||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer, bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer, Guid? TaskId)
|
/// <param name="tableAnswers"></param>
|
||||||
|
/// <param name="tableAnsweRowInfos"></param>
|
||||||
|
/// <param name="organInfos"></param>
|
||||||
|
/// <param name="baseLineTableAnswer"></param>
|
||||||
|
/// <param name="isFirstChangeTask"></param>
|
||||||
|
/// <param name="lastTaskTableAnswer"></param>
|
||||||
|
/// <param name="TaskId"></param>
|
||||||
|
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer,Guid? TaskId)
|
||||||
{
|
{
|
||||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
|
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
|
||||||
item.TableQuestions = new TrialReadTableQuestion();
|
item.TableQuestions = new TrialReadTableQuestion();
|
||||||
@@ -2087,11 +2122,6 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
|
||||||
{
|
|
||||||
ReadingTaskState = ReadingTaskState.Reading,
|
|
||||||
|
|
||||||
});
|
|
||||||
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
||||||
await this._readingCalculateService.CalculateTask(new CalculateTaskInDto()
|
await this._readingCalculateService.CalculateTask(new CalculateTaskInDto()
|
||||||
{
|
{
|
||||||
@@ -2291,7 +2321,7 @@ namespace IRaCIS.Application.Services
|
|||||||
VisitNum = x.VisitTaskNum,
|
VisitNum = x.VisitTaskNum,
|
||||||
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder)
|
else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder)
|
||||||
@@ -2299,7 +2329,8 @@ namespace IRaCIS.Application.Services
|
|||||||
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId.Value,
|
SubjectId=inDto.SubjectId,
|
||||||
|
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||||
Page = new PageInput()
|
Page = new PageInput()
|
||||||
{
|
{
|
||||||
PageIndex = 1,
|
PageIndex = 1,
|
||||||
@@ -2320,7 +2351,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
if (currentSubject == null)
|
if (currentSubject == null)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto()
|
task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto()
|
||||||
@@ -2393,7 +2424,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
if (task == null)
|
if (task == null)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.SubjectCode.IsNullOrEmpty())
|
if (task.SubjectCode.IsNullOrEmpty())
|
||||||
@@ -2452,6 +2483,15 @@ namespace IRaCIS.Application.Services
|
|||||||
task.IsNeedReadClinicalData = clinicalDataList.Where(x => x.ClinicalDataLevel != ClinicalLevel.Subject).Count() > 0;
|
task.IsNeedReadClinicalData = clinicalDataList.Where(x => x.ClinicalDataLevel != ClinicalLevel.Subject).Count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (visitTaskInfo.ReadingTaskState == ReadingTaskState.WaitReading)
|
||||||
|
{
|
||||||
|
await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto()
|
||||||
|
{
|
||||||
|
VisitTaskId = task.VisitTaskId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 如果已经签名 就不需要再读了
|
// 如果已经签名 就不需要再读了
|
||||||
task.IsNeedReadClinicalData = visitTaskInfo.ReadingTaskState == ReadingTaskState.HaveSigned ? false : task.IsNeedReadClinicalData;
|
task.IsNeedReadClinicalData = visitTaskInfo.ReadingTaskState == ReadingTaskState.HaveSigned ? false : task.IsNeedReadClinicalData;
|
||||||
task.DigitPlaces = criterionInfo.DigitPlaces;
|
task.DigitPlaces = criterionInfo.DigitPlaces;
|
||||||
@@ -2473,51 +2513,51 @@ namespace IRaCIS.Application.Services
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task VerifyReadingRestTime()
|
public async Task VerifyReadingRestTime()
|
||||||
{
|
{
|
||||||
var cacheKey = _userInfo.Id.ToString() + "RestTime";
|
//var cacheKey = _userInfo.Id.ToString() + "RestTime";
|
||||||
|
|
||||||
|
|
||||||
var value = _provider.Get<string>(cacheKey).Value;
|
//var value = _provider.Get<string>(cacheKey).Value;
|
||||||
if (value == null)
|
//if (value == null)
|
||||||
{
|
//{
|
||||||
_provider.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
// _provider.Set(cacheKey, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(5));
|
||||||
// _cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
#region 两小时
|
// #region 两小时
|
||||||
var cacheDate = DateTime.Parse(value.ToString());
|
// var cacheDate = DateTime.Parse(value.ToString());
|
||||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
// int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
if (timespanMin > 120 && timespanMin < 140)
|
// if (timespanMin > 120 && timespanMin < 140)
|
||||||
{
|
// {
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
// throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
||||||
}
|
// }
|
||||||
else if (timespanMin > 140)
|
// else if (timespanMin > 140)
|
||||||
{
|
// {
|
||||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
||||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
}
|
// }
|
||||||
#endregion
|
// #endregion
|
||||||
|
|
||||||
#region 测试用的5分钟
|
// #region 测试用的5分钟
|
||||||
//var cacheDate = DateTime.Parse(value.ToString());
|
// //var cacheDate = DateTime.Parse(value.ToString());
|
||||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
// //int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
//if (timespanMin >= 5 && timespanMin <= 10)
|
// //if (timespanMin >= 5 && timespanMin <= 10)
|
||||||
//{
|
// //{
|
||||||
// throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
// // throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||||
//}
|
// //}
|
||||||
//else if (timespanMin > 10)
|
// //else if (timespanMin > 10)
|
||||||
//{
|
// //{
|
||||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
// // cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
//}
|
// //}
|
||||||
#endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ namespace IRaCIS.Application.Services
|
|||||||
TrialId = inDto.TrialId
|
TrialId = inDto.TrialId
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
|
||||||
{
|
|
||||||
ReadingTaskState = ReadingTaskState.Reading,
|
|
||||||
|
|
||||||
});
|
|
||||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
|
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
|
||||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
await _readingOncologyTaskInfoRepository.AddRangeAsync(readingOncologies);
|
await _readingOncologyTaskInfoRepository.AddRangeAsync(readingOncologies);
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
|
||||||
|
|
||||||
var result = await _readingOncologyTaskInfoRepository.SaveChangesAsync();
|
var result = await _readingOncologyTaskInfoRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -85,7 +85,7 @@ namespace IRaCIS.Application.Services
|
|||||||
var firstData = newPageQusetionList.FirstOrDefault();
|
var firstData = newPageQusetionList.FirstOrDefault();
|
||||||
var page = new GetTrialReadingQuestionOutDto()
|
var page = new GetTrialReadingQuestionOutDto()
|
||||||
{
|
{
|
||||||
PageName = firstData.PageName,
|
PageName = firstData!.PageName,
|
||||||
IsPage = true,
|
IsPage = true,
|
||||||
IsPublicPage = firstData.IsPublicPage,
|
IsPublicPage = firstData.IsPublicPage,
|
||||||
};
|
};
|
||||||
@@ -100,8 +100,8 @@ namespace IRaCIS.Application.Services
|
|||||||
groupList.Add(page);
|
groupList.Add(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.PublicPage = groupList.Where(x => x.IsPublicPage.Value).ToList();
|
result.PublicPage = groupList.Where(x => x.IsPublicPage!.Value).ToList();
|
||||||
result.MultiPage = groupList.Where(x => !x.IsPublicPage.Value).ToList();
|
result.MultiPage = groupList.Where(x => !x.IsPublicPage!.Value).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<VisitTask, VisitTaskDto>();
|
CreateMap<VisitTask, VisitTaskDto>();
|
||||||
CreateMap<ShortcutKey, DefaultShortcutKeyView>();
|
CreateMap<ShortcutKey, DefaultShortcutKeyView>();
|
||||||
|
CreateMap<TrialDataFromSystem, ReadingMedicineTrialQuestion>();
|
||||||
|
|
||||||
CreateMap<ReadingCustomTag, ReadingCustomTagDto>();
|
CreateMap<ReadingCustomTag, ReadingCustomTagDto>();
|
||||||
CreateMap<ReadingCustomTagDto, ReadingCustomTag>();
|
CreateMap<ReadingCustomTagDto, ReadingCustomTag>();
|
||||||
|
|||||||
+22
-24
@@ -126,36 +126,35 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
{
|
{
|
||||||
var service = await this.GetService(inDto.VisitTaskId);
|
var service = await this.GetService(inDto.VisitTaskId);
|
||||||
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||||
if (service != null && visitTaskInfo.SourceSubjectVisitId != null)
|
var result = new AddTaskLesionAnswerFromLastTaskOutDto();
|
||||||
|
var readingTaskState = visitTaskInfo.ReadingTaskState;
|
||||||
|
if (service != null && visitTaskInfo.SourceSubjectVisitId != null)
|
||||||
{
|
{
|
||||||
var readingTaskState = visitTaskInfo.ReadingTaskState;
|
|
||||||
var result = new AddTaskLesionAnswerFromLastTaskOutDto();
|
|
||||||
|
|
||||||
if (readingTaskState == ReadingTaskState.WaitReading)
|
if (readingTaskState == ReadingTaskState.WaitReading)
|
||||||
{
|
{
|
||||||
result = await service.AddTaskLesionAnswerFromLastTask(inDto);
|
if (visitTaskInfo.ReadingCategory == ReadingCategory.Visit)
|
||||||
await service.CalculateTask(new CalculateTaskInDto()
|
|
||||||
{
|
{
|
||||||
IsChangeOtherTask = false,
|
result = await service.AddTaskLesionAnswerFromLastTask(inDto);
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
await service.CalculateTask(new CalculateTaskInDto()
|
||||||
});
|
{
|
||||||
|
IsChangeOtherTask = false,
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
{
|
});
|
||||||
ReadingTaskState = ReadingTaskState.Reading,
|
}
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return new AddTaskLesionAnswerFromLastTaskOutDto();
|
|
||||||
}
|
}
|
||||||
|
if (readingTaskState == ReadingTaskState.WaitReading)
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||||
|
{
|
||||||
|
ReadingTaskState = ReadingTaskState.Reading,
|
||||||
|
},true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
|
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
|
||||||
@@ -181,7 +180,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取阅片报告
|
/// 获取阅片报告
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="indto"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<GetReadingReportEvaluationOutDto> GetReadingReportEvaluation(GetReadingReportEvaluationInDto inDto)
|
public async Task<GetReadingReportEvaluationOutDto> GetReadingReportEvaluation(GetReadingReportEvaluationInDto inDto)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
|
|
||||||
result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto
|
result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto
|
||||||
{
|
{
|
||||||
LesionType = x.Key.Value,
|
LesionType = x.Key!.Value,
|
||||||
Count = x.ToList().Count()
|
Count = x.ToList().Count()
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
@@ -711,7 +711,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
|
|
||||||
if (valueOfTypes.Contains(item.ValueType))
|
if (valueOfTypes.Contains(item.ValueType))
|
||||||
{
|
{
|
||||||
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString();
|
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
@@ -1775,7 +1775,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
{
|
{
|
||||||
VisitTaskId = x.VisitTaskId,
|
VisitTaskId = x.VisitTaskId,
|
||||||
Answer = x.Answer,
|
Answer = x.Answer,
|
||||||
QuestionType = x.ReadingQuestionTrial.QuestionType.Value
|
QuestionType = x.ReadingQuestionTrial.QuestionType!.Value
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
compareTaskList.ForEach(y =>
|
compareTaskList.ForEach(y =>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
@@ -650,7 +649,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
|
|
||||||
if (valueOfTypes.Contains(item.ValueType))
|
if (valueOfTypes.Contains(item.ValueType))
|
||||||
{
|
{
|
||||||
item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0": item.Answer), inDto.DigitPlaces).ToString();
|
item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0": item.Answer), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
@@ -550,7 +549,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||||||
|
|
||||||
if (valueOfTypes.Contains(item.ValueType))
|
if (valueOfTypes.Contains(item.ValueType))
|
||||||
{
|
{
|
||||||
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString();
|
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user