diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index 983cbee90..900a32a0f 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -64,7 +64,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class SetSystemReadingQuestionCriterionIsIsEnable
{
[NotDefault]
- public Guid ReadingQuestionCriterionSystemId { get; set; }
+ public Guid Id { get; set; }
[NotDefault]
public bool IsEnable { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
index 16430be18..b6536edeb 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
@@ -89,7 +89,7 @@ namespace IRaCIS.Application.Services
///
public async Task SetSystemReadingQuestionCriterionIsIsEnable(SetSystemReadingQuestionCriterionIsIsEnable inDto)
{
- await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionCriterionSystemId, x => new ReadingQuestionCriterionSystem()
+ await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem()
{
IsEnable = inDto.IsEnable
});
@@ -200,7 +200,40 @@ namespace IRaCIS.Application.Services
{
var trialUsrSystemIds = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId && x.ReadingQuestionCriterionSystemId != null)
.Select(x => x.ReadingQuestionCriterionSystemId);
- var needAddSystemDataList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id)).ToListAsync();
+ var needAddSystemDataList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id)&&x.IsEnable).Include(x=>x.ReadingQuestionSystemList).ToListAsync();
+
+ List needAddCriterionList = new List();
+ List needAddQuestionList = new List();
+
+ needAddSystemDataList.ForEach(x =>
+ {
+ var criterion = new ReadingQuestionCriterionTrial()
+ {
+ CriterionName = x.CriterionName,
+ IsEnable = false,
+ ReadingQuestionCriterionSystemId = x.Id,
+ TrialId = trialId,
+ Id = NewId.NextGuid(),
+ };
+
+ List systemQuestionList = x.ReadingQuestionSystemList.Clone();
+
+
+
+ });
+
+
+
+ }
+
+ ///
+ /// 递归处理父子问题关系
+ ///
+ private async Task SetChildParentQuestion(Guid trialId, List systemQuesitonList,List needQuestionList)
+ {
+ var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList();
+
+
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs
index 52e3cf354..16b63aaf0 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionCriterionSystem.cs
@@ -40,8 +40,8 @@ namespace IRaCIS.Core.Domain.Models
///
public Guid CreateUserId { get; set; }
-
+ public List ReadingQuestionSystemList { get; set; } = new List();
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionSystem.cs
index acb791c6e..1f5a65563 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingQuestionSystem.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionSystem.cs
@@ -56,6 +56,7 @@ namespace IRaCIS.Core.Domain.Models
///
public string TypeValue { get; set; }
+
public bool IsEnable { get; set; }
///
@@ -68,6 +69,9 @@ namespace IRaCIS.Core.Domain.Models
///
public Guid CreateUserId { get; set; }
+ [ForeignKey("ReadingQuestionCriterionSystemId")]
+ public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
+
}