From cb4296396f5598ff0728eddaeb4dc31efa45345a Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Tue, 15 Oct 2024 10:29:31 +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 | 67 +++++++++++++++----
.../ReadingQuestionService.cs | 3 +
.../ReadingQuestionSystem.cs | 21 +++++-
.../ReadingQuestionTrial.cs | 21 +++++-
4 files changed, 96 insertions(+), 16 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index c3ddf2791..4edabb87c 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -1,5 +1,7 @@
using IRaCIS.Core.Domain.Share;
+using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Application.Service.Reading.Dto
{
@@ -850,10 +852,27 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public ExportIdentification? ExportIdentification { get; set; }
- ///
- /// 导出结果
- ///
- public ExportResult? ExportResult { get; set; }
+ [Comment("导出结果")]
+ public string ExportResultStr { get; set; } = "[]";
+
+ [NotMapped]
+ public List ExportResult
+ {
+ get
+ {
+ try
+ {
+ var result = JsonConvert.DeserializeObject>(this.ExportResultStr);
+ return result == null ? new List() : result;
+ }
+ catch (Exception)
+ {
+
+ return new List();
+ }
+
+ }
+ }
///
/// 分组
@@ -1124,8 +1143,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
[Comment("导出标识")]
public ExportIdentification? ExportIdentification { get; set; }
- [Comment("导出结果")]
- public ExportResult? ExportResult { get; set; }
+ public string ExportResultStr { get; set; } = "[]";
+
+ public List ExportResult
+ {
+ get
+ {
+ try
+ {
+ var result = JsonConvert.DeserializeObject>(this.ExportResultStr);
+ return result == null ? new List() : result;
+ }
+ catch (Exception)
+ {
+
+ return new List();
+ }
+
+ }
+ }
///
/// 数值类型
@@ -1673,10 +1709,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public ExportIdentification? ExportIdentification { get; set; }
- ///
- /// 导出结果
- ///
- public ExportResult? ExportResult { get; set; }
+
+ [Comment("导出结果")]
+ public string ExportResultStr { get; set; } = "[]";
+
+ public List ExportResult { get; set; } = new List();
///
/// 数值类型
@@ -1901,10 +1938,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public ExportIdentification? ExportIdentification { get; set; }
- ///
- /// 导出结果
- ///
- public ExportResult? ExportResult { get; set; }
+ [Comment("导出结果")]
+ public string ExportResultStr { get; set; } = "[]";
+
+ public List ExportResult { get; set; } = new List();
+
+
public bool IsAdditional { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
index 48dc290c4..886b79fde 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
@@ -233,6 +233,8 @@ namespace IRaCIS.Core.Application.Service
{
indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList);
indto.RelevanceValue = string.Join(',', indto.RelevanceValueList);
+
+ indto.ExportResultStr = JsonConvert.SerializeObject(indto.ExportResult);
indto.HighlightAnswer = JsonConvert.SerializeObject(indto.HighlightAnswerList);
if (indto.Id != null)
{
@@ -398,6 +400,7 @@ namespace IRaCIS.Core.Application.Service
throw new BusinessValidationFailedException(_localizer["ReadingQuestion_IdDup"]);
}
indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList);
+ indto.ExportResultStr = JsonConvert.SerializeObject(indto.ExportResult);
indto.RelevanceValue = string.Join(',', indto.RelevanceValueList);
indto.HighlightAnswer = JsonConvert.SerializeObject(indto.HighlightAnswerList);
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
index 190fa13ed..c41cea6a3 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
@@ -195,5 +195,24 @@ public class ReadingQuestionSystem : BaseAddAuditEntity
public ExportIdentification? ExportIdentification { get; set; }
[Comment("导出结果")]
- public ExportResult? ExportResult { get; set; }
+ public string ExportResultStr { get; set; } = "[]";
+
+ [NotMapped]
+ public List ExportResult
+ {
+ get
+ {
+ try
+ {
+ var result = JsonConvert.DeserializeObject>(this.ExportResultStr);
+ return result == null ? new List() : result;
+ }
+ catch (Exception)
+ {
+
+ return new List();
+ }
+
+ }
+ }
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
index 69f92ff37..ddbb78ff9 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
@@ -260,7 +260,26 @@ public class ReadingQuestionTrial : BaseAddAuditEntity
public ExportIdentification? ExportIdentification { get; set; }
[Comment("导出结果")]
- public ExportResult? ExportResult { get; set; }
+ public string ExportResultStr { get; set; } = "[]";
+
+ [NotMapped]
+ public List ExportResult
+ {
+ get
+ {
+ try
+ {
+ var result = JsonConvert.DeserializeObject>(this.ExportResultStr);
+ return result == null ? new List() : result;
+ }
+ catch (Exception)
+ {
+
+ return new List();
+ }
+
+ }
+ }
}
public class CalculateInfo
{