From cc0933da8ab33c57820acaa49ee9ba2d81a72eb2 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 19 Sep 2022 14:44:29 +0800 Subject: [PATCH] =?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/ReadingQuestionViewModel.cs | 21 +++++++++++++++++- .../Service/Reading/ReadingQuestionService.cs | 22 ++++++------------- .../Service/Reading/_MapConfig.cs | 5 ++++- .../Reading/ReadingQuestionCriterionSystem.cs | 5 ++++- .../Reading/ReadingQuestionCriterionTrial.cs | 6 +++++ 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 9be2e4325..b2ae24ff3 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -325,6 +325,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid TrialId { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + /// /// 排序 /// @@ -370,6 +375,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string CriterionName { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + /// /// 是否启用 /// @@ -1160,8 +1170,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int QuestionCount { get; set; } - + /// + /// 描述 + /// + public string Description { get; set; } public bool IsBeUsed { get; set; } = false; } @@ -1204,6 +1217,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public FormType FormType { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + + /// /// 修约小数点 /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index c9c5d25c8..efa4fb1c6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -1088,26 +1088,18 @@ namespace IRaCIS.Application.Services .Select(x => x.ReadingQuestionCriterionSystemId); var trialCriterionNames= _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId) .Select(x => x.CriterionName); - var needAddSystemDataList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id)&&x.IsEnable&& !trialCriterionNames.Contains(x.CriterionName)).Include(x=>x.ReadingQuestionSystemList).ToListAsync(); - List needAddCriterionList = new List(); + List needAddCriterionList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id)&&x.IsEnable&& !trialCriterionNames.Contains(x.CriterionName)).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + List needAddQuestionList = new List(); - needAddSystemDataList.ForEach(x => + needAddCriterionList.ForEach(x => { - var criterion = new ReadingQuestionCriterionTrial() - { - CriterionName = x.CriterionName, - IsEnable = false, - ReadingQuestionCriterionSystemId = x.Id, - TrialId = trialId, - IsCompleteConfig=x.IsCompleteConfig, - Id = NewId.NextGuid(), - }; - List systemQuestionList = x.ReadingQuestionSystemList.Clone(); - + x.IsEnable = false; + x.TrialId = trialId; + x.ReadingQuestionCriterionSystemId = x.Id; + x.Id = NewId.NextGuid(); // 同步问题暂时注释 //List readingQuestionTrialList = new List(); //SetChildParentQuestion(criterion.Id, trialId, systemQuestionList, readingQuestionTrialList); - needAddCriterionList.Add(criterion); //needAddQuestionList.AddRange(readingQuestionTrialList); }); await _readingQuestionCriterionTrialRepository.AddRangeAsync(needAddCriterionList); diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 986d4f365..d36fb4ef5 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -114,7 +114,10 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id)); - + CreateMap() + .ForMember(dest => dest.ReadingQuestionTrialList, opt => opt.Ignore()) + .ForMember(d => d.ReadingQuestionCriterionSystemId, u => u.MapFrom(s => s.Id)); ; + CreateMap(); CreateMap() diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs index 0e3172cdf..1882e622e 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs @@ -44,7 +44,10 @@ namespace IRaCIS.Core.Domain.Models /// public DateTime ConfirmTime { get; set; } - + /// + /// 描述 + /// + public string Description { get; set; } /// /// 创建人 diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionTrial.cs index de3da00e1..3260fa297 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionTrial.cs @@ -54,6 +54,12 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + + /// + /// 描述 + /// + public string Description { get; set; } + /// /// 是否确认 ///