From b7d3a365b4afd584fff3169589c7fe5976fbd618 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 7 Nov 2024 10:01:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingTaskQuestionService.cs | 78 ++++++------------- .../Service/Reading/_MapConfig.cs | 2 + 2 files changed, 24 insertions(+), 56 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index 795d8764b..04f169c87 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -1,9 +1,12 @@ -using IRaCIS.Core.Application.Contracts; +using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; using Microsoft.AspNetCore.Mvc; +using NPOI.POIFS.Properties; using Panda.DynamicWebApi.Attributes; +using System.Collections.Generic; namespace IRaCIS.Core.Application.Service { @@ -265,64 +268,27 @@ namespace IRaCIS.Core.Application.Service public void FindSystemChildQuestion(GetSystemReadingQuestionOutDto item, List questionlists, List tableQuestions) { item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupId == item.Id)).ToList(); - - item.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetSystemReadingQuestionOutDto + var itemChild = _mapper.Map>(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).ToList()); + itemChild.ForEach(x => { - Childrens = new List(), - ShowOrder = x.ShowOrder, - GroupName = string.Empty, - Id = x.Id, - Type = x.Type, - DictionaryCode = x.DictionaryCode, - TableQuestionType = x.TableQuestionType, - DependParentId = x.DependParentId, - IsDepend = x.IsDepend, - QuestionMark = x.QuestionMark, - TypeValue = x.TypeValue, - RelevanceId = x.RelevanceId, - IsRequired = x.IsRequired, - RelevanceValue = x.RelevanceValue, - ImageCount = 0, - ParentId = item.Id, - ShowQuestion=x.ShowQuestion, - DataTableColumn = x.DataTableColumn, - LesionType = item.LesionType, - QuestionName = x.QuestionName, - IsCopy=x.IsCopy, - ClassifyTableQuestionId= x.ClassifyTableQuestionId, - ClassifyAlgorithms=x.ClassifyAlgorithms, - RelationQuestions = tableQuestions.Where(z => (z.DependParentId ?? default(Guid)) == x.Id).Select(x => new GetSystemReadingQuestionOutDto + x.Childrens = new List(); + x.GroupName = string.Empty; + x.ImageCount = 0; + x.ParentId = item.Id; + var relationQuestions= _mapper.Map>(tableQuestions.Where(z => (z.DependParentId ?? default(Guid)) == x.Id).ToList()); + relationQuestions.ForEach(y => { - Childrens = new List(), - ShowOrder = x.ShowOrder, - GroupName = string.Empty, - Id = x.Id, - DictionaryCode = x.DictionaryCode, - Type = x.Type, - ShowQuestion = x.ShowQuestion, - TableQuestionType = x.TableQuestionType, - DependParentId = x.DependParentId, - IsDepend = x.IsDepend, - QuestionMark = x.QuestionMark, - TypeValue = x.TypeValue, - RelevanceId = x.RelevanceId, - RelevanceValue = x.RelevanceValue, - ImageCount = 0, - ParentId = item.Id, - DataTableColumn = x.DataTableColumn, - LesionType = item.LesionType, - QuestionName = x.QuestionName, - RelationQuestions = new List(), - Remark = x.Remark, - IsCopy = x.IsCopy, - ClassifyTableQuestionId = x.ClassifyTableQuestionId, - ClassifyAlgorithms = x.ClassifyAlgorithms, - - }).ToList(), - Remark = x.Remark, - - })); + y.Childrens = new List(); + y.GroupName = string.Empty; + y.ImageCount = 0; + y.ParentId = item.Id; + y.LesionType = item.LesionType; + y.RelationQuestions = new List(); + }); + x.RelationQuestions= relationQuestions; + }); + item.Childrens.AddRange(itemChild); if (item.Childrens != null && item.Childrens.Count != 0) { item.Childrens.ForEach(x => diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index c906330fd..73aad5acf 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -211,6 +211,8 @@ namespace IRaCIS.Core.Application.Service CreateMap() ; + CreateMap(); + CreateMap(); CreateMap() .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); From b89cfeb90c66e2cdfb022605724ae8aca3ecf64a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 7 Nov 2024 10:19:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 3 ++ .../ReadingImageTaskService.cs | 43 ++++++------------- .../Service/Reading/_MapConfig.cs | 3 ++ 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 071c9b024..e165d3563 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -2436,6 +2436,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string Type { get; set; } + public ValueUnit? Unit { get; set; } + /// /// ParentId /// @@ -2566,6 +2568,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid ReadingQuestionCriterionSystemId { get; set; } + public ValueUnit? Unit { get; set; } /// /// 问题类型 diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 0a661d684..733d7bc52 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1,4 +1,5 @@ -using IRaCIS.Core.Application.Contracts; +using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; @@ -14,6 +15,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using NPOI.POIFS.Properties; using NPOI.SS.Formula.Functions; using Panda.DynamicWebApi.Attributes; using ZiggyCreatures.Caching.Fusion; @@ -1308,38 +1310,19 @@ namespace IRaCIS.Core.Application.Service item.TableQuestions = new TrialReadTableQuestion(); item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList(); - item.TableQuestions.Questions.ForEach(x => { - - x.RelationQuestions = tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id).Select(x => new GetTrialReadingQuestionOutDto + x.RelationQuestions= _mapper.Map>(tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id)); + x.RelationQuestions.ForEach(y => { - Childrens = new List(), - ShowOrder = x.ShowOrder, - GroupName = string.Empty, - Id = x.Id, - DictionaryCode = x.DictionaryCode, - Type = x.Type, - TableQuestionType = x.TableQuestionType, - DependParentId = x.DependParentId, - IsDepend = x.IsDepend, - QuestionMark = x.QuestionMark, - TypeValue = x.TypeValue, - RelevanceId = x.RelevanceId, - RelevanceValue = x.RelevanceValue, - ImageCount = 0, - ParentId = item.Id, - DataTableColumn = x.DataTableColumn, - LesionType = item.LesionType, - QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), - RelationQuestions = new List(), - Remark = x.Remark, - ValueType = x.ValueType, - Unit = x.Unit, - ClassifyAlgorithms=x.ClassifyAlgorithms, - IsCopy=x.IsCopy, - ClassifyTableQuestionId=x.ClassifyTableQuestionId, - }).ToList(); + y.Childrens = new List(); + y.GroupName = string.Empty; + y.ImageCount = 0; + y.ParentId = item.Id; + y.LesionType = item.LesionType; + y.RelationQuestions = new List(); + }); + }); var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList(); diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 73aad5acf..15258cf36 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -353,6 +353,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)) .ForMember(x => x.Id, y => y.MapFrom(z => z.Id)); + CreateMap(); + + //CreateMap() // .ForMember(x => x.VisitTaskId, y => y.MapFrom(z => z.Id)) // .ForMember(x => x.JudgeResultArm, y => y.MapFrom(z => (z.JudgeResultTask==null?null:z.JudgeResultTask.ArmEnum)));