导出修改

Uat_IRC_Net8
he 2024-12-31 10:09:23 +08:00
parent b0b3744cb1
commit bc079d3586
1 changed files with 23 additions and 5 deletions

View File

@ -56,9 +56,21 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<bool> SetTrialQuestionExportResult(SetTrialQuestionExportResultInDto inDto)
{
foreach (var item in inDto.QuestionList)
List<ExportResult> needAdd = new List<ExportResult>()
{
ExportResult.DetailedTableOfAdjudicationResults,
ExportResult.DetailedTableOfIntraReaderAnalysisResults,
ExportResult.DetailedTableOfInterReaderAnalysisResults
};
foreach (var item in inDto.QuestionList)
{
if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults))
{
item.ExportResult.AddRange(needAdd);
}
var ExportResultStr=JsonConvert.SerializeObject(item.ExportResult);
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.QuestionId, x => new ReadingQuestionTrial()
{
@ -68,6 +80,10 @@ namespace IRaCIS.Core.Application.Service
foreach (var item in inDto.TableQuestionList)
{
if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults))
{
item.ExportResult.AddRange(needAdd);
}
var ExportResultStr = JsonConvert.SerializeObject(item.ExportResult);
await _readingTableQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.TableQuestionId, x => new ReadingTableQuestionTrial()
@ -87,13 +103,13 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<GetTrialQuestionExportResultOutDto> GetTrialQuestionExportResult(GetTrialQuestionExportResultInDto inDto)
{
var questionList = await _readingQuestionTrialRepository.Where(x => x.Type!= ReadingQestionType.Group&& x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId)
var questionList = await _readingQuestionTrialRepository.Where(x => x.Type != ReadingQestionType.Group && x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId)
.OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport()
{
QuestionId = x.Id,
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
ExportResult = x.ExportResult,
ShowOrder=x.ShowOrder,
ShowOrder = x.ShowOrder,
}).ToListAsync();
@ -103,10 +119,10 @@ namespace IRaCIS.Core.Application.Service
.OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport()
{
QuestionId = x.ReadingQuestionId,
TableQuestionId=x.Id,
TableQuestionId = x.Id,
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
ExportResult = x.ExportResult,
ShowOrder=x.ShowOrder,
ShowOrder = x.ShowOrder,
}).ToListAsync();
questionList.ForEach(x =>
@ -114,7 +130,9 @@ namespace IRaCIS.Core.Application.Service
x.Children = tableQuestionList.Where(y => y.QuestionId == x.QuestionId).OrderBy(y => y.ShowOrder).ToList();
});
List<string> dicCode = new List<string>() { "1","2"};
var dicList = await _dictionaryRepository.Where(x => x.Parent.Code == "ExportResult")
.Where(x=> dicCode.Contains(x.Code))
.OrderBy(x => x.ShowOrder)
.Select(x => new TrialQuestionExportDic()
{