This commit is contained in:
he
2022-12-01 13:48:09 +08:00
parent 45cf5f1242
commit 264db455ff
3 changed files with 55 additions and 3 deletions
@@ -411,6 +411,37 @@ namespace IRaCIS.Application.Services
return await query.ToListAsync();
}
/// <summary>
/// 获取问题计算关系
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<CalculateRelationDto>> GetQuestionCalculateRelation(GetQuestionCalculateRelationInDto inDto)
{
if (inDto.TrialReadingCriterionId != null)
{
return await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId)
.Select(x => new CalculateRelationDto()
{
QuestionId = x.Id,
CalculateQuestionList = x.CalculateQuestionList
}).ToListAsync();
}
else
{
return await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId)
.Select(x => new CalculateRelationDto()
{
QuestionId = x.Id,
CalculateQuestionList = x.CalculateQuestionList
}).ToListAsync();
}
}
/// <summary>
/// 获取项目标准的其他问题(项目)
/// </summary>
@@ -483,7 +514,7 @@ namespace IRaCIS.Application.Services
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<ReadingTableQuestionTrialView>> GetReadingTableQuestionTrialList(ReadingTableQuestionSystemQuery inDto)
public async Task<(List<ReadingTableQuestionTrialView>,bool)> GetReadingTableQuestionTrialList(ReadingTableQuestionSystemQuery inDto)
{
var readingTableQuestionSystemQueryable = _readingTableQuestionTrialRepository
@@ -491,7 +522,7 @@ namespace IRaCIS.Application.Services
.Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionTrialView>(_mapper.ConfigurationProvider);
var result = await readingTableQuestionSystemQueryable.OrderBy(x => x.ShowOrder).ToListAsync();
return result;
return (result,true);
}
/// <summary>