Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1571,13 +1571,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public bool IsJudgeQuestion { get; set; }
|
||||
}
|
||||
|
||||
public class GetCalculateQuestionsOutDto
|
||||
public class GetCalculateQuestionsOutDto: ReadingQuestionSystemView
|
||||
{
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
public List<ReadingTableQuestionTrial> TableQuestions { get; set; }
|
||||
}
|
||||
|
||||
public List<CalculateQuestion> TableQuestions { get; set; }
|
||||
|
||||
public class GetSystemCalculateQuestionsOutDto : ReadingQuestionSystemView
|
||||
{
|
||||
|
||||
public List<ReadingTableQuestionSystem> TableQuestions { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1620,7 +1624,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public Guid SystemCriterionId { get; set; }
|
||||
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
public List<string> TypeList { get; set; } = new List<string>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1630,7 +1638,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public Guid TrialCriterionId { get; set; }
|
||||
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
public List<string> TypeList { get; set; } = new List<string>();
|
||||
|
||||
|
||||
+11
-45
@@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetCalculateQuestionsOutDto>> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
|
||||
public async Task<(List<GetCalculateQuestionsOutDto>,bool)> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionTrialRepository
|
||||
|
||||
@@ -96,35 +96,17 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
||||
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
|
||||
.OrderBy(x => x.ShowOrder)
|
||||
.Select(x => new GetCalculateQuestionsOutDto
|
||||
()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
}).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();
|
||||
|
||||
var tablequestion=await _readingTableQuestionTrialRepository.Where(x=>x.TrialCriterionId==inDto.TrialCriterionId).ToListAsync();
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
||||
{
|
||||
|
||||
QuestionId = y.QuestionId,
|
||||
QuestionName = y.QuestionName
|
||||
|
||||
}).ToList();
|
||||
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
|
||||
});
|
||||
|
||||
return result;
|
||||
return (result,true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -133,39 +115,23 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
|
||||
public async Task<List<GetSystemCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionSystemRepository
|
||||
|
||||
.Where(x => x.ReadingQuestionCriterionSystemId == inDto.SystemCriterionId)
|
||||
.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))
|
||||
.OrderBy(x => x.ShowOrder)
|
||||
.Select(x => new GetCalculateQuestionsOutDto
|
||||
()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
.ProjectTo<GetSystemCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ;
|
||||
|
||||
}).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();
|
||||
|
||||
var tablequestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
||||
{
|
||||
|
||||
QuestionId = y.QuestionId,
|
||||
QuestionName = y.QuestionName
|
||||
|
||||
}).ToList();
|
||||
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
|
||||
});
|
||||
|
||||
return result;
|
||||
|
||||
@@ -220,6 +220,16 @@ namespace IRaCIS.Core.Application.Service
|
||||
.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>();
|
||||
|
||||
|
||||
CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>();
|
||||
|
||||
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
|
||||
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))
|
||||
|
||||
Reference in New Issue
Block a user