代码修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
558258fd89
commit
ad01628e48
|
@ -1571,13 +1571,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public bool IsJudgeQuestion { get; set; }
|
public bool IsJudgeQuestion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetCalculateQuestionsOutDto
|
public class GetCalculateQuestionsOutDto: ReadingQuestionSystemView
|
||||||
{
|
{
|
||||||
public Guid QuestionId { get; set; }
|
|
||||||
|
|
||||||
public string QuestionName { get; set; }
|
public List<ReadingTableQuestionSystemView> TableQuestions { get; set; }
|
||||||
|
|
||||||
public List<CalculateQuestion> TableQuestions { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,33 +96,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
|
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new GetCalculateQuestionsOutDto
|
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
()
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
var tablequestion = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == inDto.TrialCriterionId && x.Type == "number").Select(x =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
x.ReadingQuestionId,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
result.ForEach(x =>
|
|
||||||
{
|
|
||||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
|
||||||
{
|
|
||||||
|
|
||||||
QuestionId = y.QuestionId,
|
|
||||||
QuestionName = y.QuestionName
|
|
||||||
|
|
||||||
}).ToList();
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -141,33 +115,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
.WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type))
|
.WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type))
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new GetCalculateQuestionsOutDto
|
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ;
|
||||||
()
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
var tablequestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId && x.Type == "number").Select(x =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
x.ReadingQuestionId,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
result.ForEach(x =>
|
|
||||||
{
|
|
||||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
|
||||||
{
|
|
||||||
|
|
||||||
QuestionId = y.QuestionId,
|
|
||||||
QuestionName = y.QuestionName
|
|
||||||
|
|
||||||
}).ToList();
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,18 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionSystemView>()
|
||||||
|
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||||
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
||||||
|
|
||||||
|
CreateMap<ReadingQuestionTrial, GetCalculateQuestionsOutDto>()
|
||||||
|
.ForMember(d => d.TableQuestions, u => u.MapFrom(s => s.ReadingTableQuestionTrialList));
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>()
|
||||||
|
.ForMember(d => d.TableQuestions, u => u.MapFrom(s => s.ReadingTableQuestionTrialList));
|
||||||
|
|
||||||
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
|
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
|
||||||
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||||
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))
|
||||||
|
|
|
@ -15,6 +15,9 @@ public class ReadingQuestionSystem : BaseAddAuditEntity
|
||||||
[ForeignKey("ReadingQuestionCriterionSystemId")]
|
[ForeignKey("ReadingQuestionCriterionSystemId")]
|
||||||
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
|
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<ReadingTableQuestionSystem> ReadingTableQuestionTrialList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("ParentId")]
|
[ForeignKey("ParentId")]
|
||||||
public ReadingQuestionSystem ParentReadingQuestionSystem { get; set; }
|
public ReadingQuestionSystem ParentReadingQuestionSystem { get; set; }
|
||||||
|
|
|
@ -12,6 +12,11 @@ public class ReadingTableQuestionSystem : BaseAddAuditEntity
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public ReadingTableQuestionSystem DependParentQuestion { get; set; }
|
public ReadingTableQuestionSystem DependParentQuestion { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("ReadingQuestionId")]
|
||||||
|
public ReadingQuestionSystem ReadingQuestionSystem { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public List<string> ParentTriggerValueList
|
public List<string> ParentTriggerValueList
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue