From 47d8ec7576646f59c59654876ed2914a3cbc458e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 13 Aug 2024 09:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E5=88=86=E6=9E=90=E4=BB=BB=E5=8A=A1=E5=92=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 7 +++ IRaCIS.Core.Application/TestService.cs | 53 ++++++++++++++----- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 7ec1606de..36374a2b0 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -15383,6 +15383,13 @@ + + + 清理一致性分析任务 + + + + 维护临床数据 --一定要在同步表前同步数据才行 diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 104a44f53..a28a9588c 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -69,6 +69,31 @@ namespace IRaCIS.Application.Services //_cache = cache; } + /// + /// 清理一致性分析任务 + /// + /// + /// + public async Task DeleteConsistentDate(Guid trialReadingCriterionId) + { + + + var consistentSubjectIdList = _repository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == true).Select(t => t.SubjectId).ToList(); + + await _repository.BatchDeleteAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId); + + await _repository.BatchDeleteAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == true); + + + + await _repository.BatchDeleteAsync(t => consistentSubjectIdList.Contains(t.ReadingConsistentClinicalData.SubjectId)); + + await _repository.BatchDeleteAsync(t => consistentSubjectIdList.Contains(t.SubjectId)); + + + await _repository.SaveChangesAsync(); + return ResponseOutput.Ok(); + } public async Task TestEFcore8() @@ -274,22 +299,22 @@ namespace IRaCIS.Application.Services throw new BusinessValidationFailedException("word 模板没有英文书签"); } - // 创建一个要删除段落的列表 + // 创建一个要删除段落的列表 - //XWPFParagraph bookmarkParagraph = null; + //XWPFParagraph bookmarkParagraph = null; - //foreach (var paragraph in doc.Paragraphs) - //{ + //foreach (var paragraph in doc.Paragraphs) + //{ - // foreach (var bookmark in paragraph.GetCTP().GetBookmarkStartList()) - // { - // if (bookmark.name == "en_us") - // { - // bookmarkParagraph = paragraph; - // break; - // } - // } - //} + // foreach (var bookmark in paragraph.GetCTP().GetBookmarkStartList()) + // { + // if (bookmark.name == "en_us") + // { + // bookmarkParagraph = paragraph; + // break; + // } + // } + //} @@ -300,7 +325,7 @@ namespace IRaCIS.Application.Services // doc.RemoveBodyElement(i); //} - + using (FileStream outStream = new FileStream("C:\\Users\\hang\\Desktop\\test1.docx", FileMode.Create, FileAccess.Write)) {