From f7f84ef28a6433ec8c1986ca00073f488a93aba3 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 21 Aug 2023 13:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=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 | 23 ++++++---- .../ReadingQuestionService.cs | 9 ++-- .../ReadingQuestionSystem.cs | 38 ++++++++++++++++- .../ReadingTableQuestionSystem.cs | 42 ++++++++++++++++++- 4 files changed, 99 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 6843367cd..487c714f8 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -514,11 +514,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string QuestionEnName { get; set; } = string.Empty; - + + public List ParentTriggerValueList { get; set; } + public List RelevanceValueList { get; set; } - - } + } public class ReadingCriterionPageView { @@ -1038,10 +1039,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 备注 - /// - public string Remark { get; set; } + public List ParentTriggerValueList { get; set; } + public List RelevanceValueList { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } /// /// 数据来源 @@ -1730,7 +1734,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 问题英文分组 /// public string GroupEnName { get; set; } = string.Empty; - } + + public List ParentTriggerValueList { get; set; } + public List RelevanceValueList { get; set; } + } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 4e227fb40..488f36dda 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -271,6 +271,8 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task AddOrUpdateReadingQuestionSystem(AddOrUpdateReadingQuestionSystemInDto indto) { + indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList); + indto.RelevanceValue = string.Join(',', indto.RelevanceValueList); if (indto.Id != null) { var trialIdList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionSystemId == indto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None) @@ -371,10 +373,11 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task AddOrUpdateReadingTableQuestionSystem(ReadingTableQuestionSystemAddOrEdit addOrEditReadingTableQuestionSystem) + public async Task AddOrUpdateReadingTableQuestionSystem(ReadingTableQuestionSystemAddOrEdit indto) { - - var entity = await _readingTableQuestionSystemRepository.InsertOrUpdateAsync(addOrEditReadingTableQuestionSystem, true); + indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList); + indto.RelevanceValue = string.Join(',', indto.RelevanceValueList); + var entity = await _readingTableQuestionSystemRepository.InsertOrUpdateAsync(indto, true); return ResponseOutput.Ok(entity.Id.ToString()); diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs index fee763d72..5470d094c 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs @@ -5,6 +5,7 @@ using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Collections.Generic; +using System.Linq; namespace IRaCIS.Core.Domain.Models { @@ -221,9 +222,44 @@ namespace IRaCIS.Core.Domain.Models [ForeignKey("RelevanceId")] public ReadingQuestionSystem RelevanceReadingQuestionSystem { get; set; } + [NotMapped] + public List ParentTriggerValueList + { + get + { + try + { + return this.ParentTriggerValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } - } + [NotMapped] + public List RelevanceValueList + { + get + { + try + { + return this.RelevanceValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } + + } diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs index ba44b85dd..56172b94e 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs @@ -7,6 +7,9 @@ using System; using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Collections.Generic; +using System.Linq; + namespace IRaCIS.Core.Domain.Models { /// @@ -176,7 +179,44 @@ namespace IRaCIS.Core.Domain.Models [ForeignKey("DependParentId")] [JsonIgnore] public ReadingTableQuestionSystem DependParentQuestion { get; set; } - } + + [NotMapped] + public List ParentTriggerValueList + { + get + { + try + { + return this.ParentTriggerValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } + + + [NotMapped] + public List RelevanceValueList + { + get + { + try + { + return this.RelevanceValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } + } }