导出修改
parent
b0b3744cb1
commit
bc079d3586
|
@ -56,9 +56,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> SetTrialQuestionExportResult(SetTrialQuestionExportResultInDto inDto)
|
public async Task<bool> SetTrialQuestionExportResult(SetTrialQuestionExportResultInDto inDto)
|
||||||
{
|
{
|
||||||
|
List<ExportResult> needAdd = new List<ExportResult>()
|
||||||
|
{
|
||||||
|
ExportResult.DetailedTableOfAdjudicationResults,
|
||||||
|
ExportResult.DetailedTableOfIntraReaderAnalysisResults,
|
||||||
|
ExportResult.DetailedTableOfInterReaderAnalysisResults
|
||||||
|
};
|
||||||
foreach (var item in inDto.QuestionList)
|
foreach (var item in inDto.QuestionList)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults))
|
||||||
|
{
|
||||||
|
item.ExportResult.AddRange(needAdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var ExportResultStr=JsonConvert.SerializeObject(item.ExportResult);
|
var ExportResultStr=JsonConvert.SerializeObject(item.ExportResult);
|
||||||
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.QuestionId, x => new ReadingQuestionTrial()
|
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)
|
foreach (var item in inDto.TableQuestionList)
|
||||||
{
|
{
|
||||||
|
if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults))
|
||||||
|
{
|
||||||
|
item.ExportResult.AddRange(needAdd);
|
||||||
|
}
|
||||||
|
|
||||||
var ExportResultStr = JsonConvert.SerializeObject(item.ExportResult);
|
var ExportResultStr = JsonConvert.SerializeObject(item.ExportResult);
|
||||||
await _readingTableQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.TableQuestionId, x => new ReadingTableQuestionTrial()
|
await _readingTableQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.TableQuestionId, x => new ReadingTableQuestionTrial()
|
||||||
|
@ -87,13 +103,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<GetTrialQuestionExportResultOutDto> GetTrialQuestionExportResult(GetTrialQuestionExportResultInDto inDto)
|
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()
|
.OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport()
|
||||||
{
|
{
|
||||||
QuestionId = x.Id,
|
QuestionId = x.Id,
|
||||||
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
|
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
|
||||||
ExportResult = x.ExportResult,
|
ExportResult = x.ExportResult,
|
||||||
ShowOrder=x.ShowOrder,
|
ShowOrder = x.ShowOrder,
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
@ -103,10 +119,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport()
|
.OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport()
|
||||||
{
|
{
|
||||||
QuestionId = x.ReadingQuestionId,
|
QuestionId = x.ReadingQuestionId,
|
||||||
TableQuestionId=x.Id,
|
TableQuestionId = x.Id,
|
||||||
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
|
QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName,
|
||||||
ExportResult = x.ExportResult,
|
ExportResult = x.ExportResult,
|
||||||
ShowOrder=x.ShowOrder,
|
ShowOrder = x.ShowOrder,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
questionList.ForEach(x =>
|
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();
|
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")
|
var dicList = await _dictionaryRepository.Where(x => x.Parent.Code == "ExportResult")
|
||||||
|
.Where(x=> dicCode.Contains(x.Code))
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new TrialQuestionExportDic()
|
.Select(x => new TrialQuestionExportDic()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue