diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index c9bfa490c..df5b55233 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -11677,6 +11677,20 @@ 阅片问题.标准 + + + 设置项目问题导出 + + + + + + + 获取项目的导出信息 + + + + 获取自定义表格问题预览 @@ -12827,6 +12841,13 @@ + + + 标记项目删除 + + + + 真删除项目 方便清理测试数据 临床试验项目Id diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 2a35844f8..7236104fe 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -1958,15 +1958,19 @@ namespace IRaCIS.Core.Application.Service.Common var list = new List(); - var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync(); + var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule, t.IsArbitrationReading }).FirstNotNullAsync(); list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReading_Export, ExportCatogory = ExportResult.TableOfAssessmentResults }); list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReadingDetail_Export, ExportCatogory = ExportResult.DetailedTableOfAssessmentResults }); + if (criterion.IsArbitrationReading) + { + //仲裁阅片 才有裁判阅片明细表 同时要把模板里面的三列给去掉 + list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportResult.DetailedTableOfAdjudicationResults }); + } - list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportResult.DetailedTableOfAdjudicationResults }); if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB @@ -2048,7 +2052,7 @@ namespace IRaCIS.Core.Application.Service.Common [FromServices] IRepository _trialRepository) { //每次查询必须是单标准的 - var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.IsGlobalReading, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync(); + var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.IsGlobalReading, t.IsArbitrationReading, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync(); var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) @@ -2075,6 +2079,16 @@ namespace IRaCIS.Core.Application.Service.Common #region 区分导表类型 + var removeColumnIndexList = new List() { 6, 7, 8 }; + + if (inQuery.ReadingExportType == ExportResult.DetailedTableOfAdjudicationResults || + inQuery.ReadingExportType == ExportResult.DetailedTableOfAssessmentResults || + inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions || + inQuery.ReadingExportType == ExportResult.TableOfAssessmentResults) + { + removeColumnIndexList = new List() { 6, 7, 8 }; + } + var export_Template = StaticData.Export.CommonReading_Export; if (inQuery.ReadingExportType == ExportResult.DetailedTableOfAdjudicationResults) @@ -2579,9 +2593,9 @@ namespace IRaCIS.Core.Application.Service.Common { if (filteredList.Any(t => t.DoctorUserId == doctor.DoctorUserId)) { - doctor.TotalJudgeCount= filteredList.Where(t=>t.DoctorUserId==doctor.DoctorUserId).Count(); + doctor.TotalJudgeCount = filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(); - doctor.JudgeAgreeCount= filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(t => t.JudgeResultTaskId == t.VisitTaskId); + doctor.JudgeAgreeCount = filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(t => t.JudgeResultTaskId == t.VisitTaskId); } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 6167dc699..6d34f7bbf 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -27,7 +27,7 @@ namespace IRaCIS.Core.Application.Service IRepository _trialPaymentPriceRepository, IRepository _trialDictionaryRepository, IRepository _trialBodyPartRepository, - IOptionsMonitor _verifyConfig, + IOptionsMonitor _verifyConfig, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialService { @@ -411,7 +411,18 @@ namespace IRaCIS.Core.Application.Service } } + /// + /// 标记项目删除 + /// + /// + /// + [HttpDelete, Route("{trialId:guid}")] + public async Task MarkTrialDelete(Guid trialId) + { + await _trialRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialId, u => new Trial() { IsDeleted = true }); + return ResponseOutput.Ok(); + } /// 真删除项目 方便清理测试数据 /// 临床试验项目Id @@ -630,7 +641,7 @@ namespace IRaCIS.Core.Application.Service /// [HttpPost("{trialId:guid}/{status:int}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] public async Task UpdateEnrollStatus(Guid trialId, EnrollStatus status) { await _enrollDetailRepository.AddAsync(new EnrollDetail() diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 61d451cb8..16548150f 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -93,6 +93,60 @@ namespace IRaCIS.Core.Application.Service // await _oSSService.DeleteFromPrefix($"{deleteId}"); //} + + var trialIdExistList = _trialRepository.Select(t => t.Id).ToList().Select(t=>t.ToString()); + + #region 列出根目录 + + var aliConfig = _oSSService.ObjectStoreServiceOptions.AliyunOSS; + + var tempToken = _oSSService.GetObjectStoreTempToken(); + + var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, + tempToken.AliyunOSS.AccessKeyId, + tempToken.AliyunOSS.AccessKeySecret, + tempToken.AliyunOSS.SecurityToken); + + + + var folderList = new List(); + + + try + { + ObjectListing objectListing = null; + string nextMarker = null; + do + { + // 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker + objectListing = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName) + { + Prefix = "", // 根目录,留空即可 + Delimiter = "/", // 使用 "/" 来区分目录 + MaxKeys = 100, + Marker = nextMarker + }); + + folderList.AddRange(objectListing.CommonPrefixes.Select(t => t.Trim('/')).ToList()); + + + // 设置 NextMarker 以获取下一页的数据 + nextMarker = objectListing.NextMarker; + + } while (objectListing.IsTruncated); + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + + + //清理项 + + var needDeleteTrialIdList = folderList.Except(trialIdExistList).ToList(); + + #endregion + await _oSSService.DeleteFromPrefix($"{rootFolder}"); return ResponseOutput.Ok();