Merge branch 'Test.IRC' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.IRC
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
b9121e1468
|
@ -206,9 +206,65 @@ namespace IRaCIS.Api.Controllers
|
||||||
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("user/GetObjectStoreToken")]
|
||||||
|
public IResponseOutput GetObjectStoreToken([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
|
{
|
||||||
|
var serviceOption = options.CurrentValue;
|
||||||
|
|
||||||
[HttpGet("user/GenerateSTS")]
|
if (Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedEnum) && parsedEnum == ObjectStoreUse.AliyunOSS)
|
||||||
public IResponseOutput GenerateSTS([FromServices]IOptionsMonitor<AliyunOssOptions> options )
|
{
|
||||||
|
var ossOptions = serviceOption.AliyunOSS;
|
||||||
|
|
||||||
|
IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret);
|
||||||
|
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
|
||||||
|
|
||||||
|
// 创建一个STS请求
|
||||||
|
AssumeRoleRequest request = new AssumeRoleRequest
|
||||||
|
{
|
||||||
|
RoleArn = ossOptions.RoleArn, // 角色ARN,需要替换为你的角色ARN
|
||||||
|
RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||||
|
DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||||
|
|
||||||
|
// 返回STS令牌信息给前端
|
||||||
|
var stsToken = new 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);
|
||||||
|
}
|
||||||
|
else if(Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO)
|
||||||
|
{
|
||||||
|
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse=serviceOption.ObjectStoreUse,MinIO=serviceOption.MinIO});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("user/GenerateSTS")]
|
||||||
|
public IResponseOutput GenerateSTS([FromServices]IOptionsMonitor<AliyunOSSOptions> options )
|
||||||
{
|
{
|
||||||
var ossOptions = options.CurrentValue;
|
var ossOptions = options.CurrentValue;
|
||||||
|
|
||||||
|
|
|
@ -946,6 +946,110 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
_userInfo = userInfo;
|
_userInfo = userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost, Route("TrialSiteSurvey/UploadTrialSiteSurveyUser")]
|
||||||
|
[DisableFormValueModelBinding]
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task<IResponseOutput> UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl,
|
||||||
|
[FromServices] IRepository<TrialSite> _trialSiteRepository,
|
||||||
|
[FromServices] IRepository<UserType> _usertypeRepository,
|
||||||
|
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService)
|
||||||
|
{
|
||||||
|
var (serverFilePath, relativePath, fileName) = (string.Empty, string.Empty, string.Empty);
|
||||||
|
await FileUploadAsync(async (realFileName) =>
|
||||||
|
{
|
||||||
|
fileName = realFileName;
|
||||||
|
|
||||||
|
if (!fileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
// 请用提供格式的模板excel上传需要处理的数据
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData"));
|
||||||
|
}
|
||||||
|
|
||||||
|
(serverFilePath, relativePath) = FileStoreHelper.GetOtherFileUploadPath(_hostEnvironment, StaticData.Folder.TempFile, fileName);
|
||||||
|
|
||||||
|
//FileStoreHelper.UploadOOS(serverFilePath, "testc/test", true);
|
||||||
|
|
||||||
|
return serverFilePath;
|
||||||
|
});
|
||||||
|
|
||||||
|
//去掉空白行
|
||||||
|
var excelList = MiniExcel.Query<SiteSurveyUserImportDto>(serverFilePath).ToList()
|
||||||
|
.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();
|
||||||
|
|
||||||
|
if (excelList.Any(t => string.IsNullOrWhiteSpace(t.TrialSiteCode) || string.IsNullOrWhiteSpace(t.FirstName) || string.IsNullOrWhiteSpace(t.LastName) || string.IsNullOrWhiteSpace(t.Email) || string.IsNullOrWhiteSpace(t.UserTypeStr)))
|
||||||
|
{
|
||||||
|
//请确保Excel中 每一行的 中心编号,姓名,邮箱,用户类型数据记录完整再进行上传
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_EnsureCompleteData"));
|
||||||
|
}
|
||||||
|
|
||||||
|
var siteCodeList = excelList.Select(t => t.TrialSiteCode.Trim().ToUpper()).Distinct().ToList();
|
||||||
|
|
||||||
|
if (_trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode.ToUpper())).Count() != siteCodeList.Count)
|
||||||
|
{
|
||||||
|
//在项目中未找到该Excel中部分或全部中心
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidCenters"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (excelList.GroupBy(t => new { t.TrialSiteCode, t.UserTypeStr, t.Email }).Any(g => g.Count() > 1))
|
||||||
|
{
|
||||||
|
// 同一邮箱,同一用户类型,只能生成一个账户,请核查Excel数据
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_CheckDuplicateAccounts"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (excelList.Any(t => !t.Email.Contains("@")))
|
||||||
|
{
|
||||||
|
//有邮箱不符合邮箱格式,请核查Excel数据
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidEmail"));
|
||||||
|
}
|
||||||
|
var generateUserTypeList = new List<string>() { "CRC", "CRA" };
|
||||||
|
|
||||||
|
if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
||||||
|
{
|
||||||
|
//用户类型仅能为 CRC,SR,CRA 请核查Excel数据
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidUserType"));
|
||||||
|
}
|
||||||
|
if (excelList.Count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_NoValiddata"));
|
||||||
|
}
|
||||||
|
//处理好 用户类型 和用户类型枚举
|
||||||
|
var sysUserTypeList = _usertypeRepository.Where(t => t.UserTypeEnum == UserTypeEnum.CRA || t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator ).Select(t => new { UserTypeId = t.Id, t.UserTypeEnum }).ToList();
|
||||||
|
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, t.SiteId }).ToList();
|
||||||
|
|
||||||
|
foreach (var item in excelList)
|
||||||
|
{
|
||||||
|
switch (item.UserTypeStr.ToUpper())
|
||||||
|
{
|
||||||
|
case "CRC":
|
||||||
|
|
||||||
|
item.UserTypeId = sysUserTypeList.FirstOrDefault(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).UserTypeId;
|
||||||
|
item.UserTypeEnum = UserTypeEnum.ClinicalResearchCoordinator;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "CRA":
|
||||||
|
item.UserTypeId = sysUserTypeList.FirstOrDefault(t => t.UserTypeEnum == UserTypeEnum.CRA).UserTypeId;
|
||||||
|
item.UserTypeEnum = UserTypeEnum.CRA;
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
item.SiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).SiteId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await _trialSiteSurveyService.ImportGenerateAccountAndJoinTrialAsync(trialId, baseUrl, routeUrl, excelList.ToList());
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary> 通用文件下载 </summary>
|
/// <summary> 通用文件下载 </summary>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpGet("CommonDocument/DownloadCommonDoc")]
|
[HttpGet("CommonDocument/DownloadCommonDoc")]
|
||||||
|
|
|
@ -93,7 +93,8 @@ namespace IRaCIS.Core.API
|
||||||
|
|
||||||
services.AddOptions().Configure<SystemEmailSendConfig>( _configuration.GetSection("SystemEmailSendConfig"));
|
services.AddOptions().Configure<SystemEmailSendConfig>( _configuration.GetSection("SystemEmailSendConfig"));
|
||||||
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
||||||
services.AddOptions().Configure<AliyunOssOptions>(_configuration.GetSection("AliyunOSS"));
|
services.AddOptions().Configure<AliyunOSSOptions>(_configuration.GetSection("AliyunOSS"));
|
||||||
|
services.AddOptions().Configure<ObjectStoreServiceOptions>(_configuration.GetSection("ObjectStoreService"));
|
||||||
|
|
||||||
|
|
||||||
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
||||||
|
|
|
@ -12,6 +12,31 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"ObjectStoreService": {
|
||||||
|
|
||||||
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
|
|
||||||
|
"AliyunOSS": {
|
||||||
|
"RegionId": "cn-shanghai",
|
||||||
|
"Endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
|
"AccessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
|
"AccessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
|
"BucketName": "zyypacs",
|
||||||
|
"RoleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||||
|
"ViewEndpoint": "https://zyypacs.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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"RegionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
"Endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"Endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
|
|
|
@ -146,7 +146,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);
|
||||||
|
|
||||||
|
@ -316,7 +316,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);
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,17 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Helper
|
namespace IRaCIS.Core.Application.Helper
|
||||||
{
|
{
|
||||||
|
public class MinIOOptions
|
||||||
|
{
|
||||||
|
public string Endpoint { get; set; }
|
||||||
|
public string Port { get; set; }
|
||||||
|
public bool UseSSL { get; set; }
|
||||||
|
public string AccessKey { get; set; }
|
||||||
|
public string SecretKey { get; set; }
|
||||||
|
public string BucketName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class AliyunOssOptions
|
public class AliyunOSSOptions
|
||||||
{
|
{
|
||||||
public string RegionId { get; set; }
|
public string RegionId { get; set; }
|
||||||
public string AccessKeyId { get; set; }
|
public string AccessKeyId { get; set; }
|
||||||
|
@ -23,15 +32,56 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
public string EndPoint { get; set; }
|
public string EndPoint { get; set; }
|
||||||
public string BucketName { get; set; }
|
public string BucketName { get; set; }
|
||||||
|
|
||||||
public string RoleArn { get;set; }
|
public string RoleArn { get; set; }
|
||||||
|
|
||||||
public string Region { get; set; }
|
public string Region { get; set; }
|
||||||
|
|
||||||
public string ViewEndpoint { 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 class ObjectStoreDTO
|
||||||
|
{
|
||||||
|
public string ObjectStoreUse { get; set; }
|
||||||
|
public AliyunOSSTempToken AliyunOSS { get; set; }
|
||||||
|
|
||||||
|
public MinIOOptions MinIO { 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 interface IOSSService
|
||||||
{
|
{
|
||||||
|
@ -41,29 +91,17 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
public class OSSService : IOSSService
|
public class OSSService : IOSSService
|
||||||
{
|
{
|
||||||
|
|
||||||
public AliyunOssOptions _OSSConfig { get; set; }
|
public AliyunOSSOptions _OSSConfig { get; set; }
|
||||||
|
|
||||||
public OssClient _ossClient { get; set; }
|
public OssClient _ossClient { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public OSSService(IOptionsMonitor<AliyunOssOptions> options)
|
public OSSService(IOptionsMonitor<AliyunOSSOptions> options)
|
||||||
{
|
{
|
||||||
var ossOptions = options.CurrentValue;
|
var ossOptions = options.CurrentValue;
|
||||||
|
|
||||||
_OSSConfig= ossOptions;
|
_OSSConfig = ossOptions;
|
||||||
|
|
||||||
//_OSSConfig = new AliyunOssOptions()
|
|
||||||
//{
|
|
||||||
// RegionId = ossOptions.RegionId,
|
|
||||||
// AccessKeyId = ossOptions.AccessKeyId,
|
|
||||||
// AccessKeySecret = ossOptions.AccessKeySecret,
|
|
||||||
// EndPoint = ossOptions.EndPoint,
|
|
||||||
// BucketName = ossOptions.BucketName,
|
|
||||||
// RoleArn = ossOptions.RoleArn,
|
|
||||||
// Region = ossOptions.Region,
|
|
||||||
// ViewEndpoint = ossOptions.ViewEndpoint
|
|
||||||
//};
|
|
||||||
|
|
||||||
_ossClient = new OssClient(_OSSConfig.EndPoint, _OSSConfig.AccessKeyId, _OSSConfig.AccessKeySecret);
|
_ossClient = new OssClient(_OSSConfig.EndPoint, _OSSConfig.AccessKeyId, _OSSConfig.AccessKeySecret);
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,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>
|
||||||
|
|
|
@ -10371,6 +10371,13 @@
|
||||||
<param name="trialQCQuestionFilterSelect"></param>
|
<param name="trialQCQuestionFilterSelect"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Contracts.TrialQCQuestionConfigureService.BatchDeteteTrialQCQuestion(IRaCIS.Core.Application.Contracts.BatchDeteteTrialQCQuestionInDto)">
|
||||||
|
<summary>
|
||||||
|
批量删除项目QC问题
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialQCQuestionConfigureService.BatchAddTrialQCQuestionConfigure(System.Collections.Generic.List{IRaCIS.Core.Application.Contracts.TrialQCQuestionConfigureBatchAdd},System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Contracts.TrialQCQuestionConfigureService.BatchAddTrialQCQuestionConfigure(System.Collections.Generic.List{IRaCIS.Core.Application.Contracts.TrialQCQuestionConfigureBatchAdd},System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
批量添加 QC 问题
|
批量添加 QC 问题
|
||||||
|
|
|
@ -295,7 +295,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpGet("{trialId:guid}")]
|
[HttpGet("{trialId:guid}")]
|
||||||
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
||||||
{
|
{
|
||||||
var query = _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
var query = _trialUserRepository.Where(t => (t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM || t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MC) && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
return await query.ToListAsync();
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -491,7 +491,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")
|
||||||
|
|
|
@ -113,13 +113,13 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
if (userTypeSelectEnum == UserTypeSelectEnum.ExternalUser)
|
if (userTypeSelectEnum == UserTypeSelectEnum.ExternalUser)
|
||||||
{
|
{
|
||||||
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.CPM, UserTypeEnum.SMM, UserTypeEnum.CMM, UserTypeEnum.EA };
|
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.CPM, UserTypeEnum.SMM, UserTypeEnum.CMM, UserTypeEnum.EA , UserTypeEnum.MC };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (userTypeSelectEnum == UserTypeSelectEnum.InnerUser)
|
if (userTypeSelectEnum == UserTypeSelectEnum.InnerUser)
|
||||||
{
|
{
|
||||||
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA ,UserTypeEnum.MW};
|
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA ,UserTypeEnum.MW,UserTypeEnum.MC};
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin)
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,5 +20,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
//Task<IResponseOutput> TrialSurveyLock(Guid trialSiteSurveyId, bool isLock);
|
//Task<IResponseOutput> TrialSurveyLock(Guid trialSiteSurveyId, bool isLock);
|
||||||
//IResponseOutput TrialSurveySubmmit(Guid trialId, Guid trialSiteSurveyId);
|
//IResponseOutput TrialSurveySubmmit(Guid trialId, Guid trialSiteSurveyId);
|
||||||
Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService);
|
Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService);
|
||||||
|
|
||||||
|
Task ImportGenerateAccountAndJoinTrialAsync(Guid trialId, string baseUrl, string routeUrl, List<SiteSurveyUserImportDto> list);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1013,5 +1013,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,7 +529,7 @@ namespace IRaCIS.Core.Application
|
||||||
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
.SelectMany(c => c.QCChallengeList)
|
.SelectMany(c => c.QCChallengeList)
|
||||||
|
|
||||||
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
|
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId==null)).Count(),
|
||||||
|
|
||||||
}).Where(x => x.ToBeDealedCount > 0); ;
|
}).Where(x => x.ToBeDealedCount > 0); ;
|
||||||
|
|
||||||
|
@ -655,7 +655,7 @@ namespace IRaCIS.Core.Application
|
||||||
TrialCode = t.TrialCode,
|
TrialCode = t.TrialCode,
|
||||||
UrgentCount = t.SubjectVisitList
|
UrgentCount = t.SubjectVisitList
|
||||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent).Count(),
|
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && (u.IsEnrollmentConfirm ||u.PDState==PDStateEnum.PDProgress || u.Trial.IsUrgent ||u.Subject.IsUrgent)/*u.IsUrgent*/).Count(),
|
||||||
|
|
||||||
|
|
||||||
ToBeDealedCount = t.SubjectVisitList
|
ToBeDealedCount = t.SubjectVisitList
|
||||||
|
@ -715,7 +715,7 @@ namespace IRaCIS.Core.Application
|
||||||
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
||||||
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
||||||
|
|
||||||
}).Where(x => x.UrgentCount > 0);
|
}).Where(x => x.ToBeClaimedCount+x.ToBeReviewedCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -1108,7 +1108,7 @@ namespace IRaCIS.Core.Application
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||||
.Select(t => new TrialToBeDoneDto()
|
.Select(t => new TrialToBeDoneDto()
|
||||||
{
|
{
|
||||||
TrialId = t.Id,
|
TrialId = t.Id,
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace IRaCIS.Application.Services
|
||||||
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
||||||
{
|
{
|
||||||
return await _trialRepository.AsQueryable().IgnoreQueryFilters()
|
return await _trialRepository.AsQueryable().IgnoreQueryFilters()
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false)
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false)
|
||||||
|
|
||||||
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using BeetleX.BNR;
|
using BeetleX;
|
||||||
|
using BeetleX.BNR;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
@ -12,6 +14,8 @@ using Microsoft.Extensions.Caching.Distributed;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
|
using Minio;
|
||||||
|
using NPOI.POIFS.Crypt;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
@ -58,7 +62,22 @@ namespace IRaCIS.Application.Services
|
||||||
//_cache = cache;
|
//_cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<IResponseOutput> TestMinIO([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
|
{
|
||||||
|
|
||||||
|
var minIO = options.CurrentValue.MinIO;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIO.Endpoint}:{minIO.Port}")
|
||||||
|
.WithCredentials(minIO.AccessKey,minIO.SecretKey)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(options);
|
||||||
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> TestDistributedLock( )
|
public async Task<IResponseOutput> TestDistributedLock( )
|
||||||
|
|
|
@ -15,11 +15,6 @@
|
||||||
IQC = 3,
|
IQC = 3,
|
||||||
|
|
||||||
|
|
||||||
////简历管理人员
|
|
||||||
//ResumeManager=4,
|
|
||||||
////简历运维人员
|
|
||||||
//ReviewerCoordinator = 5,
|
|
||||||
|
|
||||||
ReviewerCoordinator = 4,
|
ReviewerCoordinator = 4,
|
||||||
|
|
||||||
// 大屏展示
|
// 大屏展示
|
||||||
|
@ -40,6 +35,7 @@
|
||||||
CPM=12,
|
CPM=12,
|
||||||
|
|
||||||
IndependentReviewer=13,
|
IndependentReviewer=13,
|
||||||
|
|
||||||
// 医学影像经理
|
// 医学影像经理
|
||||||
MIM = 14,
|
MIM = 14,
|
||||||
|
|
||||||
|
@ -58,6 +54,14 @@
|
||||||
|
|
||||||
AIR=21,
|
AIR=21,
|
||||||
|
|
||||||
|
ZYSS=26,
|
||||||
|
|
||||||
|
ZYBS=27,
|
||||||
|
|
||||||
|
MC=30,
|
||||||
|
|
||||||
|
OP=31,
|
||||||
|
|
||||||
//医生用户类型暂不处理
|
//医生用户类型暂不处理
|
||||||
|
|
||||||
ShareImage = 125,
|
ShareImage = 125,
|
||||||
|
|
Loading…
Reference in New Issue