修改一版
parent
e5a4eaa7b8
commit
bf7c510e2f
|
@ -1220,6 +1220,11 @@
|
||||||
类型值
|
类型值
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionOutDto.Answer">
|
||||||
|
<summary>
|
||||||
|
答案
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingPeriodSetAddOrEdit.TrialId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingPeriodSetAddOrEdit.TrialId">
|
||||||
<summary>
|
<summary>
|
||||||
项目ID
|
项目ID
|
||||||
|
@ -4150,13 +4155,20 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FindChildQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionOutDto,System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingQuestionTrial})">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FindChildQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionOutDto,System.Collections.Generic.List{IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionOutDto})">
|
||||||
<summary>
|
<summary>
|
||||||
找子问题
|
找子问题
|
||||||
</summary>
|
</summary>
|
||||||
<param name="trialReadingQuestion"></param>
|
<param name="trialReadingQuestion"></param>
|
||||||
<param name="questionlists"></param>
|
<param name="questionlists"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SaveVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.SubmitVisitTaskQuestionsInDto)">
|
||||||
|
<summary>
|
||||||
|
保存任务问题
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SubmitVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.SubmitVisitTaskQuestionsInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SubmitVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.SubmitVisitTaskQuestionsInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
提交问题
|
提交问题
|
||||||
|
|
|
@ -64,6 +64,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||||
|
|
||||||
|
public Guid? VisitTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -151,6 +153,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TypeValue { get; set; }
|
public string TypeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案
|
||||||
|
/// </summary>
|
||||||
|
public string Answer { get; set; }
|
||||||
|
|
||||||
public List<GetTrialReadingQuestionOutDto> Childrens { get; set; }
|
public List<GetTrialReadingQuestionOutDto> Childrens { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,9 +150,30 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<GetTrialReadingQuestionOutDto>> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
public async Task<List<GetTrialReadingQuestionOutDto>> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
||||||
{
|
{
|
||||||
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId).OrderBy(x=>x.ShowOrder).ToListAsync();
|
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
|
||||||
|
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
|
||||||
|
select new GetTrialReadingQuestionOutDto()
|
||||||
|
{
|
||||||
|
ReadingQuestionTrialId=data.Id,
|
||||||
|
ReadingQuestionCriterionTrialId=data.ReadingQuestionCriterionTrialId,
|
||||||
|
TrialId=data.TrialId,
|
||||||
|
Type=data.Type,
|
||||||
|
ParentTriggerValue=data.ParentTriggerValue,
|
||||||
|
GroupName=data.GroupName,
|
||||||
|
QuestionName=data.QuestionName,
|
||||||
|
IsRequired=data.IsRequired,
|
||||||
|
ShowOrder=data.ShowOrder,
|
||||||
|
ParentId=data.ParentId,
|
||||||
|
TypeValue=data.TypeValue,
|
||||||
|
Answer= leftquestionAnswer.Answer
|
||||||
|
};
|
||||||
|
|
||||||
List<GetTrialReadingQuestionOutDto> groupList = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(qusetionList.Where(x => x.ParentId == null));
|
var qusetionList =await query.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||||
groupList.ForEach(x =>
|
groupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
FindChildQuestion(x, qusetionList);
|
FindChildQuestion(x, qusetionList);
|
||||||
|
@ -167,9 +188,9 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="trialReadingQuestion"></param>
|
/// <param name="trialReadingQuestion"></param>
|
||||||
/// <param name="questionlists"></param>
|
/// <param name="questionlists"></param>
|
||||||
|
|
||||||
private void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<ReadingQuestionTrial> questionlists)
|
private void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists)
|
||||||
{
|
{
|
||||||
trialReadingQuestion.Childrens = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId));
|
trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId).ToList();
|
||||||
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
|
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
|
||||||
{
|
{
|
||||||
trialReadingQuestion.Childrens.ForEach(x =>
|
trialReadingQuestion.Childrens.ForEach(x =>
|
||||||
|
@ -179,18 +200,16 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提交问题
|
/// 保存任务问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[NonDynamicMethod]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
public async Task<IResponseOutput> SaveVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
||||||
{
|
{
|
||||||
var subjectId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
var subjectId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
||||||
|
await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId);
|
||||||
List<ReadingTaskQuestionAnswer> readingTaskAnswerList = inDto.AnswerList.Select(x => new ReadingTaskQuestionAnswer()
|
List<ReadingTaskQuestionAnswer> readingTaskAnswerList = inDto.AnswerList.Select(x => new ReadingTaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
Id = NewId.NextGuid(),
|
||||||
|
@ -202,6 +221,26 @@ 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();
|
||||||
|
return ResponseOutput.Ok(result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提交问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
||||||
|
{
|
||||||
|
await this.SaveVisitTaskQuestions(inDto);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
ReadingTaskState = ReadingTaskState.HaveSigned
|
ReadingTaskState = ReadingTaskState.HaveSigned
|
||||||
|
|
|
@ -66,7 +66,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 特殊删除
|
/// 特殊删除
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -85,8 +84,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 插入Add的实体
|
/// 插入Add的实体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue