修改一版
parent
f0d3d0b190
commit
61ee182bea
|
@ -4148,6 +4148,20 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetTrialCriterionJudgeQuestionList(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListInDto)">
|
||||||
|
<summary>
|
||||||
|
获取项目标准的裁判问题
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SetTrialCriterionJudgeQuestionAnswerGroup(IRaCIS.Core.Application.Service.Reading.Dto.SetTrialCriterionJudgeQuestionAnswerGroupInDto)">
|
||||||
|
<summary>
|
||||||
|
设置裁判问题的答案分组
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetTrialReadingQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetTrialReadingQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取项目的阅片问题
|
获取项目的阅片问题
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
|
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public string AnswerGroup { get; set; }
|
public List<string> AnswerGroup { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrialCriterionJudgeQuestionListOutDto
|
public class GetTrialCriterionJudgeQuestionListOutDto
|
||||||
|
|
|
@ -13,6 +13,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -60,13 +61,17 @@ namespace IRaCIS.Application.Services
|
||||||
GetReadingTaskDto? task = new GetReadingTaskDto();
|
GetReadingTaskDto? task = new GetReadingTaskDto();
|
||||||
if (subjectId != null)
|
if (subjectId != null)
|
||||||
{
|
{
|
||||||
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == subjectId.Value).Select(x => new GetReadingTaskDto()
|
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == subjectId.Value).Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
VisistTaskId=x.Id,
|
VisistTaskId=x.Id,
|
||||||
ReadingCategory = x.ReadingCategory,
|
ReadingCategory = x.ReadingCategory,
|
||||||
VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
|
VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
|
||||||
VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
|
VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
|
||||||
}).OrderBy(x => x.VisitNum).ThenBy(x => x.ReadingCategory).FirstOrDefaultAsync();
|
}).OrderBy(x => x.VisitNum).ThenBy(x => x.ReadingCategory).FirstOrDefaultAsync();
|
||||||
|
if (task == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("任务都已经完成");
|
||||||
|
}
|
||||||
task.SubjectId = subjectId.Value;
|
task.SubjectId = subjectId.Value;
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +85,10 @@ namespace IRaCIS.Application.Services
|
||||||
VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
|
VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
|
||||||
VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
|
VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
if (task == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("任务都已经完成");
|
||||||
|
}
|
||||||
task.SubjectId = await _subjectVisitRepository.Where(x => x.Id == task.VisistId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
task.SubjectId = await _subjectVisitRepository.Where(x => x.Id == task.VisistId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,8 +179,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionTrialId, x => new ReadingQuestionTrial()
|
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionTrialId, x => new ReadingQuestionTrial()
|
||||||
{
|
{
|
||||||
AnswerGroup = inDto.AnswerGroup
|
AnswerGroup = inDto.AnswerGroup.ToString()
|
||||||
});
|
}) ;
|
||||||
|
|
||||||
var result = await _readingQuestionTrialRepository.SaveChangesAsync();
|
var result = await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
@ -185,9 +193,11 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<GetTrialReadingQuestionOutDto>> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
public async Task<(List<GetTrialReadingQuestionOutDto>, TaskState)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
||||||
{
|
{
|
||||||
var query= from data in _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId==inDto.ReadingQuestionCriterionTrialId )
|
|
||||||
|
var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TaskState).FirstOrDefaultAsync();
|
||||||
|
var query= from data in _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId==inDto.ReadingQuestionCriterionTrialId )
|
||||||
join questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId) on data.Id equals questionAnswer.ReadingQuestionTrialId into questionAnswerTemp
|
join questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId) on data.Id equals questionAnswer.ReadingQuestionTrialId into questionAnswerTemp
|
||||||
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
|
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
|
||||||
select new GetTrialReadingQuestionOutDto()
|
select new GetTrialReadingQuestionOutDto()
|
||||||
|
@ -215,7 +225,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
FindChildQuestion(x, qusetionList);
|
FindChildQuestion(x, qusetionList);
|
||||||
});
|
});
|
||||||
return groupList;
|
return (groupList, readingTaskState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,17 +268,12 @@ namespace IRaCIS.Application.Services
|
||||||
TrialId = inDto.TrialId
|
TrialId = inDto.TrialId
|
||||||
}).ToList();
|
}).ToList();
|
||||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
|
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
|
||||||
|
|
||||||
|
|
||||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提交问题
|
/// 提交问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -284,7 +289,6 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue