From 01796ad34495433aeb1e417bf9595e3bbdd15246 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 25 Aug 2022 14:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingQuestionViewModel.cs | 100 ++++++++++-------- .../Service/Reading/_MapConfig.cs | 3 +- .../Reading/ReadingTableQuestionTrial.cs | 4 + 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 5779c8139..b52b8d9f4 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -25,49 +25,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string CriterionName { get; set; } } - public class ReadingTableQuestionTrialView: ReadingTableQuestionSystemView + public class ReadingTableQuestionTrialView:ReadingTableQuestionTrial { - + public int? DependShowOrder { get; set; } } - public class ReadingTableQuestionSystemView - { - public Guid Id { get; set; } - public Guid ReadingQuestionId { get; set; } - public string Type { get; set; } - public Guid? ParentId { get; set; } - public string ParentTriggerValue { get; set; } - public string QuestionName { get; set; } - public int IsRequired { get; set; } - public int ShowOrder { get; set; } - public string TypeValue { get; set; } - public bool IsEnable { get; set; } - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public string Remark { get; set; } - public Guid? RelevanceId { get; set; } - public string RelevanceValue { get; set; } - public int ShowQuestion { get; set; } - public int? MaxRowCount { get; set; } - public string DataTableName { get; set; } - public string DataTableColumn { get; set; } + public class ReadingTableQuestionSystemView : ReadingTableQuestionSystem + { public int? DependShowOrder { get; set; } - /// - /// 表格问题类型 - /// - public TableQuestionType TableQuestionType { get; set; } - - - /// - /// 依赖父问题 - /// - public Guid? DependParentId { get; set; } - - /// - /// 问题标识 - /// - public QuestionMark? QuestionMark { get; set; } } @@ -85,33 +51,73 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class ReadingTableQuestionTrialAddOrEdit: ReadingTableQuestionSystemAddOrEdit + public class ReadingTableQuestionTrialAddOrEdit { + public Guid? Id { get; set; } + public Guid ReadingQuestionId { get; set; } + public string Type { get; set; } = string.Empty; + public Guid? ParentId { get; set; } + public string ParentTriggerValue { get; set; } = string.Empty; + public string QuestionName { get; set; } = string.Empty; + public int IsRequired { get; set; } + public int ShowOrder { get; set; } + public string TypeValue { get; set; } = string.Empty; + public bool IsEnable { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public string Remark { get; set; } + public Guid? RelevanceId { get; set; } + public string RelevanceValue { get; set; } = string.Empty; + public int ShowQuestion { get; set; } + public int? MaxRowCount { get; set; } + public string DataTableName { get; set; } = string.Empty; + public string DataTableColumn { get; set; } = string.Empty; - } + /// + /// 表格问题类型 + /// + public TableQuestionType? TableQuestionType { get; set; } + + /// + /// 依赖父问题 + /// + public Guid? DependParentId { get; set; } + + + + /// + /// 项目标准Id + /// + public Guid TrialCriterionId { get; set; } + + /// + /// 问题标识 + /// + public QuestionMark? QuestionMark { get; set; } + } /// ReadingTableQuestionSystemAddOrEdit 列表查询参数模型 public class ReadingTableQuestionSystemAddOrEdit { public Guid? Id { get; set; } public Guid ReadingQuestionId { get; set; } - public string Type { get; set; } + public string Type { get; set; } = string.Empty; public Guid? ParentId { get; set; } - public string ParentTriggerValue { get; set; } - public string QuestionName { get; set; } + public string ParentTriggerValue { get; set; } = string.Empty; + public string QuestionName { get; set; } = string.Empty; public int IsRequired { get; set; } public int ShowOrder { get; set; } - public string TypeValue { get; set; } + public string TypeValue { get; set; } = string.Empty; public bool IsEnable { get; set; } public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } public string Remark { get; set; } public Guid? RelevanceId { get; set; } - public string RelevanceValue { get; set; } + public string RelevanceValue { get; set; } = string.Empty; public int ShowQuestion { get; set; } public int? MaxRowCount { get; set; } - public string DataTableName { get; set; } - public string DataTableColumn { get; set; } + public string DataTableName { get; set; } = string.Empty; + public string DataTableColumn { get; set; } = string.Empty; /// /// 表格问题类型 diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 1cb426e22..7cb6a68ef 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -59,7 +59,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder)); - CreateMap(); + CreateMap() + .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder)); CreateMap(); CreateMap(); diff --git a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs index 29c0b3f06..b01f10501 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs @@ -136,6 +136,10 @@ namespace IRaCIS.Core.Domain.Models /// public QuestionMark? QuestionMark { get; set; } + + [ForeignKey("DependParentId")] + public ReadingTableQuestionTrial DependParentQuestion { get; set; } + }