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
6f1651dfc5
|
@ -93,7 +93,9 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
|
|
||||||
public void DownLoadFromOSS(string ossRelativePath, string localFilePath);
|
public void DownLoadFromOSS(string ossRelativePath, string localFilePath);
|
||||||
|
|
||||||
|
public AliyunOSSOptions _OSSConfig { get; set; }
|
||||||
|
|
||||||
|
public OssClient _ossClient { get; set; }
|
||||||
}
|
}
|
||||||
public class OSSService : IOSSService
|
public class OSSService : IOSSService
|
||||||
{
|
{
|
||||||
|
|
|
@ -3977,6 +3977,11 @@
|
||||||
受试者ID
|
受试者ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetCanChangeReadVisitListInDto.ReadingSetType">
|
||||||
|
<summary>
|
||||||
|
阅片配置的类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ChangeCutOffVisitInDto.Name">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ChangeCutOffVisitInDto.Name">
|
||||||
<summary>
|
<summary>
|
||||||
模块名称
|
模块名称
|
||||||
|
@ -13896,6 +13901,12 @@
|
||||||
<param name="outEnrollTime"></param>
|
<param name="outEnrollTime"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.TestService.OldLocalImageResizeJpg(IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
|
||||||
|
<summary>
|
||||||
|
维护OSS 影像数据
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.TestService.ModifyClinicalDataTable">
|
<member name="M:IRaCIS.Application.Services.TestService.ModifyClinicalDataTable">
|
||||||
<summary>
|
<summary>
|
||||||
维护临床数据 --一定要在同步表前同步数据才行
|
维护临床数据 --一定要在同步表前同步数据才行
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
||||||
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
||||||
}).Where(x => x.ToBeRepliedCount > 0);
|
}).Where(x => x.ToBeRepliedCount+x.ToBeCheckedCount > 0);
|
||||||
|
|
||||||
|
|
||||||
var defalutSortArray = new string[] { nameof(CheckToBeDoneDto.UrgentCount) + " desc", nameof(CheckToBeDoneDto.ToBeCheckedCount) + " desc" };
|
var defalutSortArray = new string[] { nameof(CheckToBeDoneDto.UrgentCount) + " desc", nameof(CheckToBeDoneDto.ToBeCheckedCount) + " desc" };
|
||||||
|
@ -679,7 +679,7 @@ namespace IRaCIS.Core.Application
|
||||||
{
|
{
|
||||||
|
|
||||||
var query = _trialRepository
|
var query = _trialRepository
|
||||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||||
.Select(t => new ImageSubmittedToBeDoneDto()
|
.Select(t => new ImageSubmittedToBeDoneDto()
|
||||||
{
|
{
|
||||||
TrialId = t.Id,
|
TrialId = t.Id,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using BeetleX;
|
using Aliyun.OSS;
|
||||||
|
using BeetleX;
|
||||||
using BeetleX.BNR;
|
using BeetleX.BNR;
|
||||||
|
using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
|
||||||
using IRaCIS.Core.Application.Helper;
|
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;
|
||||||
|
@ -15,7 +17,9 @@ using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
using Minio;
|
using Minio;
|
||||||
|
using NPOI.HPSF;
|
||||||
using NPOI.POIFS.Crypt;
|
using NPOI.POIFS.Crypt;
|
||||||
|
using Spire.Doc;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
@ -62,6 +66,96 @@ namespace IRaCIS.Application.Services
|
||||||
//_cache = cache;
|
//_cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 维护OSS 影像数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[AllowAnonymous]
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task<IResponseOutput> OldLocalImageResizeJpg([FromServices] IOSSService oSSService, [FromServices] IRepository _repository, [FromServices] IWebHostEnvironment _hostEnvironment)
|
||||||
|
{
|
||||||
|
|
||||||
|
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||||
|
|
||||||
|
var studyList = _repository.Where<DicomStudy>(t => t.SeriesList.Any(t=>t.ImageResizePath.Length < 10)).Select(t => new { t.TrialId, t.SiteId, t.SubjectId, t.SubjectVisitId, t.Id }).ToList();
|
||||||
|
|
||||||
|
foreach (var studyitem in studyList)
|
||||||
|
{
|
||||||
|
|
||||||
|
var relativePath = $"{studyitem.TrialId}/{studyitem.SiteId}/{studyitem.SubjectId}/{studyitem.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{studyitem.Id}/";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string nextMarker = null;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
||||||
|
var objectListing = oSSService._ossClient.ListObjects(new ListObjectsRequest(oSSService._OSSConfig.bucketName)
|
||||||
|
{
|
||||||
|
Prefix = relativePath,
|
||||||
|
MaxKeys = 1000,
|
||||||
|
Marker = nextMarker
|
||||||
|
});
|
||||||
|
|
||||||
|
var jpgInfoList = objectListing.ObjectSummaries
|
||||||
|
.Where(summary => summary.Key.EndsWith(".jpg"))
|
||||||
|
.Select(summary =>
|
||||||
|
{
|
||||||
|
string fileName = summary.Key.Split('/').Last(); // 提取文件夹名
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
|
||||||
|
Key = summary.Key,
|
||||||
|
InstanceId = Guid.TryParse(
|
||||||
|
fileName.Split('.')[0],
|
||||||
|
out Guid instanceId)
|
||||||
|
? instanceId
|
||||||
|
: Guid.Empty
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.Where(info => info.InstanceId != Guid.Empty)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach ( var jpg in jpgInfoList)
|
||||||
|
{
|
||||||
|
var seriesId= _repository.Where<DicomInstance>(t=>t.Id==jpg.InstanceId).Select(t=>t.SeriesId).FirstOrDefault();
|
||||||
|
|
||||||
|
await _repository.BatchUpdateAsync<DicomSeries>(t => t.Id == seriesId, t => new DicomSeries() { ImageResizePath ="/" +jpg.Key });
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置 NextMarker 以获取下一页的数据
|
||||||
|
nextMarker = objectListing.NextMarker;
|
||||||
|
|
||||||
|
} while (!string.IsNullOrEmpty(nextMarker));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error: {ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
await _repository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> TestEFcore8()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
await _dicRepository._dbContext.Subject.Where(t => t.Id == Guid.Empty).ExecuteUpdateAsync(t => t
|
||||||
|
.SetProperty(c => EF.Property<DateTime>(c, "UpdateTime"), u => DateTime.Now)
|
||||||
|
.SetProperty(c => c.FirstName, u => "NewUserName"));
|
||||||
|
|
||||||
|
await _repository.BatchUpdateAsync<Subject>(t => t.Id == Guid.Empty, u => new Subject() { FirstName = "fddd", LastName = "sss" });
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
// 设置 Ne
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> TestMinIO([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
public async Task<IResponseOutput> TestMinIO([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue