Uat_Study
parent
682a3fd5db
commit
ba72ce62ed
|
@ -6305,6 +6305,13 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.SynchronizeCriterion(System.Guid)">
|
||||
<summary>
|
||||
同步标准到项目新(2022-08-10)
|
||||
</summary>
|
||||
<param name="trialCriterionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.GetTrialJudgyInfo(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialJudgyInfoInDto)">
|
||||
<summary>
|
||||
获取项目裁判信息
|
||||
|
|
|
@ -97,6 +97,65 @@ namespace IRaCIS.Application.Services
|
|||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同步标准到项目新(2022-08-10)
|
||||
/// </summary>
|
||||
/// <param name="trialCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SynchronizeCriterion(Guid trialCriterionId)
|
||||
{
|
||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == trialCriterionId).FirstNotNullAsync();
|
||||
if(trialCriterion.ReadingQuestionCriterionSystemId!=null)
|
||||
{
|
||||
|
||||
// 将系统里面的问题转为项目问题
|
||||
var newTrialQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == trialCriterion.ReadingQuestionCriterionSystemId)
|
||||
.ProjectTo<ReadingQuestionTrial>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
newTrialQuestionList.ForEach(x => {
|
||||
x.Id = NewId.NextGuid();
|
||||
x.ReadingQuestionCriterionTrialId = trialCriterionId;
|
||||
x.TrialId = trialCriterion.TrialId;
|
||||
});
|
||||
var copeNewQuestionList = newTrialQuestionList.Clone();
|
||||
var trialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterionId).ToListAsync();
|
||||
|
||||
var needAddDatas = new List<ReadingQuestionTrial>();
|
||||
|
||||
foreach (var x in newTrialQuestionList)
|
||||
{
|
||||
var question = x.Clone();
|
||||
|
||||
var firstQuestion = trialQuestionList.Where(y => y.ReadingQuestionSystemId == x.ReadingQuestionSystemId).FirstOrDefault();
|
||||
if (firstQuestion != null)
|
||||
{
|
||||
var systemData = _mapper.Map<ReadingQuestionSystem>(x);
|
||||
var newData = _mapper.Map(systemData, firstQuestion);
|
||||
newData.Id = x.Id;
|
||||
newData.ReadingQuestionSystemId= x.ReadingQuestionSystemId;
|
||||
question = newData.Clone();
|
||||
}
|
||||
|
||||
if (question.ParentId != null)
|
||||
{
|
||||
question.ParentId = copeNewQuestionList.Where(y =>x.ParentId==y.ReadingQuestionSystemId ).Select(y => y.Id).FirstOrDefault();
|
||||
}
|
||||
if (question.RelevanceId != null)
|
||||
{
|
||||
question.RelevanceId = copeNewQuestionList.Where(y => x.RelevanceId == y.ReadingQuestionSystemId).Select(y => y.Id).FirstOrDefault();
|
||||
}
|
||||
|
||||
needAddDatas.Add(question);
|
||||
};
|
||||
|
||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionTrialId == trialCriterionId);
|
||||
await _readingQuestionTrialRepository.AddRangeAsync(needAddDatas);
|
||||
await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目裁判信息
|
||||
/// </summary>
|
||||
|
|
|
@ -54,6 +54,15 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
CreateMap<ReadingCriterionPageAddOrEdit, ReadingCriterionPage>();
|
||||
|
||||
CreateMap<ReadingQuestionTrial, ReadingQuestionSystem>();
|
||||
|
||||
CreateMap<ReadingQuestionSystem, ReadingQuestionTrial>()
|
||||
.ForMember(d => d.ReadingQuestionSystemId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionSystemInDto, ReadingQuestionCriterionSystem>();
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionSystemView>()
|
||||
.ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionSystemList.Count()))
|
||||
|
|
|
@ -544,6 +544,17 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
/// </summary>
|
||||
public JudgeTypeEnum JudgeType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 关联Value
|
||||
/// </summary>
|
||||
public string RelevanceValue { get; set; } = string.Empty;
|
||||
|
||||
public int? RelevanceShowOrder { get; set; }
|
||||
|
||||
|
||||
public int? ParentQuestionShowOrder { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class TrialJudgeQuestion
|
||||
|
|
|
@ -234,7 +234,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<ReadingQuestionTrial, TrialReadQuestion>()
|
||||
.ForMember(t => t.PageName, u => u.MapFrom(c => c.ReadingCriterionPage.PageName))
|
||||
.ForMember(t => t.ParentQuestionName, u => u.MapFrom(c => c.ParentReadingQuestionTrial.QuestionName));
|
||||
.ForMember(t => t.ParentQuestionName, u => u.MapFrom(c => c.ParentReadingQuestionTrial.QuestionName))
|
||||
.ForMember(t => t.RelevanceShowOrder, u => u.MapFrom(c => c.RelevanceReadingQuestionTrial.ShowOrder))
|
||||
.ForMember(t => t.ParentQuestionShowOrder, u => u.MapFrom(c => c.ParentReadingQuestionTrial.ShowOrder));
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue