Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2024-09-19 17:48:54 +08:00
148 changed files with 7411 additions and 6171 deletions
@@ -1,71 +0,0 @@
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.BusinessFilter
{
public class EncreptApiResultFilter : IAsyncResultFilter
{
private readonly IOptionsMonitor<EncreptResponseOption> _encreptResponseMonitor;
public EncreptApiResultFilter(IOptionsMonitor<EncreptResponseOption> encreptResponseMonitor)
{
_encreptResponseMonitor = encreptResponseMonitor;
}
public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
{
if(_encreptResponseMonitor.CurrentValue.IsEnable)
{
if (context.Result is ObjectResult objectResult)
{
var statusCode = objectResult.StatusCode ?? context.HttpContext.Response.StatusCode;
var objectValue = objectResult.Value;
if (objectValue is IResponseOutput)
{
var responseOutput = objectValue as IResponseOutput<object>;
var path = context.HttpContext?.Request.Path.Value?.ToLower();
if(!string.IsNullOrEmpty(path) && path.Length>5 && _encreptResponseMonitor.CurrentValue.ApiPathList.Contains(path.ToLower()))
{
if(responseOutput.IsSuccess)
{
responseOutput.Code = ApiResponseCodeEnum.ResultEncrepted;
responseOutput.Data = JsonConvert.SerializeObject(Convert.ToBase64String(Encoding.UTF8.GetBytes(responseOutput.Data.ToString())));
objectResult.Value = responseOutput;
}
}
}
}
}
await next.Invoke();
}
}
}
@@ -0,0 +1,91 @@
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Paddings;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Org.BouncyCastle.Crypto.Modes;
namespace IRaCIS.Core.Application.BusinessFilter;
public class AesEncryption
{
// AES 加密(不带 IV
public static string Encrypt(string plainText, string key)
{
var keyBytes = Encoding.UTF8.GetBytes(key);
// 使用 AES 引擎 + PKCS7 填充
var engine = new AesEngine();
var blockCipher = new PaddedBufferedBlockCipher(engine, new Pkcs7Padding());
blockCipher.Init(true, new KeyParameter(keyBytes)); // true 表示加密
var inputBytes = Encoding.UTF8.GetBytes(plainText);
var encryptedBytes = ProcessCipher(blockCipher, inputBytes);
// 返回 Base64 编码的加密字符串
return Convert.ToBase64String(encryptedBytes);
}
// AES 解密(不带 IV
public static string Decrypt(string encryptedText, string key)
{
var keyBytes = Encoding.UTF8.GetBytes(key);
var cipherBytes = Convert.FromBase64String(encryptedText);
// 使用 AES 引擎 + PKCS7 填充
var engine = new AesEngine();
var blockCipher = new PaddedBufferedBlockCipher(engine, new Pkcs7Padding());
blockCipher.Init(false, new KeyParameter(keyBytes)); // false 表示解密
var decryptedBytes = ProcessCipher(blockCipher, cipherBytes);
return Encoding.UTF8.GetString(decryptedBytes);
}
// AES 加密(带 IV
public static string Encrypt(string plainText, string key, string iv)
{
var keyBytes = Encoding.UTF8.GetBytes(key);
var ivBytes = Encoding.UTF8.GetBytes(iv);
// 使用 AES 引擎 + PKCS7 填充 + CBC 模式
var engine = new AesEngine();
var blockCipher = new PaddedBufferedBlockCipher(new CbcBlockCipher(engine), new Pkcs7Padding());
blockCipher.Init(true, new ParametersWithIV(new KeyParameter(keyBytes), ivBytes)); // true 表示加密
var inputBytes = Encoding.UTF8.GetBytes(plainText);
var encryptedBytes = ProcessCipher(blockCipher, inputBytes);
// 返回 Base64 编码的加密字符串
return Convert.ToBase64String(encryptedBytes);
}
// AES 解密(带 IV
public static string Decrypt(string encryptedText, string key, string iv)
{
var keyBytes = Encoding.UTF8.GetBytes(key);
var ivBytes = Encoding.UTF8.GetBytes(iv);
var cipherBytes = Convert.FromBase64String(encryptedText);
// 使用 AES 引擎 + PKCS7 填充 + CBC 模式
var engine = new AesEngine();
var blockCipher = new PaddedBufferedBlockCipher(new CbcBlockCipher(engine), new Pkcs7Padding());
blockCipher.Init(false, new ParametersWithIV(new KeyParameter(keyBytes), ivBytes)); // false 表示解密
var decryptedBytes = ProcessCipher(blockCipher, cipherBytes);
return Encoding.UTF8.GetString(decryptedBytes);
}
// 处理加密/解密数据
private static byte[] ProcessCipher(IBufferedCipher cipher, byte[] input)
{
var output = new byte[cipher.GetOutputSize(input.Length)];
int length = cipher.ProcessBytes(input, 0, input.Length, output, 0);
length += cipher.DoFinal(output, length);
Array.Resize(ref output, length); // 调整输出数组大小以适应实际数据长度
return output;
}
}
@@ -0,0 +1,64 @@
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.BusinessFilter;
/// <summary>
/// 测试加密API 返回的结果
/// </summary>
public class EncreptApiResultFilter : IAsyncResultFilter
{
private readonly IOptionsMonitor<IRCEncreptOption> _encreptResponseMonitor;
public EncreptApiResultFilter(IOptionsMonitor<IRCEncreptOption> encreptResponseMonitor)
{
_encreptResponseMonitor = encreptResponseMonitor;
}
public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
{
if (_encreptResponseMonitor.CurrentValue.IsResponseEncreptEnable)
{
if (context.Result is ObjectResult objectResult)
{
var statusCode = objectResult.StatusCode ?? context.HttpContext.Response.StatusCode;
var objectValue = objectResult.Value;
if (objectValue is IResponseOutput)
{
var responseOutput = objectValue as IResponseOutput<object>;
var path = context.HttpContext?.Request.Path.Value?.ToLower();
if (!string.IsNullOrEmpty(path) && path.Length > 5 && _encreptResponseMonitor.CurrentValue.ApiPathList.Contains(path.ToLower()))
{
if (responseOutput.IsSuccess)
{
responseOutput.Code = ApiResponseCodeEnum.ResultEncrepted;
responseOutput.Data = JsonConvert.SerializeObject(Convert.ToBase64String(Encoding.UTF8.GetBytes(responseOutput.Data.ToString())));
objectResult.Value = responseOutput;
}
}
}
}
}
await next.Invoke();
}
}
@@ -0,0 +1,134 @@
using DocumentFormat.OpenXml.InkML;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.BusinessFilter;
public class EncryptionRequestMiddleware
{
private readonly RequestDelegate _next;
private readonly IRCEncreptOption _IRCEncreptOption;
public EncryptionRequestMiddleware(RequestDelegate next, IOptionsMonitor<IRCEncreptOption> encreptResponseMonitor)
{
_next = next;
_IRCEncreptOption = encreptResponseMonitor.CurrentValue;
}
public async Task InvokeAsync(HttpContext context)
{
//模拟前端已经设置该请求头
//context.Request.Headers["X-Encrypted-Key"] = "hW8JuJocBzIPWSHURUnYJMZ0l68g6uP9rEdMho8ioFO8amD6GIH+R6RIX5jVFzOwO+lmgBi+4gaVJGGkWJMTcoDTfzzzT1EmfPV+UhFLE9HWvCkEXmDOLE9xCHrbG8TrR1I9+Qd3cvo9HLmrQ58n13cJsM82FBw+reUgiWeklPCkEWM9br2qc9VkCp6gKzimTldNTWBezV86S6j3qHbZpVZm0atdDtGb+zSC9LLA3+oHQwRLJAAGSOAi8CUiRmIQsygRd824wBndkaH2ImEeRjBMs7PqCeK3KsoDp13yHdj2AE751gsfNzf4SF547UPf72m0F2/rBFgrSNy+Jz0T9w==";
// 检查请求头中是否包含加密的对称密钥
if (context.Request.Headers.ContainsKey("X-Encrypted-Key"))
{
var encryptedSymmetricKeyStr = context.Request.Headers["X-Encrypted-Key"].ToString();
var pemSecretKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPrivateKey));
// 使用私钥解密对称密钥
var decryptedSymmetricKey = RSAEncryption.Decrypt(pemSecretKey, encryptedSymmetricKeyStr);
#region
// 处理路径参数解密
var path = context.Request.Path.Value;
// 假设加密的参数在路径中,按照顺序解密路径中的每个部分
var pathSegments = path.Split('/', StringSplitOptions.RemoveEmptyEntries);
for (int i = 2; i < pathSegments.Length; i++)
{
if (!string.IsNullOrEmpty(pathSegments[i]))
{
try
{
var decryptedSegment = AesEncryption.Decrypt(pathSegments[i], decryptedSymmetricKey);
pathSegments[i] = decryptedSegment;
}
catch
{
// 如果不能解密该部分,保持原值
}
}
}
// 将解密后的路径重新拼接并设置到请求的Path
context.Request.Path = "/" + string.Join("/", pathSegments);
#endregion
#region url
// 处理 URL 查询参数的解密
var queryParams = context.Request.Query.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString());
var decryptedQueryParams = new Dictionary<string, string>();
foreach (var param in queryParams)
{
var encryptedValue = param.Value;
var decryptedValue = AesEncryption.Decrypt(encryptedValue, decryptedSymmetricKey);
decryptedQueryParams[param.Key] = decryptedValue;
}
// 构造解密后的查询字符串
var decryptedQueryString = new QueryString("?" + string.Join("&", decryptedQueryParams.Select(kvp => $"{kvp.Key}={kvp.Value}")));
context.Request.QueryString = decryptedQueryString;
#endregion
#region body传参
// 读取并解密请求体中的JSON数据
context.Request.EnableBuffering();
using (var reader = new StreamReader(context.Request.Body, Encoding.UTF8, leaveOpen: true))
{
var encryptedBody = await reader.ReadToEndAsync();
context.Request.Body.Position = 0;
if (!string.IsNullOrEmpty(encryptedBody))
{
// 尝试解析为JObject
var encryptedJson = JObject.Parse(encryptedBody);
var decryptedJson = new JObject();
// 解密每个字段的值
foreach (var property in encryptedJson.Properties())
{
var encryptedValue = property.Value.ToString();
var decryptedValue = AesEncryption.Decrypt(encryptedValue, decryptedSymmetricKey);
decryptedJson[property.Name] = decryptedValue;
}
// 将解密后的JSON对象转换回字符串,并替换原始请求体
var decryptedBody = decryptedJson.ToString();
var bodyStream = new MemoryStream(Encoding.UTF8.GetBytes(decryptedBody));
context.Request.Body = bodyStream;
context.Request.ContentLength = bodyStream.Length;
bodyStream.Seek(0, SeekOrigin.Begin);
}
}
#endregion
}
// 调用下一个中间件
await _next(context);
}
}
@@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Security;
namespace IRaCIS.Core.Application.BusinessFilter;
/// <summary>
/// https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html
/// </summary>
public class RSAEncryption
{
public static AsymmetricCipherKeyPair GenerateRSAKeyPair(int keySize)
{
var keyGenerationParameters = new KeyGenerationParameters(new SecureRandom(), keySize);
var keyPairGenerator = new RsaKeyPairGenerator();
keyPairGenerator.Init(keyGenerationParameters);
return keyPairGenerator.GenerateKeyPair();
}
public static string ExportPublicKey(AsymmetricKeyParameter publicKey)
{
using (StringWriter sw = new StringWriter())
{
PemWriter pw = new PemWriter(sw);
pw.WriteObject(publicKey);
pw.Writer.Flush();
return sw.ToString();
}
}
public static string ExportPrivateKey(AsymmetricKeyParameter privateKey)
{
using (StringWriter sw = new StringWriter())
{
PemWriter pw = new PemWriter(sw);
pw.WriteObject(privateKey);
pw.Writer.Flush();
return sw.ToString();
}
}
/// <summary>
/// RSA解密
/// </summary>
/// <param name="privateKey">私钥</param>
/// <param name="decryptstring">待解密的字符串(Base64)</param>
/// <returns>解密后的字符串</returns>
public static string Decrypt(string privateKey, string decryptstring)
{
using (TextReader reader = new StringReader(privateKey))
{
dynamic key = new PemReader(reader).ReadObject();
var rsaDecrypt = new Pkcs1Encoding(new RsaEngine());
if (key is AsymmetricKeyParameter)
{
key = (AsymmetricKeyParameter)key;
}
else if (key is AsymmetricCipherKeyPair)
{
key = ((AsymmetricCipherKeyPair)key).Private;
}
rsaDecrypt.Init(false, key); //这里加密是true;解密是false
byte[] entData = Convert.FromBase64String(decryptstring);
entData = rsaDecrypt.ProcessBlock(entData, 0, entData.Length);
return Encoding.UTF8.GetString(entData);
}
}/// <summary>
/// 加密
/// </summary>
/// <param name="publicKey">公钥</param>
/// <param name="encryptstring">待加密的字符串</param>
/// <returns>加密后的Base64</returns>
public static string Encrypt(string publicKey, string encryptstring)
{
using (TextReader reader = new StringReader(publicKey))
{
AsymmetricKeyParameter key = new PemReader(reader).ReadObject() as AsymmetricKeyParameter;
Pkcs1Encoding pkcs1 = new Pkcs1Encoding(new RsaEngine());
pkcs1.Init(true, key);//加密是true;解密是false;
byte[] entData = Encoding.UTF8.GetBytes(encryptstring);
entData = pkcs1.ProcessBlock(entData, 0, entData.Length);
return Convert.ToBase64String(entData);
}
}
}
+18 -11
View File
@@ -28,6 +28,7 @@ using MassTransit;
using AlibabaCloud.SDK.Sts20150401;
using Amazon.SecurityToken;
using Amazon.SecurityToken.Model;
using Amazon;
namespace IRaCIS.Core.Application.Helper
{
@@ -235,13 +236,15 @@ namespace IRaCIS.Core.Application.Helper
{
var awsConfig = ObjectStoreServiceOptions.AWS;
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
var credentials = new BasicAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey);
var credentials = new SessionAWSCredentials( AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
//提供awsEndPoint(域名)进行访问配置
var clientConfig = new AmazonS3Config
{
ServiceURL = awsConfig.EndPoint
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp =true,
};
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
@@ -322,12 +325,13 @@ namespace IRaCIS.Core.Application.Helper
var awsConfig = ObjectStoreServiceOptions.AWS;
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
var credentials = new BasicAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey);
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
//提供awsEndPoint(域名)进行访问配置
var clientConfig = new AmazonS3Config
{
ServiceURL = awsConfig.EndPoint
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp = true,
};
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
@@ -397,12 +401,13 @@ namespace IRaCIS.Core.Application.Helper
var awsConfig = ObjectStoreServiceOptions.AWS;
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
var credentials = new BasicAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey);
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
//提供awsEndPoint(域名)进行访问配置
var clientConfig = new AmazonS3Config
{
ServiceURL = awsConfig.EndPoint
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp = true,
};
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
@@ -490,12 +495,13 @@ namespace IRaCIS.Core.Application.Helper
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
var credentials = new BasicAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey);
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
//提供awsEndPoint(域名)进行访问配置
var clientConfig = new AmazonS3Config
{
ServiceURL = awsConfig.EndPoint
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp = true,
};
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
@@ -619,12 +625,13 @@ namespace IRaCIS.Core.Application.Helper
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
var credentials = new BasicAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey);
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
//提供awsEndPoint(域名)进行访问配置
var clientConfig = new AmazonS3Config
{
ServiceURL = awsConfig.EndPoint
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp = true,
};
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
@@ -1,97 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Security;
namespace IRaCIS.Core.Application.Helper
{
/// <summary>
/// https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html
/// </summary>
public class RSAHelper
{
public static AsymmetricCipherKeyPair GenerateRSAKeyPair(int keySize)
{
var keyGenerationParameters = new KeyGenerationParameters(new SecureRandom(), keySize);
var keyPairGenerator = new RsaKeyPairGenerator();
keyPairGenerator.Init(keyGenerationParameters);
return keyPairGenerator.GenerateKeyPair();
}
public static string ExportPublicKey(AsymmetricKeyParameter publicKey)
{
using (StringWriter sw = new StringWriter())
{
PemWriter pw = new PemWriter(sw);
pw.WriteObject(publicKey);
pw.Writer.Flush();
return sw.ToString();
}
}
public static string ExportPrivateKey(AsymmetricKeyParameter privateKey)
{
using (StringWriter sw = new StringWriter())
{
PemWriter pw = new PemWriter(sw);
pw.WriteObject(privateKey);
pw.Writer.Flush();
return sw.ToString();
}
}
/// <summary>
/// RSA解密
/// </summary>
/// <param name="privateKey">私钥</param>
/// <param name="decryptstring">待解密的字符串(Base64)</param>
/// <returns>解密后的字符串</returns>
public static string Decrypt(string privateKey, string decryptstring)
{
using (TextReader reader = new StringReader(privateKey))
{
dynamic key = new PemReader(reader).ReadObject();
var rsaDecrypt = new Pkcs1Encoding(new RsaEngine());
if (key is AsymmetricKeyParameter)
{
key = (AsymmetricKeyParameter)key;
}
else if (key is AsymmetricCipherKeyPair)
{
key = ((AsymmetricCipherKeyPair)key).Private;
}
rsaDecrypt.Init(false, key); //这里加密是true;解密是false
byte[] entData = Convert.FromBase64String(decryptstring);
entData = rsaDecrypt.ProcessBlock(entData, 0, entData.Length);
return Encoding.UTF8.GetString(entData);
}
}/// <summary>
/// 加密
/// </summary>
/// <param name="publicKey">公钥</param>
/// <param name="encryptstring">待加密的字符串</param>
/// <returns>加密后的Base64</returns>
public static string Encrypt(string publicKey, string encryptstring)
{
using (TextReader reader = new StringReader(publicKey))
{
AsymmetricKeyParameter key = new PemReader(reader).ReadObject() as AsymmetricKeyParameter;
Pkcs1Encoding pkcs1 = new Pkcs1Encoding(new RsaEngine());
pkcs1.Init(true, key);//加密是true;解密是false;
byte[] entData = Encoding.UTF8.GetBytes(encryptstring);
entData = pkcs1.ProcessBlock(entData, 0, entData.Length);
return Convert.ToBase64String(entData);
}
}
}
}
@@ -62,6 +62,7 @@
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.16" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.402.7" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="DocX" Version="3.0.1" />
<PackageReference Include="FreeSpire.Doc" Version="12.2.0" />
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
@@ -29,6 +29,25 @@
签名
</summary>
</member>
<member name="T:IRaCIS.Core.Application.BusinessFilter.EncreptApiResultFilter">
<summary>
测试加密API 返回的结果
</summary>
</member>
<member name="T:IRaCIS.Core.Application.BusinessFilter.RSAEncryption">
<summary>
https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html
</summary>
</member>
<member name="M:IRaCIS.Core.Application.BusinessFilter.RSAEncryption.Decrypt(System.String,System.String)">
<summary>
RSA解密
</summary>
<param name="privateKey">私钥</param>
<param name="decryptstring">待解密的字符串(Base64)</param>
<returns>解密后的字符串</returns>
</member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.BusinessFilter.RSAEncryption.Encrypt(System.String,System.String)" -->
<member name="T:IRaCIS.Core.Application.BusinessFilter.GlobalExceptionHandler">
<summary>
不生效,不知道为啥
@@ -102,20 +121,6 @@
<param name="prefix"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Helper.RSAHelper">
<summary>
https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Helper.RSAHelper.Decrypt(System.String,System.String)">
<summary>
RSA解密
</summary>
<param name="privateKey">私钥</param>
<param name="decryptstring">待解密的字符串(Base64)</param>
<returns>解密后的字符串</returns>
</member>
<!-- Badly formed XML comment ignored for member "M:IRaCIS.Core.Application.Helper.RSAHelper.Encrypt(System.String,System.String)" -->
<member name="T:IRaCIS.Core.Application.Helper.WordTempleteHelper">
<summary>
利用DocX 库 处理word国际化模板
@@ -902,7 +907,7 @@
TrialEmailNoticeConfigService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailBlackUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IEmailSendService)">
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailBlackUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},IRaCIS.Core.Application.Service.IEmailSendService)">
<summary>
TrialEmailNoticeConfigService
</summary>
@@ -1371,7 +1376,7 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetDialogList(IRaCIS.Core.Infra.EFCore.Common.Dto.AccessToDialogueInDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetDialogList(IRaCIS.Core.Application.ViewModel.AccessToDialogueInDto)">
<summary>
获取查询对象
</summary>
@@ -1384,7 +1389,7 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.CopyFrontAuditConfigItem(IRaCIS.Core.Infra.EFCore.Common.Dto.CopyFrontAuditConfigItemDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.CopyFrontAuditConfigItem(IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto)">
<summary>
复制配置项及其子项
</summary>
@@ -1398,14 +1403,14 @@
<param name="data">数据集</param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValue(IRaCIS.Core.Infra.EFCore.Common.Dto.SetInspectionEnumValueDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValue(IRaCIS.Core.Application.ViewModel.SetInspectionEnumValueDto)">
<summary>
翻译稽查数据
</summary>
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValueDataList(IRaCIS.Core.Infra.EFCore.Common.Dto.SetInspectionEnumValueDto,System.Guid)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValueDataList(IRaCIS.Core.Application.ViewModel.SetInspectionEnumValueDto,System.Guid)">
<summary>
翻译稽查数据
</summary>
@@ -10812,9 +10817,6 @@
<member name="P:IRaCIS.Core.Application.ViewModel.BatchAddTrialEmailNoticeConfig.BusinessLevelEnum">
<summary> 业务层级 /// </summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.BatchAddTrialEmailNoticeConfig.EmailTypeEnum">
<summary> 邮件类型 /// </summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.BatchAddTrialEmailNoticeConfig.EmailUrgentEnum">
<summary> 邮件加急类型 /// </summary>
</member>
@@ -10839,6 +10841,21 @@
<member name="T:IRaCIS.Core.Application.ViewModel.SystemAnonymizationAddOrEdit">
<summary> SystemAnonymizationAddOrEdit 列表查询参数模型</summary>
</member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
<summary>
质疑
</summary>
</member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
<summary>
一致性核查
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
<summary>
复制
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
<summary> SystemNoticeView 列表视图模型 </summary>
</member>
@@ -11774,9 +11791,6 @@
<member name="P:IRaCIS.Core.Application.Contracts.EmailNoticeConfigAddOrEdit.BusinessLevelEnum">
<summary> 业务层级 /// </summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.EmailNoticeConfigAddOrEdit.EmailTypeEnum">
<summary> 邮件类型 /// </summary>
</member>
<member name="P:IRaCIS.Core.Application.Contracts.EmailNoticeConfigAddOrEdit.EmailUrgentEnum">
<summary> 邮件加急类型 /// </summary>
</member>
@@ -11847,7 +11861,7 @@
NoneDicomStudyService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Contracts.NoneDicomStudyService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},Medallion.Threading.IDistributedLockProvider,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Application.Service.QCCommon)">
<member name="M:IRaCIS.Core.Application.Contracts.NoneDicomStudyService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},Medallion.Threading.IDistributedLockProvider,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Application.Service.QCCommon)">
<summary>
NoneDicomStudyService
</summary>
@@ -27,13 +27,13 @@ namespace IRaCIS.Core.Application.Service
{
/// <summary>
/// 获取计划列表 医生带阅片类型
/// </summary>
/// <param name="trialId"></param>
/// <returns></returns>
public async Task<(List<TaskAllocationRuleDTO>,object)> GetDoctorPlanAllocationRuleList(Guid trialId)
public async Task<IResponseOutput<List<TaskAllocationRuleDTO>>> GetDoctorPlanAllocationRuleList(Guid trialId)
{
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync();
@@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.Service
//所有标准都是一样 后台只返回任意一个标准的就好了
var trialTaskConfig = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
return (list, trialTaskConfig);
return ResponseOutput.Ok(list, trialTaskConfig);
}
@@ -103,9 +103,9 @@ namespace IRaCIS.Core.Application.Service
// return ResponseOutput.Ok();
//}
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId,Guid trialReadingCriterionId)
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId, Guid trialReadingCriterionId)
{
var list = await _subjectCanceDoctorRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId==trialReadingCriterionId).ProjectTo<SubjectCancelDoctorView>(_mapper.ConfigurationProvider).ToListAsync();
var list = await _subjectCanceDoctorRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId).ProjectTo<SubjectCancelDoctorView>(_mapper.ConfigurationProvider).ToListAsync();
return list;
}
@@ -139,7 +139,7 @@ namespace IRaCIS.Core.Application.Service
};
return await query.ToListAsync();
return await query.ToListAsync();
}
@@ -150,8 +150,8 @@ namespace IRaCIS.Core.Application.Service
var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable)
.WhereIf(selectQuery.ReadingCategory != null && selectQuery.TrialReadingCriterionId == null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.ReadingCategory == selectQuery.ReadingCategory))
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory == null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId))
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory !=null,
t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && t.ReadingCategory==selectQuery.ReadingCategory))
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory != null,
t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && t.ReadingCategory == selectQuery.ReadingCategory))
join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id
select new TrialDoctorUserSelectView()
{
@@ -162,12 +162,12 @@ namespace IRaCIS.Core.Application.Service
UserName = user.UserName,
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
ReadingCategoryList = selectQuery.TrialReadingCriterionId == null ?
allocationRule.Enroll.EnrollReadingCategoryList.Where(t=> (selectQuery.ReadingCategory == null ?true: t.ReadingCategory == selectQuery.ReadingCategory) ).Select(t => t.ReadingCategory).OrderBy(t => t).ToList() :
ReadingCategoryList = selectQuery.TrialReadingCriterionId == null ?
allocationRule.Enroll.EnrollReadingCategoryList.Where(t => (selectQuery.ReadingCategory == null ? true : t.ReadingCategory == selectQuery.ReadingCategory)).Select(t => t.ReadingCategory).OrderBy(t => t).ToList() :
allocationRule.Enroll.EnrollReadingCategoryList
.Where(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && (selectQuery.ReadingCategory == null?true : t.ReadingCategory == selectQuery.ReadingCategory) )
.Where(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && (selectQuery.ReadingCategory == null ? true : t.ReadingCategory == selectQuery.ReadingCategory))
.Select(t => t.ReadingCategory).OrderBy(t => t).ToList()
};
@@ -96,7 +96,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime <= inQuery.EndSignTime)
.ProjectTo<AnalysisTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var defalutSortArray = new string[] { nameof(AnalysisTaskView.IsUrgent) + " desc", nameof(AnalysisTaskView.SubjectCode), nameof(AnalysisTaskView.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
#region
@@ -66,7 +66,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.EndAuditSignTime != null, t => t.AuditSignTime <= inQuery.EndAuditSignTime)
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) };
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) };
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
@@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
.ProjectTo<GenerateMedicalReviewTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(GenerateMedicalReviewTaskView.IsUrgent) + " desc", nameof(GenerateMedicalReviewTaskView.SubjectId) };
var defalutSortArray = new string[] { nameof(GenerateMedicalReviewTaskView.IsUrgent) + " desc", nameof(GenerateMedicalReviewTaskView.SubjectCode) };
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
@@ -239,7 +239,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return ResponseOutput.Ok(pageList, new
File diff suppressed because it is too large Load Diff
@@ -136,7 +136,6 @@ namespace IRaCIS.Application.Contracts
public Guid? ParentId { get; set; }
public string ParentCode { get; set; } = string.Empty;
public int? ParentChildCodeEnum { get; set; }
public string ChildGroup { get; set; } = string.Empty;
@@ -96,8 +96,6 @@ namespace IRaCIS.Core.Application.Contracts
/// <summary> 业务层级 /// </summary>
public int BusinessLevelEnum { get; set; }
/// <summary> 邮件类型 /// </summary>
public int EmailTypeEnum { get; set; }
/// <summary> 邮件加急类型 /// </summary>
public int EmailUrgentEnum { get; set; }
@@ -7,7 +7,7 @@ using System;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Infra.EFCore.Common.Dto;
using IRaCIS.Core.Infra.EFCore.Common;
namespace IRaCIS.Core.Application.ViewModel
{
@@ -407,7 +407,6 @@ namespace IRaCIS.Application.Services
ChildGroup = x.Dictionary.ChildGroup,
Code = x.Dictionary.Code,
DataTypeEnum = x.Dictionary.DataTypeEnum,
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
CrterionDictionaryGroup = x.CrterionDictionaryGroup,
@@ -427,7 +426,6 @@ namespace IRaCIS.Application.Services
ChildGroup = x.Dictionary.ChildGroup,
Code = x.Dictionary.Code,
DataTypeEnum = x.Dictionary.DataTypeEnum,
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
CrterionDictionaryGroup = x.CrterionDictionaryGroup,
@@ -521,7 +519,6 @@ namespace IRaCIS.Application.Services
Code = x.Dictionary.Code,
Description = x.Dictionary.Description,
DataTypeEnum = x.Dictionary.DataTypeEnum,
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
Id = x.DictionaryId,
@@ -565,7 +562,6 @@ namespace IRaCIS.Application.Services
Code = x.Dictionary.Code,
Description = x.Dictionary.Description,
DataTypeEnum = x.Dictionary.DataTypeEnum,
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
Id = x.DictionaryId,
@@ -52,12 +52,12 @@ namespace IRaCIS.Core.Application.Service
CreateMap<AddBasicDicChild, Dictionary>();
CreateMap<Dictionary, BasicDicSelectCopy>()
.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
//.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
.ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us ? u.Value : u.ValueCN))
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
CreateMap<Dictionary, BasicDicSelect>()
.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
//.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
var token = "";
@@ -617,7 +617,6 @@ namespace IRaCIS.Application.Contracts
public List<Guid> SubspecialityIds { get; set; } = new List<Guid>();
public Guid Id { get; set; }
public string OtherSkills { get; set; } = string.Empty;
public string ReadingTypeOther { get; set; } = string.Empty;
public string ReadingTypeOtherCN { get; set; } = string.Empty;
@@ -105,7 +105,7 @@ namespace IRaCIS.Core.Application.Contracts
public class SystemDocumentQuery : PageInput
{
public bool? IsDeleted { get; set; }
public Guid? SystemDocumentId { get; set; }
public Guid? FileTypeId { get; set; }
@@ -160,8 +160,6 @@ namespace IRaCIS.Core.Application.ViewModel
/// <summary> 业务层级 /// </summary>
public int BusinessLevelEnum { get; set; }
/// <summary> 邮件类型 /// </summary>
public int EmailTypeEnum { get; set; }
/// <summary> 邮件加急类型 /// </summary>
public int EmailUrgentEnum { get; set; }
@@ -16,10 +16,10 @@ namespace IRaCIS.Core.Application.Contracts
Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc);
Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument);
Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId);
Task<(PageOutput<UnionDocumentWithConfirmInfoView>, object)> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
//Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument);
Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>> > GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument);
Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument);
Task<IResponseOutput> SetFirstViewDocumentTime(Guid documentId, bool isSystemDoc);
Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand);
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
@@ -36,7 +36,8 @@ namespace IRaCIS.Core.Application.Services
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.Id });
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
}
@@ -224,8 +224,7 @@ namespace IRaCIS.Core.Application.Services
var trialInfo = await ( _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
//系统文档查询
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
//.Where(u => u.UserTypeRole.UserList.SelectMany(cc => cc.UserTrials.Where(t => t.TrialId == querySystemDocument.TrialId)).Any(e => e.Trial.TrialFinishedTime < u.SystemDocument.CreateTime))
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId,ignoreQueryFilters:true)
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
@@ -356,7 +355,7 @@ namespace IRaCIS.Core.Application.Services
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<(PageOutput<UnionDocumentWithConfirmInfoView>, object)> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
public async Task<IResponseOutput< PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
{
@@ -393,7 +392,7 @@ namespace IRaCIS.Core.Application.Services
#endregion
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId,ignoreQueryFilters:true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
@@ -465,7 +464,7 @@ namespace IRaCIS.Core.Application.Services
FullFilePath = needConfirmEdUserType.SystemDocument.Path
};
var unionQuery = trialDocQuery.Union(systemDocQuery)
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t=>!(t.IsDeleted == true && t.ConfirmUserId == null))
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
@@ -486,7 +485,7 @@ namespace IRaCIS.Core.Application.Services
.CountAsync();
return (result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
return ResponseOutput.Ok (result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
}
@@ -27,6 +27,7 @@ using System.Runtime.InteropServices;
using SharpCompress.Common;
using DocumentFormat.OpenXml.Bibliography;
using System.Linq.Dynamic.Core;
using Microsoft.Extensions.Options;
namespace IRaCIS.Core.Application.Service
{
@@ -50,6 +51,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IOptionsMonitor<SystemEmailSendConfig> _systemEmailSendConfig,
IEmailSendService _emailSendService) : BaseService, ITrialEmailNoticeConfigService
{
@@ -4,6 +4,8 @@ using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using System.Globalization;
namespace IRaCIS.Core.Application.Service
{
@@ -13,10 +15,10 @@ namespace IRaCIS.Core.Application.Service
{
var userId = Guid.Empty;
var token = string.Empty;
var isEn_Us = false;
CreateMap<SystemDocument, SystemDocumentView>()
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value))
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value: s.FileType.ValueCN))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap<TrialDocument, TrialDocumentView>()
@@ -382,7 +382,7 @@ namespace IRaCIS.Core.Application.Contracts
public string HtmlPath { get; set; } = string.Empty;
public long FileSize { get; set; }
public long FileSize { get; set; }
}
public class CRCUploadTaskQuery
@@ -578,7 +578,7 @@ namespace IRaCIS.Core.Application.Contracts
}
public class TrialIamgeDownQuery:PageInput
public class TrialIamgeDownQuery : PageInput
{
[NotDefault]
public Guid TrialId { get; set; }
@@ -595,6 +595,8 @@ namespace IRaCIS.Core.Application.Contracts
public DateTime? DownloadEndTime { get; set; }
public string? IP { get; set; }
public string? Name { get; set; }
}
public class SubjectVisitTaskInfo
@@ -65,8 +65,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
/// <returns></returns>
public async Task<IResponseOutput> SubejctRandomReadingTaskNameDeal(Guid subjectId, Guid trialReadingCriterionId)
{
//subject 随机阅片 才处理任务编号
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom))
//subject 随机阅片 或者无序 有上传 才处理任务编号
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom ||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None))))
{
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
@@ -135,7 +137,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
CriterionModalitys = u.TrialReadingCriterion.CriterionModalitys,
SubjectCode = u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code,
SubjectCode = u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code,
TaskBlindName = u.TaskBlindName,
TaskName = u.TaskName,
@@ -183,6 +185,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
return ResponseOutput.Ok(list);
}
@@ -753,12 +756,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
[HttpPost]
public async Task<List<SubjectCRCImageUploadedStudyDto>> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery)
{
//要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的
var criterionInfo= await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
var doctorUserId = _userInfo.Id;
var isAnalysisCreate = false;
//医学审核查看下载按钮,这个时候需要知道医生
if (inQuery.VisitTaskId != null && inQuery.VisitTaskId != Guid.Empty)
if (inQuery.VisitTaskId != null )
{
var info = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new { t.DoctorUserId, t.IsAnalysisCreate }).FirstNotNullAsync();
@@ -768,6 +777,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
.WhereIf(criterionInfo.IsReadingTaskViewInOrder!=ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null,t=>t.Id==inQuery.VisitTaskId)
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
//这里过滤是否是一致性分析的
@@ -837,7 +848,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery)
{
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsImageFilter, t.CriterionModalitys, t.TrialId }).FirstNotNullAsync();
.Select(t => new { t.IsImageFilter, t.CriterionModalitys, t.TrialId,t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
@@ -908,7 +919,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
Id = NewId.NextSequentialGuid(),
TrialId = info.TrialId,
SubjectCode = inQuery.SubjectCode,
IP=_userInfo.IP,
IP = _userInfo.IP,
DownloadStartTime = DateTime.Now,
IsSuccess = false,
ImageType = imageType,
@@ -920,8 +931,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
) ?? 0
};
await _trialImageDownloadRepository.AddAsync(preDownloadInfo,true);
return ResponseOutput.Ok(result, preDownloadInfo.Id);
await _trialImageDownloadRepository.AddAsync(preDownloadInfo, true);
return ResponseOutput.Ok(result, new { PreDownloadId= preDownloadInfo.Id,info.IsReadingTaskViewInOrder } );
}
/// <summary>
@@ -996,6 +1008,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUser.UserName.Contains(inQuery.Name) || t.CreateUser.FullName.Contains(inQuery.Name))
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
.WhereIf(inQuery.UserType != null, t => t.CreateUser.UserTypeEnum == inQuery.UserType)
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
@@ -9,6 +9,7 @@ using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Domain.Share;
using Medallion.Threading;
using IRaCIS.Core.Application.Service.Reading.Dto;
namespace IRaCIS.Core.Application.Contracts
{
@@ -22,6 +23,7 @@ namespace IRaCIS.Core.Application.Contracts
IRepository<Trial> _trialRepository,
IDistributedLockProvider _distributedLockProvider,
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<VisitTask> _visitTaskRepository,
QCCommon _qCCommon) : BaseService, INoneDicomStudyService
{
@@ -40,12 +42,16 @@ namespace IRaCIS.Core.Application.Contracts
{
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip});
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip });
}
else
{
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(t => new { t.BlindSubjectCode, t.TrialReadingCriterionId, t.TrialReadingCriterion.IsImageFilter, t.TrialReadingCriterion.CriterionModalitys }).FirstNotNullAsync();
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == visitTaskId))
.WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
.Where(t => taskinfo.IsImageFilter ? ("|" + taskinfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
.WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
.ProjectTo<TaskDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip, visiTaskId = visitTaskId });
}
@@ -130,7 +130,7 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id))
.ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter))
.ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys))
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code));
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
CreateMap<DicomStudy, DicomStudyBasicInfo>();
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>();
@@ -138,7 +138,7 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id))
.ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter))
.ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys))
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code))
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
.ForMember(d => d.DicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.StudyList))
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList))
;
@@ -0,0 +1,73 @@
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.ViewModel;
public class DateDto
{
public string Code { get; set; }
public string DateType { get; set; }
public string Identification { get; set; }
}
public class SetInspectionEnumValueDto
{
[NotDefault]
public Guid TrialId { get; set; }
[NotDefault]
public List<Guid> AuditDataIds { get; set; }
}
public class AccessToDialogueInDto
{
public Guid Id { get; set; }
public AccessToDialogueEnum Type { get; set; }
public DateTime Createtime { get; set; }
}
public class AccessToDialogueOutDto
{
public string CreateUserName { get; set; }
public string TalkContent { get; set; }
public DateTime CreateTime { get; set; }
public bool IsTitle { get; set; }
}
public enum AccessToDialogueEnum
{
/// <summary>
/// ÖÊÒÉ
/// </summary>
Question = 0,
/// <summary>
/// Ò»ÖÂÐԺ˲é
/// </summary>
Consistency = 1,
}
/// <summary>
/// ¸´ÖÆ
/// </summary>
public class CopyFrontAuditConfigItemDto
{
public Guid ParentId { get; set; }
public Guid ChildId { get; set; }
}
@@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using MassTransit;
using IRaCIS.Core.Infra.EFCore.Common.Dto;
using Microsoft.Data.SqlClient;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -19,6 +18,7 @@ using IRaCIS.Application.Contracts;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.EntityFrameworkCore;
using Npgsql;
using IRaCIS.Core.Infra.EFCore.Common;
namespace IRaCIS.Core.Application.Service
{
@@ -135,8 +135,8 @@ namespace IRaCIS.Core.Application.Service.Inspection
//UserLastName = leftuser.LastName,
ExperimentName = leftrial.ExperimentName,
SubjectCode = leftvisttask.BlindSubjectCode.IsNullOrEmpty()? leftsubject.Code: leftvisttask.BlindSubjectCode,
//SubjectCode = leftvisttask.BlindSubjectCode.IsNullOrEmpty()? leftsubject.Code: leftvisttask.BlindSubjectCode,
SubjectCode = leftvisttask.IsAnalysisCreate? leftvisttask.BlindSubjectCode: leftsubject.Code ,
SiteCode = lefttrialSite.TrialSiteCode,
ResearchProgramNo = leftrial.ResearchProgramNo,
@@ -32,6 +32,8 @@ namespace IRaCIS.Application.Contracts
public bool IsMFA { get; set; } = false;
public SystemEmailSendConfigView CompanyInfo { get; set; }
}
public class UserBasicInfo
@@ -66,6 +66,8 @@ namespace IRaCIS.Core.Application.Service
var result = await _userFeedBackRepository.WhereIf(inQuery.Id == null, t => t.VisitTaskId == inQuery.VisitTaskId)
.WhereIf(inQuery.VisitTaskId == null, t => t.Id == inQuery.Id).ProjectTo<UserFeedBackView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
return ResponseOutput.Ok(result);
}
@@ -135,7 +135,9 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.SubjectVisitName, c => c.MapFrom(t => t.SubjectVisit.VisitName))
.ForMember(d => d.FeedBackUserName, c => c.MapFrom(t => t.CreateUser.UserName))
.ForMember(d => d.FeedBackFullName, c => c.MapFrom(t => t.CreateUser.FullName))
.ForMember(d => d.UserTypeEnum, c => c.MapFrom(t => t.CreateUser.UserTypeEnum));
.ForMember(d => d.UserTypeEnum, c => c.MapFrom(t => t.CreateUser.UserTypeEnum))
.ForMember(d => d.ScreenshotList, c => c.MapFrom(t => t.FeedBackScreenshotList))
;
CreateMap<UserFeedBackAddOrEdit, UserFeedBack>().ReverseMap();
}
@@ -62,7 +62,7 @@ namespace IRaCIS.Core.Application.Image.QA
.ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(SubjectVisit.SubjectId), nameof(SubjectVisit.VisitNum) };
var defalutSortArray = new string[] { nameof(QCCRCVisitViewModel.IsUrgent) + " desc", nameof(QCCRCVisitViewModel.SubjectCode), nameof(QCCRCVisitViewModel.VisitNum) };
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
@@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery, new string[] { "IsUrgent desc", "CreateTime asc" });
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent)+ " desc", nameof(QCCRCChallengeViewModel.CreateTime)});
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return ResponseOutput.Ok (pageList, config);
@@ -195,7 +195,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery, new string[] { "IsUrgent desc", "IsClosed asc" });
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) });
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return (pageList, config);
@@ -233,9 +233,9 @@ namespace IRaCIS.Core.Application.Image.QA
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(inQuery.SubjectInfo))
@@ -260,7 +260,7 @@ namespace IRaCIS.Core.Application.Image.QA
//.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
.ProjectTo<QCVisitViewModel>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(QCVisitViewModel.IsUrgent) + " desc", nameof(QCVisitViewModel.SubjectId), nameof(QCVisitViewModel.VisitNum) };
var defalutSortArray = new string[] { nameof(QCVisitViewModel.IsUrgent) + " desc", nameof(QCVisitViewModel.SubjectCode), nameof(QCVisitViewModel.VisitNum) };
//var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(QCVisitViewModel.AuditState) +" asc" };
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
@@ -638,8 +638,9 @@ namespace IRaCIS.Core.Application.Image.QA
public async Task<List<SubjectVisitSelectItem>> GetSubjectVisitSelectList(Guid subjectId)
{
var maxNum = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TaskState == TaskState.Effect && t.SignTime != null && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder).MaxAsync(x => (decimal?)x.VisitTaskNum)??0;
//var maxNum = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TaskState == TaskState.Effect && t.SignTime != null && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder).MaxAsync(x => (decimal?)x.VisitTaskNum)??0;
var maxNum=await _subjectVisitRepository.Where(t=>t.SubjectId == subjectId && t.SubmitState==SubmitStateEnum.Submitted).MaxAsync(x => (decimal?)x.VisitNum) ?? 0;
return await _subjectVisitRepository.Where(t => t.SubjectId == subjectId&&t.VisitNum>= maxNum).OrderBy(T => T.VisitNum).ProjectTo<SubjectVisitSelectItem>(_mapper.ConfigurationProvider).ToListAsync();
}
@@ -486,11 +486,14 @@ namespace IRaCIS.Core.Application.Service
// 临床数据上传 路径拼接返回
CreateMap<PreviousHistory, PreviousHistoryView>()
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
CreateMap<PreviousOther, PreviousOtherView>()
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
CreateMap<PreviousSurgery, PreviousSurgeryView>()
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
@@ -361,7 +361,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid? ClinicalFormId { get; set; }
public string PicturePath { get; set; } = string.Empty;
public string? PicturePath { get; set; }
public Guid SubjectId { get; set; }
@@ -306,8 +306,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public decimal FristAddTaskNum { get; set; }
public string OtherMeasureData { get; set; } = string.Empty;
public string MeasureData { get; set; } = string.Empty;
public string? OtherMeasureData { get; set; }
public string? MeasureData { get; set; }
public List<TableQuestionInfo> TableQuestionList { get; set; } = new List<TableQuestionInfo>();
}
@@ -91,7 +91,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsCanEditPosition { get; set; } = false;
public string BlindName { get; set; } = string.Empty;
public string BlindName { get; set; }
public Guid? RowId { get; set; }
@@ -114,12 +114,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 类型值
/// </summary>
public string TypeValue { get; set; }
public string? TypeValue { get; set; }
/// <summary>
/// 序号标记
/// </summary>
public string OrderMark { get; set; } = string.Empty;
public string? OrderMark { get; set; }
/// <summary>
/// 数值类型
@@ -129,7 +129,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
public string? CustomUnit { get; set; }
/// <summary>
/// 单位
@@ -140,7 +140,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public ReportLayType ReportLayType { get; set; } = ReportLayType.Group;
public string ReportMark { get; set; } = string.Empty;
public string? ReportMark { get; set; }
/// <summary>
/// 高亮问题的答案
@@ -310,7 +310,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid RowId { get; set; }
public string OrderMarkName { get; set; }
public string? OrderMarkName { get; set; }
public Guid? OrganInfoId { get; set; }
@@ -500,7 +500,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// MeasureData
/// </summary>
public string MeasureData { get; set; }
public string? MeasureData { get; set; }
/// <summary>
/// CreateTime
@@ -613,7 +613,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid Id { get; set; }
public string Answer { get; set; }
public string Answer { get; set; } = string.Empty;
}
public class DicomReadingQuestionAnswer : ReadingQuestionTrial
{
@@ -683,7 +683,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 标记工具
/// </summary>
public string MarkTool { get; set; } = string.Empty;
public string? MarkTool { get; set; }
/// <summary>
/// TrialId
@@ -738,7 +738,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// MeasureData
/// </summary>
public string MeasureData { get; set; } = string.Empty;
public string? MeasureData { get; set; }
/// <summary>
/// 是否是当前任务添加
@@ -757,14 +757,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public Guid? MergeRowId { get; set; }
public string BlindName { get; set; } = string.Empty;
public string? BlindName { get; set; }
public string OrderMark { get; set; } = string.Empty;
public string? OrderMark { get; set; }
/// <summary>
/// 截图地址
/// </summary>
public string PicturePath { get; set; } = string.Empty;
public string? PicturePath { get; set; }
/// <summary>
/// 第一次添加的任务ID
@@ -800,11 +800,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 来自于哪个标记
/// </summary>
public string FromMark { get; set; } = string.Empty;
public string? FromMark { get; set; }
public string ReportMark { get; set; } = string.Empty;
public string? ReportMark { get; set; }
public string RowMark { get; set; } = string.Empty;
public string? RowMark { get; set; }
}
@@ -1000,13 +1000,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 序号标记
/// </summary>
public string OrderMark { get; set; } = string.Empty;
public string? OrderMark { get; set; }
public string OrderMarkName { get; set; } = string.Empty;
public string? OrderMarkName { get; set; }
public string FromMark { get; set; } = string.Empty;
public string? FromMark { get; set; }
/// <summary>
/// 病灶类型
@@ -1059,7 +1059,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// RowIndex
/// </summary>
public string RowIndex { get; set; }
public string? RowIndex { get; set; }
/// <summary>
/// RowIndex
@@ -1072,7 +1072,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public bool IsDicomReading { get; set; } = true;
public string BlindName { get; set; } = string.Empty;
public string? BlindName { get; set; }
/// <summary>
@@ -1093,10 +1093,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// MeasureData
/// </summary>
public string MeasureData { get; set; }
public string? MeasureData { get; set; }
public string OtherMeasureData { get; set; }
public string? OtherMeasureData { get; set; }
public int ShowOrder { get; set; }
@@ -1119,9 +1119,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public Guid? OtherStudyId { get; set; }
public string OtherMarkTool { get; set; }
public string? OtherMarkTool { get; set; }
public string OtherPicturePath { get; set; }
public string? OtherPicturePath { get; set; }
public int? OtherNumberOfFrames { get; set; }
@@ -1165,12 +1165,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// MarkTool
/// </summary>
public string MarkTool { get; set; } = string.Empty;
public string? MarkTool { get; set; }
/// <summary>
/// PicturePath
/// </summary>
public string PicturePath { get; set; } = string.Empty;
public string? PicturePath { get; set; }
/// <summary>
/// NumberOfFrames
@@ -1180,14 +1180,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// MeasureData
/// </summary>
public string MeasureData { get; set; } = string.Empty;
public string? MeasureData { get; set; }
public Guid? FirstAddTaskId { get; set; }
public QuestionType? QuestionType { get; set; }
public string OrderMarkName { get; set; } = string.Empty;
public string? OrderMarkName { get; set; }
/// <summary>
@@ -1205,12 +1205,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public Guid? OtherStudyId { get; set; }
public string OtherMarkTool { get; set; }
public string? OtherMarkTool { get; set; }
public string OtherPicturePath { get; set; }
public string? OtherPicturePath { get; set; }
public int? OtherNumberOfFrames { get; set; }
public string OtherMeasureData { get; set; } = string.Empty;
public string? OtherMeasureData { get; set; }
}
public class GetReadingQuestionAndAnswerInDto
{
@@ -2171,14 +2171,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// <summary>
/// 标记工具
/// </summary>
public string MarkTool { get; set; } = string.Empty;
public string? MarkTool { get; set; }
public decimal RowIndex { get; set; }
/// <summary>
/// 截图地址
/// </summary>
public string PicturePath { get; set; } = string.Empty;
public string? PicturePath { get; set; }
/// <summary>
/// 任务Id
@@ -2190,9 +2190,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public Guid TrialId { get; set; }
public string MeasureData { get; set; } = string.Empty;
public string? MeasureData { get; set; }
public string OtherMeasureData { get; set; } = string.Empty;
public string? OtherMeasureData { get; set; }
public Guid? SeriesId { get; set; }
@@ -2238,9 +2238,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public Guid? OtherStudyId { get; set; }
public string OtherMarkTool { get; set; } = string.Empty;
public string? OtherMarkTool { get; set; }
public string OtherPicturePath { get; set; } = string.Empty;
public string? OtherPicturePath { get; set; }
public int? OtherNumberOfFrames { get; set; }
@@ -7,6 +7,7 @@ using IRaCIS.Core.Application.Contracts;
using MassTransit;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Domain.Models;
using DocumentFormat.OpenXml.EMMA;
namespace IRaCIS.Application.Services
{
@@ -89,20 +90,22 @@ namespace IRaCIS.Application.Services
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).Select(t => new { t.BlindSubjectCode, t.TrialReadingCriterionId, t.TrialReadingCriterion.IsImageFilter, t.TrialReadingCriterion.CriterionModalitys }).FirstNotNullAsync();
IQueryable<NoneDicomStudyView> noneDicomStudyQueryable = default;
if (inDto.VisistTaskId == null)
{
noneDicomStudyQueryable = _noneDicomStudyRepository
.Where(t => visitIds.Contains(t.SubjectVisitId) && t.NoneDicomFileList.Any(t => !t.FileType.Contains(StaticData.FileType.Zip)))
.WhereIf(taskinfo.IsImageFilter == true, t => taskinfo.CriterionModalitys.Contains(t.Modality))
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = true });
}
else
noneDicomStudyQueryable = _noneDicomStudyRepository
.Where(t => visitIds.Contains(t.SubjectVisitId) && t.NoneDicomFileList.Any(t => !t.FileType.Contains(StaticData.FileType.Zip)))
.WhereIf(taskinfo.IsImageFilter == true, t => taskinfo.CriterionModalitys.Contains(t.Modality))
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = true });
if (inDto.VisistTaskId != null && _noneDicomStudyFileSystem.Any(t => t.VisitTaskId == inDto.VisistTaskId))
{
noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.TaskNoneDicomFileList.Any(t => t.VisitTaskId == inDto.VisistTaskId))
.Where(t => visitIds.Contains(t.SubjectVisitId))
.Where(t => taskinfo.IsImageFilter ? ("|" + taskinfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
.Where(t => visitIds.Contains(t.SubjectVisitId))
.ProjectTo<TaskDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = true, visiTaskId = inDto.VisistTaskId });
}
List<NoneDicomStudyView> result = await noneDicomStudyQueryable.ToListAsync();
@@ -605,7 +605,7 @@ namespace IRaCIS.Application.Services
//只有阅片期有
CutOffVisitId = rm.SubjectVisit.Id,
CutOffVisitName = rm.SubjectVisit.VisitName,
ReadingSetType = null,
ReadingSetType = rm.ReadingSetType,
//之前视图返回的null 应该是没用的?
ReadModuleId = rm.Id,
@@ -68,7 +68,10 @@ namespace IRaCIS.Core.Application.Service
#endregion
CreateMap<VisitTask, VisitTaskDto>();
CreateMap<SubmitTableQuestionInDto, ReadingTableAnswerRowInfo>().ForMember(dest => dest.CreateUser, opt => opt.Ignore());
CreateMap<SubmitTableQuestionInDto, ReadingTableAnswerRowInfo>()
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
.ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));
CreateMap<ShortcutKey, DefaultShortcutKeyView>();
CreateMap<TrialDataFromSystem, ReadingMedicineTrialQuestion>().ForMember(dest => dest.CreateUser, opt => opt.Ignore());
@@ -190,9 +190,9 @@ namespace IRaCIS.Core.Application.Contracts
TrialSiteSurvey? currentEntity = null;
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
//普通登录
if (userInfo.IsUpdate == false)
{
@@ -36,7 +36,8 @@ namespace IRaCIS.Core.Application.AutoMapper
.ForMember(d => d.IsGenerateAccount, u => u.MapFrom(c => true))
.ForMember(d => d.IsGenerateSuccess, u => u.MapFrom(c => true))
.ForMember(d => d.SystemUserId, u => u.MapFrom(c => c.UserId))
.ForMember(d => d.IsJoin, u => u.MapFrom(c => !c.IsDeleted));
.ForMember(d => d.IsJoin, u => u.MapFrom(c => !c.IsDeleted))
.ForMember(d => d.CreateUser, u => u.Ignore());
//列表
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Contracts;
using DocumentFormat.OpenXml.Office2010.ExcelAc;
using IRaCIS.Core.Domain.Models;
namespace IRaCIS.Application.Services
{
@@ -67,7 +68,7 @@ namespace IRaCIS.Application.Services
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.User.FullName).Contains(inQuery.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.User.OrganizationName.Contains(inQuery.OrganizationName))
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider);
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider,new { trialSiteId =inQuery.TrialSiteId});
return await query.ToPagedListAsync(inQuery);
@@ -31,8 +31,9 @@ namespace IRaCIS.Application.Services
IRepository<VisitStage> _visitStageRepository,
IRepository<TrialPaymentPrice> _trialPaymentPriceRepository,
IRepository<TrialDictionary> _trialDictionaryRepository,
IRepository<TrialBodyPart> _trialBodyPartRepository,
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig) : BaseService, ITrialService
IRepository<TrialBodyPart> _trialBodyPartRepository,
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig
) : BaseService, ITrialService
{
@@ -139,8 +139,8 @@ namespace IRaCIS.Application.Services
var query = _patientRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubejctCode), t => t.Subject.Code.Contains(inQuery.SubejctCode))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubejctCode), t => t.Subject.Code.Contains(inQuery.SubejctCode))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo)
|| t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteKeyInfo) || t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteKeyInfo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.SCPStudyList.Any(t => t.CallingAE == inQuery.CallingAE))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.SCPStudyList.Any(t => t.CalledAE == inQuery.CalledAE))
@@ -2,6 +2,7 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Service.WorkLoad.DTO;
using IRaCIS.Core.Domain.Models;
using static IRaCIS.Application.Services.TestService;
namespace IRaCIS.Core.Application.Service
{
@@ -17,7 +18,9 @@ namespace IRaCIS.Core.Application.Service
CreateMap<SetCriterionJoinJoinAnalysisCommand, EnrollReadingCriterion>().ReverseMap();
CreateMap<TestModel, TestModel2>()
.ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));
}
}
+105 -21
View File
@@ -3,6 +3,7 @@ using DocumentFormat.OpenXml.Drawing.Charts;
using DocumentFormat.OpenXml.Wordprocessing;
using IP2Region.Net.XDB;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.BusinessFilter;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Service;
@@ -67,7 +68,7 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> DeleteConsistentDate(Guid trialReadingCriterionId,
[FromServices] IRepository<TaskConsistentRule> _taskConsistentRuleRepository,
[FromServices] IRepository<ReadingConsistentClinicalDataPDF> _readingConsistentClinicalDataPDFRepository,
[FromServices] IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository
[FromServices] IRepository<ReadingConsistentClinicalData> _readingConsistentClinicalDataRepository
)
{
@@ -78,29 +79,24 @@ namespace IRaCIS.Application.Services
await _visitTaskRepository.BatchDeleteNoTrackingAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == true);
await _readingConsistentClinicalDataPDFRepository.BatchDeleteNoTrackingAsync(t => consistentSubjectIdList.Contains(t.ReadingConsistentClinicalData.SubjectId));
await _readingConsistentClinicalDataRepository.BatchDeleteNoTrackingAsync(t => consistentSubjectIdList.Contains(t.SubjectId));
await _readingConsistentClinicalDataRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
public async Task<IResponseOutput> DeleteOSSDate([FromServices] IOSSService _oSSService, [FromServices] IWebHostEnvironment _hostEnvironment)
public async Task<IResponseOutput> DeleteOSSDate(string rootFolder,
[FromServices] IOSSService _oSSService, [FromServices] IWebHostEnvironment _hostEnvironment)
{
var deleteIdList = _trialRepository.Where(t => t.IsDeleted == true, false, true).Select(t => t.Id).ToList();
//var deleteIdList = _trialRepository.Where(t => t.IsDeleted == true, false, true).Select(t => t.Id).ToList();
//foreach (var deleteId in deleteIdList)
//{
// await _oSSService.DeleteFromPrefix($"{deleteId}");
//}
await _oSSService.DeleteFromPrefix($"01000000-0a00-0242-0d73-08dcac46a4bf");
await _oSSService.DeleteFromPrefix($"{rootFolder}");
return ResponseOutput.Ok();
}
@@ -110,18 +106,32 @@ namespace IRaCIS.Application.Services
{
public Guid TestId { get; set; }
public string TestName { get; set; }
public string? TestName { get; set; }
}
public class TestModel2
{
public Guid TestId { get; set; }
public string TestName { get; set; }
}
public async Task<IResponseOutput> TestJson()
{
var model1 = new TestModel() { TestId = NewId.NextSequentialGuid(), TestName = null };
var model2 = new TestModel2() { TestId = NewId.NextSequentialGuid(), TestName = "test2" };
var model4 = _mapper.Map(model1, model2);
await _trialBodyPartRepository.FirstOrDefaultAsync();
await _trialBodyPartRepository.Where(t=>t.Trial.Id==Guid.Empty).FirstOrDefaultAsync();
await _trialBodyPartRepository.Where(t => t.Trial.Id == Guid.Empty).FirstOrDefaultAsync();
return ResponseOutput.Ok(new TestModel(), IRCEmailPasswordHelper.GenerateRandomPassword(10));
}
@@ -235,33 +245,107 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok();
}
[UnitOfWork]
public async Task<string> Get()
public class TestEncrept
{
public string Name { get; set; }
public string Code { get; set; }
}
public IResponseOutput TestEncreptTest(TestEncrept testModel)
{
return ResponseOutput.Ok(testModel);
}
//etx5EzcF9XWA6ICzQB5ywEEextuhmUwaHM2TmyyCC8Q=
[HttpPut("{name}/{code}")]
public IResponseOutput TestEncreptTest2(string name, string code)
{
return ResponseOutput.Ok($"name:{name} Code: {code}");
}
public IResponseOutput TestEncreptTest3(string name, string Code)
{
return ResponseOutput.Ok($"name:{name} Code: {Code}");
}
[UnitOfWork]
public async Task<string> Get([FromServices] IOptionsMonitor<IRCEncreptOption> _encreptResponseMonitor)
{
var _IRCEncreptOption = _encreptResponseMonitor.CurrentValue;
var publicKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPublicKey));
var privateKey = Encoding.UTF8.GetString(Convert.FromBase64String(_IRCEncreptOption.Base64RSAPrivateKey));
Console.WriteLine(RSAEncryption.Encrypt(publicKey, MD5Helper.Md5("123456")));
string plainText = "Hello, BouncyCastle!";
string key = "12345678901234567890123456789012"; // AES 密钥长度应为 16 字节(128 位)
string iv = "your-iv-12345678"; // IV 长度为 16 字节
Console.WriteLine($"原始文本: {plainText}");
// 加密
string encrypted = AesEncryption.Encrypt(plainText, key, iv);
Console.WriteLine($"加密后的数据: {encrypted}");
// 解密
string decrypted = AesEncryption.Decrypt(encrypted, key, iv);
Console.WriteLine($"解密后的数据: {decrypted}");
Console.WriteLine($"原始文本: {plainText}");
// 加密
string encrypte = AesEncryption.Encrypt(plainText, key);
Console.WriteLine($"加密后的数据: {encrypte}");
// 解密
string decrypte = AesEncryption.Decrypt(encrypte, key);
Console.WriteLine($"解密后的数据: {decrypte}");
//// Generate RSA keys
//var keyPair = RSAEncryption.GenerateRSAKeyPair(2048);
//// Export the public and private keys to PEM format
//string publicKey = RSAEncryption.ExportPublicKey(keyPair.Public);
//string privateKey = RSAEncryption.ExportPrivateKey(keyPair.Private);
//Console.WriteLine("Public Key:");
//Console.WriteLine(publicKey);
//Console.WriteLine($"{Convert.ToBase64String(Encoding.UTF8.GetBytes(publicKey))}");
//Console.WriteLine("\nPrivate Key:");
//Console.WriteLine(privateKey);
//Console.WriteLine($"{Convert.ToBase64String(Encoding.UTF8.GetBytes(privateKey))}");
// Generate RSA keys
var keyPair = RSAHelper.GenerateRSAKeyPair(2048);
// Export the public and private keys to PEM format
string publicKey = RSAHelper.ExportPublicKey(keyPair.Public);
string privateKey = RSAHelper.ExportPrivateKey(keyPair.Private);
Console.WriteLine("Public Key:");
Console.WriteLine(publicKey);
Console.WriteLine("\nPrivate Key:");
Console.WriteLine(privateKey);
Console.WriteLine("encrept sys Key:");
Console.WriteLine($"\n{RSAEncryption.Encrypt(publicKey, key)}");
// Data to encrypt
string dataToEncrypt = "Hello, RSA!";
Console.WriteLine("\nOriginal Data: " + dataToEncrypt);
// Encrypt the data
var encryptedData = RSAHelper.Encrypt(publicKey, dataToEncrypt);
var encryptedData = RSAEncryption.Encrypt(publicKey, dataToEncrypt);
Console.WriteLine("\nEncrypted Data: " + encryptedData);
// Decrypt the data
string decryptedData = RSAHelper.Decrypt(privateKey, encryptedData);
string decryptedData = RSAEncryption.Decrypt(privateKey, encryptedData);
Console.WriteLine("\nDecrypted Data: " + decryptedData);