国际化问题名称
This commit is contained in:
+210
-210
@@ -136,7 +136,7 @@ namespace IRaCIS.Application.Services
|
||||
.Select(x => new GetCalculateQuestionsOutDto
|
||||
(){
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
QuestionId= x.Id,
|
||||
x.ReadingQuestionId,
|
||||
x.QuestionName
|
||||
QuestionName=x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace IRaCIS.Application.Services
|
||||
()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
@@ -451,7 +451,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var query = _readingQuestionTrialRepository.AsQueryable()
|
||||
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId)
|
||||
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
|
||||
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)||x.QuestionEnName.Contains(x.QuestionEnName))
|
||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
|
||||
.Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId)
|
||||
.ProjectTo<ReadingQuestionTrialView>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder);
|
||||
@@ -551,7 +551,7 @@ namespace IRaCIS.Application.Services
|
||||
.Select(x => new CriterionOtherQuestionOutDto()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
||||
TypeValue = x.TypeValue,
|
||||
GroupName = x.GroupName,
|
||||
}).ToListAsync();
|
||||
@@ -586,7 +586,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group)
|
||||
.Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId).OrderBy(t => t.ShowOrder)
|
||||
.Select(x => x.GroupName).ToListAsync();
|
||||
.Select(x =>x.GroupName).ToListAsync();
|
||||
|
||||
return result;
|
||||
|
||||
@@ -634,7 +634,7 @@ namespace IRaCIS.Application.Services
|
||||
.Select(x => new CriterionOtherQuestionOutDto()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
||||
TypeValue = x.TypeValue,
|
||||
}).ToListAsync();
|
||||
|
||||
@@ -962,147 +962,147 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更改项目标准(老)
|
||||
/// </summary>
|
||||
/// <param name="systemCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateTrialCriterion(Guid systemCriterionId)
|
||||
{
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||
{
|
||||
IsCompleteConfig = true,
|
||||
});
|
||||
var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
|
||||
var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.TrialId,
|
||||
}).ToListAsync();
|
||||
var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList();
|
||||
List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
|
||||
foreach (var item in trialCriterionList)
|
||||
{
|
||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIdList.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
List<ReadingQuestionTrial> trialQuestionList = new List<ReadingQuestionTrial>();
|
||||
SetChildParentQuestion(item.Id, item.TrialId, systemCriterionQuestionList, trialQuestionList);
|
||||
needAddQuestionList.AddRange(trialQuestionList);
|
||||
}
|
||||
await _readingQuestionTrialRepository.AddRangeAsync(needAddQuestionList);
|
||||
}
|
||||
///// <summary>
|
||||
///// 更改项目标准(老)
|
||||
///// </summary>
|
||||
///// <param name="systemCriterionId"></param>
|
||||
///// <returns></returns>
|
||||
//private async Task UpdateTrialCriterion(Guid systemCriterionId)
|
||||
//{
|
||||
// await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||
// {
|
||||
// IsCompleteConfig = true,
|
||||
// });
|
||||
// var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
|
||||
// var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
|
||||
// {
|
||||
// x.Id,
|
||||
// x.TrialId,
|
||||
// }).ToListAsync();
|
||||
// var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList();
|
||||
// List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
|
||||
// foreach (var item in trialCriterionList)
|
||||
// {
|
||||
// await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIdList.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
// List<ReadingQuestionTrial> trialQuestionList = new List<ReadingQuestionTrial>();
|
||||
// SetChildParentQuestion(item.Id, item.TrialId, systemCriterionQuestionList, trialQuestionList);
|
||||
// needAddQuestionList.AddRange(trialQuestionList);
|
||||
// }
|
||||
// await _readingQuestionTrialRepository.AddRangeAsync(needAddQuestionList);
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更改项目标准(新)
|
||||
/// </summary>
|
||||
/// <param name="systemCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task SynchronizeSystemCriterion(Guid systemCriterionId)
|
||||
{
|
||||
var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.Id == systemCriterionId);
|
||||
///// <summary>
|
||||
///// 更改项目标准(新)
|
||||
///// </summary>
|
||||
///// <param name="systemCriterionId"></param>
|
||||
///// <returns></returns>
|
||||
//private async Task SynchronizeSystemCriterion(Guid systemCriterionId)
|
||||
//{
|
||||
// var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.Id == systemCriterionId);
|
||||
|
||||
var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.TrialId,
|
||||
}).ToListAsync();
|
||||
// var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
|
||||
// {
|
||||
// x.Id,
|
||||
// x.TrialId,
|
||||
// }).ToListAsync();
|
||||
|
||||
var trialCriterionIds = trialCriterionList.Select(x => x.Id).ToList();
|
||||
var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
|
||||
var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion
|
||||
{
|
||||
AnswerCombination = x.AnswerCombination,
|
||||
AnswerGroup = x.AnswerGroup,
|
||||
Id = x.Id,
|
||||
JudgeType = x.JudgeType,
|
||||
ReadingCriterionPageId = x.ReadingCriterionPageId,
|
||||
RelevanceId = x.RelevanceId,
|
||||
RelevanceValue = x.RelevanceValue,
|
||||
ImageCount = x.ImageCount,
|
||||
ParentId = x.ParentId,
|
||||
ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId,
|
||||
ReadingQuestionSystemId = x.ReadingQuestionSystemId,
|
||||
SystemParentId = x.SystemParentId
|
||||
}).ToListAsync();
|
||||
// var trialCriterionIds = trialCriterionList.Select(x => x.Id).ToList();
|
||||
// var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
|
||||
// var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion
|
||||
// {
|
||||
// AnswerCombination = x.AnswerCombination,
|
||||
// AnswerGroup = x.AnswerGroup,
|
||||
// Id = x.Id,
|
||||
// JudgeType = x.JudgeType,
|
||||
// ReadingCriterionPageId = x.ReadingCriterionPageId,
|
||||
// RelevanceId = x.RelevanceId,
|
||||
// RelevanceValue = x.RelevanceValue,
|
||||
// ImageCount = x.ImageCount,
|
||||
// ParentId = x.ParentId,
|
||||
// ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId,
|
||||
// ReadingQuestionSystemId = x.ReadingQuestionSystemId,
|
||||
// SystemParentId = x.SystemParentId
|
||||
// }).ToListAsync();
|
||||
|
||||
List<ReadingQuestionTrial> trialQuestionList = new List<ReadingQuestionTrial>();
|
||||
foreach (var item in trialCriterionList)
|
||||
{
|
||||
// List<ReadingQuestionTrial> trialQuestionList = new List<ReadingQuestionTrial>();
|
||||
// foreach (var item in trialCriterionList)
|
||||
// {
|
||||
|
||||
var thisTrialQuestions = trialQuestions.Where(x => x.ReadingQuestionCriterionTrialId == item.Id).ToList();
|
||||
// var thisTrialQuestions = trialQuestions.Where(x => x.ReadingQuestionCriterionTrialId == item.Id).ToList();
|
||||
|
||||
var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new
|
||||
{
|
||||
a,
|
||||
trialQuestion = b
|
||||
}).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial
|
||||
{
|
||||
Id = n.Id,
|
||||
// var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new
|
||||
// {
|
||||
// a,
|
||||
// trialQuestion = b
|
||||
// }).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial
|
||||
// {
|
||||
// Id = n.Id,
|
||||
|
||||
});
|
||||
var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y })
|
||||
.SelectMany(
|
||||
a => a.trial.DefaultIfEmpty(),
|
||||
(c, d) => new ReadingQuestionTrial
|
||||
{
|
||||
Id = (c.trial.FirstOrDefault()?.Id) ?? NewId.NextGuid(),
|
||||
ShowOrder = c.system.ShowOrder,
|
||||
SystemParentId = c.system.ParentId,
|
||||
ReadingQuestionSystemId = c.system.Id,
|
||||
AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination) ?? string.Empty,
|
||||
AnswerGroup = (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty,
|
||||
GroupName = c.system.GroupName,
|
||||
IsEnable = c.system.IsEnable,
|
||||
// });
|
||||
// var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y })
|
||||
// .SelectMany(
|
||||
// a => a.trial.DefaultIfEmpty(),
|
||||
// (c, d) => new ReadingQuestionTrial
|
||||
// {
|
||||
// Id = (c.trial.FirstOrDefault()?.Id) ?? NewId.NextGuid(),
|
||||
// ShowOrder = c.system.ShowOrder,
|
||||
// SystemParentId = c.system.ParentId,
|
||||
// ReadingQuestionSystemId = c.system.Id,
|
||||
// AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination) ?? string.Empty,
|
||||
// AnswerGroup = (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty,
|
||||
// GroupName = c.system.GroupName,
|
||||
// IsEnable = c.system.IsEnable,
|
||||
|
||||
ShowQuestion = c.system.ShowQuestion,
|
||||
IsJudgeQuestion = c.system.IsJudgeQuestion,
|
||||
IsRequired = c.system.IsRequired,
|
||||
JudgeType = (c.trial.FirstOrDefault()?.JudgeType) ?? JudgeTypeEnum.None,
|
||||
ParentId = c.trial.FirstOrDefault()?.ParentId,
|
||||
ParentTriggerValue = c.system.ParentTriggerValue,
|
||||
QuestionName = c.system.QuestionName,
|
||||
ReadingCriterionPageId = c.trial.FirstOrDefault()?.ReadingCriterionPageId,
|
||||
RelevanceId = c.trial.FirstOrDefault()?.RelevanceId,
|
||||
ImageCount = c.trial.FirstOrDefault()?.ImageCount ?? 0,
|
||||
RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue,
|
||||
ReadingQuestionCriterionTrialId = item.Id,
|
||||
Remark = c.system.Remark,
|
||||
TrialId = item.TrialId,
|
||||
Type = c.system.Type,
|
||||
// ShowQuestion = c.system.ShowQuestion,
|
||||
// IsJudgeQuestion = c.system.IsJudgeQuestion,
|
||||
// IsRequired = c.system.IsRequired,
|
||||
// JudgeType = (c.trial.FirstOrDefault()?.JudgeType) ?? JudgeTypeEnum.None,
|
||||
// ParentId = c.trial.FirstOrDefault()?.ParentId,
|
||||
// ParentTriggerValue = c.system.ParentTriggerValue,
|
||||
// QuestionName = c.system.QuestionName,
|
||||
// ReadingCriterionPageId = c.trial.FirstOrDefault()?.ReadingCriterionPageId,
|
||||
// RelevanceId = c.trial.FirstOrDefault()?.RelevanceId,
|
||||
// ImageCount = c.trial.FirstOrDefault()?.ImageCount ?? 0,
|
||||
// RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue,
|
||||
// ReadingQuestionCriterionTrialId = item.Id,
|
||||
// Remark = c.system.Remark,
|
||||
// TrialId = item.TrialId,
|
||||
// Type = c.system.Type,
|
||||
|
||||
TypeValue = c.system.TypeValue,
|
||||
}).ToList();
|
||||
var copydata = needAddQuestionList.Clone();
|
||||
needAddQuestionList.ForEach(x =>
|
||||
{
|
||||
if (x.SystemParentId == null)
|
||||
{
|
||||
x.ParentId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
x.ParentId = copydata.FirstOrDefault(y => y.ReadingQuestionSystemId == x.SystemParentId).Id;
|
||||
}
|
||||
});
|
||||
// TypeValue = c.system.TypeValue,
|
||||
// }).ToList();
|
||||
// var copydata = needAddQuestionList.Clone();
|
||||
// needAddQuestionList.ForEach(x =>
|
||||
// {
|
||||
// if (x.SystemParentId == null)
|
||||
// {
|
||||
// x.ParentId = null;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// x.ParentId = copydata.FirstOrDefault(y => y.ReadingQuestionSystemId == x.SystemParentId).Id;
|
||||
// }
|
||||
// });
|
||||
|
||||
trialQuestionList.AddRange(needAddQuestionList);
|
||||
}
|
||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => trialCriterionIds.Contains(x.Id), x => new ReadingQuestionCriterionTrial()
|
||||
{
|
||||
IsEnable = systemCriterion.IsEnable,
|
||||
CriterionName = systemCriterion.CriterionName,
|
||||
ShowOrder = systemCriterion.ShowOrder,
|
||||
IsCompleteConfig = systemCriterion.IsCompleteConfig,
|
||||
// trialQuestionList.AddRange(needAddQuestionList);
|
||||
// }
|
||||
// await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
// await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => trialCriterionIds.Contains(x.Id), x => new ReadingQuestionCriterionTrial()
|
||||
// {
|
||||
// IsEnable = systemCriterion.IsEnable,
|
||||
// CriterionName = systemCriterion.CriterionName,
|
||||
// ShowOrder = systemCriterion.ShowOrder,
|
||||
// IsCompleteConfig = systemCriterion.IsCompleteConfig,
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
await _readingQuestionTrialRepository.AddRangeAsync(trialQuestionList);
|
||||
// await _readingQuestionTrialRepository.AddRangeAsync(trialQuestionList);
|
||||
|
||||
|
||||
//
|
||||
await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||
}
|
||||
// //
|
||||
// await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -1194,87 +1194,87 @@ namespace IRaCIS.Application.Services
|
||||
await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置父子关系
|
||||
/// </summary>
|
||||
/// <param name="ReadingQuestionCriterionTrialId">项目标准ID</param>
|
||||
/// <param name="trialId">项目Id</param>
|
||||
/// <param name="systemQuesitonList">系统问题</param>
|
||||
/// <param name="needQuestionList">需要添加list</param>
|
||||
private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
|
||||
{
|
||||
var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList();
|
||||
parentIdIsNullList.ForEach(x =>
|
||||
{
|
||||
var quesiton = x.Clone();
|
||||
var oldId = quesiton.Id;
|
||||
var newId = NewId.NextGuid();
|
||||
needQuestionList.Add(new ReadingQuestionTrial()
|
||||
{
|
||||
Id = newId,
|
||||
ShowOrder = quesiton.ShowOrder,
|
||||
IsEnable = quesiton.IsEnable,
|
||||
IsRequired = quesiton.IsRequired,
|
||||
ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||
QuestionName = quesiton.QuestionName,
|
||||
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
ReadingQuestionSystemId = quesiton.Id,
|
||||
SystemParentId = quesiton.ParentId,
|
||||
TrialId = trialId,
|
||||
AnswerGroup = string.Empty,
|
||||
Type = quesiton.Type,
|
||||
GroupName = quesiton.GroupName,
|
||||
IsJudgeQuestion = quesiton.IsJudgeQuestion,
|
||||
Remark = quesiton.Remark,
|
||||
TypeValue = quesiton.TypeValue,
|
||||
});
|
||||
///// <summary>
|
||||
///// 设置父子关系
|
||||
///// </summary>
|
||||
///// <param name="ReadingQuestionCriterionTrialId">项目标准ID</param>
|
||||
///// <param name="trialId">项目Id</param>
|
||||
///// <param name="systemQuesitonList">系统问题</param>
|
||||
///// <param name="needQuestionList">需要添加list</param>
|
||||
//private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
|
||||
//{
|
||||
// var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList();
|
||||
// parentIdIsNullList.ForEach(x =>
|
||||
// {
|
||||
// var quesiton = x.Clone();
|
||||
// var oldId = quesiton.Id;
|
||||
// var newId = NewId.NextGuid();
|
||||
// needQuestionList.Add(new ReadingQuestionTrial()
|
||||
// {
|
||||
// Id = newId,
|
||||
// ShowOrder = quesiton.ShowOrder,
|
||||
// IsEnable = quesiton.IsEnable,
|
||||
// IsRequired = quesiton.IsRequired,
|
||||
// ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||
// QuestionName = quesiton.QuestionName,
|
||||
// ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
// ReadingQuestionSystemId = quesiton.Id,
|
||||
// SystemParentId = quesiton.ParentId,
|
||||
// TrialId = trialId,
|
||||
// AnswerGroup = string.Empty,
|
||||
// Type = quesiton.Type,
|
||||
// GroupName = quesiton.GroupName,
|
||||
// IsJudgeQuestion = quesiton.IsJudgeQuestion,
|
||||
// Remark = quesiton.Remark,
|
||||
// TypeValue = quesiton.TypeValue,
|
||||
// });
|
||||
|
||||
CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
|
||||
});
|
||||
}
|
||||
// CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
|
||||
// });
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 递归处理父子关系
|
||||
/// </summary>
|
||||
/// <param name="ReadingQuestionCriterionTrialId"></param>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="oldParentId"></param>
|
||||
/// <param name="newParentId"></param>
|
||||
/// <param name="systemQuesitonList"></param>
|
||||
/// <param name="needQuestionList"></param>
|
||||
private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId, Guid oldParentId, Guid newParentId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
|
||||
{
|
||||
var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList();
|
||||
childList.ForEach(x =>
|
||||
{
|
||||
var quesiton = x.Clone();
|
||||
var oldId = quesiton.Id;
|
||||
var newId = NewId.NextGuid();
|
||||
needQuestionList.Add(new ReadingQuestionTrial()
|
||||
{
|
||||
Id = newId,
|
||||
ShowOrder = quesiton.ShowOrder,
|
||||
IsEnable = quesiton.IsEnable,
|
||||
IsRequired = quesiton.IsRequired,
|
||||
ParentId = newParentId,
|
||||
SystemParentId = quesiton.ParentId,
|
||||
ReadingQuestionSystemId = x.Id,
|
||||
AnswerGroup = string.Empty,
|
||||
ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||
QuestionName = quesiton.QuestionName,
|
||||
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
TrialId = trialId,
|
||||
GroupName = quesiton.GroupName,
|
||||
Type = quesiton.Type,
|
||||
IsJudgeQuestion = quesiton.IsJudgeQuestion,
|
||||
Remark = quesiton.Remark,
|
||||
TypeValue = quesiton.TypeValue,
|
||||
});
|
||||
///// <summary>
|
||||
///// 递归处理父子关系
|
||||
///// </summary>
|
||||
///// <param name="ReadingQuestionCriterionTrialId"></param>
|
||||
///// <param name="trialId"></param>
|
||||
///// <param name="oldParentId"></param>
|
||||
///// <param name="newParentId"></param>
|
||||
///// <param name="systemQuesitonList"></param>
|
||||
///// <param name="needQuestionList"></param>
|
||||
//private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId, Guid oldParentId, Guid newParentId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
|
||||
//{
|
||||
// var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList();
|
||||
// childList.ForEach(x =>
|
||||
// {
|
||||
// var quesiton = x.Clone();
|
||||
// var oldId = quesiton.Id;
|
||||
// var newId = NewId.NextGuid();
|
||||
// needQuestionList.Add(new ReadingQuestionTrial()
|
||||
// {
|
||||
// Id = newId,
|
||||
// ShowOrder = quesiton.ShowOrder,
|
||||
// IsEnable = quesiton.IsEnable,
|
||||
// IsRequired = quesiton.IsRequired,
|
||||
// ParentId = newParentId,
|
||||
// SystemParentId = quesiton.ParentId,
|
||||
// ReadingQuestionSystemId = x.Id,
|
||||
// AnswerGroup = string.Empty,
|
||||
// ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||
// QuestionName = quesiton.QuestionName,
|
||||
// ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
// TrialId = trialId,
|
||||
// GroupName = quesiton.GroupName,
|
||||
// Type = quesiton.Type,
|
||||
// IsJudgeQuestion = quesiton.IsJudgeQuestion,
|
||||
// Remark = quesiton.Remark,
|
||||
// TypeValue = quesiton.TypeValue,
|
||||
// });
|
||||
|
||||
CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
|
||||
});
|
||||
// CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
|
||||
// });
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
#region 废弃
|
||||
|
||||
Reference in New Issue
Block a user