From 44f3b58bad1859afee873ba1546f82e96eae5ff0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 28 Oct 2024 11:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=81=E5=88=A4=E4=BB=BB=E5=8A=A1=E6=A0=87?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 66 +++++++++++-------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index b11a2a1da..625646d3f 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2049,44 +2049,54 @@ namespace IRaCIS.Core.Application.Service.Common var dynamicLessionTitleList = lessionAnserList.Select(t => new DymamicQuestionInfo { QuestionMark = t.QuestionMark, QuestionName = t.QuestionName, TranslateDicName = t.TranslateDicName }).Distinct(); var dynamicTitleList = dynamicExtraAddTitleList.Union(dynamicLessionTitleList).ToList(); - //最终的病灶列表 + //最终的病灶列表 要把裁判的也要加进去 list = new List(); foreach (var item in taskList) { - - foreach (var lession in item.LesionList) + if (item.LesionList.Count > 0) { - var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault() ?? new CommonLessionQuestionAnswerInfo(); - - var addLessionInfoList = new List(); - - if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB - || criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET) + foreach (var lession in item.LesionList) { - //病灶编号 和病灶类型没有配置,但是需要有的 - addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号", QuestionValue = firstLessionAnser.LessionCode }); - addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" }); + var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault() ?? new CommonLessionQuestionAnswerInfo(); + var addLessionInfoList = new List(); + + if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB + || criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET) + { + //病灶编号 和病灶类型没有配置,但是需要有的 + addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号", QuestionValue = firstLessionAnser.LessionCode }); + addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" }); + + } + else if (criterion.CriterionType == CriterionType.PCWG3) + { + addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" }); + } + + + var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName }); + + + //有三部分组成 外层问题+ 没有配置的编号和类型+ 动态的表格问题 + var dynamicLessionInfoList = addLessionInfoList.Union(dynamicPartialLessionInfoList).Union(item.QuestionAnswerList).ToList(); + + var cloneItem = item.Clone(); + cloneItem.QuestionAnswerList = dynamicLessionInfoList; + + list.Add(cloneItem); } - else if (criterion.CriterionType == CriterionType.PCWG3) - { - addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" }); - } - - - var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName }); - - - //有三部分组成 外层问题+ 没有配置的编号和类型+ 动态的表格问题 - var dynamicLessionInfoList = addLessionInfoList.Union(dynamicPartialLessionInfoList).Union(item.QuestionAnswerList).ToList(); - - var cloneItem = item.Clone(); - cloneItem.QuestionAnswerList = dynamicLessionInfoList; - - list.Add(cloneItem); } + else + { + //要把裁判任务加进去 + + list.Add(item); + } + + }