修改一版
parent
8a459af6c6
commit
fb6c236b71
|
@ -64,7 +64,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public class SetSystemReadingQuestionCriterionIsIsEnable
|
public class SetSystemReadingQuestionCriterionIsIsEnable
|
||||||
{
|
{
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IResponseOutput> SetSystemReadingQuestionCriterionIsIsEnable(SetSystemReadingQuestionCriterionIsIsEnable inDto)
|
public async Task<IResponseOutput> SetSystemReadingQuestionCriterionIsIsEnable(SetSystemReadingQuestionCriterionIsIsEnable inDto)
|
||||||
{
|
{
|
||||||
await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionCriterionSystemId, x => new ReadingQuestionCriterionSystem()
|
await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem()
|
||||||
{
|
{
|
||||||
IsEnable = inDto.IsEnable
|
IsEnable = inDto.IsEnable
|
||||||
});
|
});
|
||||||
|
@ -200,7 +200,40 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
var trialUsrSystemIds = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId && x.ReadingQuestionCriterionSystemId != null)
|
var trialUsrSystemIds = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId && x.ReadingQuestionCriterionSystemId != null)
|
||||||
.Select(x => x.ReadingQuestionCriterionSystemId);
|
.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<ReadingQuestionCriterionTrial> needAddCriterionList = new List<ReadingQuestionCriterionTrial>();
|
||||||
|
List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
|
||||||
|
|
||||||
|
needAddSystemDataList.ForEach(x =>
|
||||||
|
{
|
||||||
|
var criterion = new ReadingQuestionCriterionTrial()
|
||||||
|
{
|
||||||
|
CriterionName = x.CriterionName,
|
||||||
|
IsEnable = false,
|
||||||
|
ReadingQuestionCriterionSystemId = x.Id,
|
||||||
|
TrialId = trialId,
|
||||||
|
Id = NewId.NextGuid(),
|
||||||
|
};
|
||||||
|
|
||||||
|
List<ReadingQuestionSystem> systemQuestionList = x.ReadingQuestionSystemList.Clone();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 递归处理父子问题关系
|
||||||
|
/// </summary>
|
||||||
|
private async Task SetChildParentQuestion(Guid trialId, List<ReadingQuestionSystem> systemQuesitonList,List<ReadingQuestionTrial> needQuestionList)
|
||||||
|
{
|
||||||
|
var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<ReadingQuestionSystem> ReadingQuestionSystemList { get; set; } = new List<ReadingQuestionSystem>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TypeValue { get; set; }
|
public string TypeValue { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -68,6 +69,9 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("ReadingQuestionCriterionSystemId")]
|
||||||
|
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue