修改一版
parent
0bc4b1994c
commit
284cf6e6a4
|
@ -116,6 +116,22 @@ namespace IRaCIS.Core.API.Controllers
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 提交阅片裁判问题
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(DataInspectionDto<SaveJudgeVisitTaskResult> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _iReadingImageTaskService.SubmitJudgeVisitTaskResult(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 配置 基础逻辑信息并确认
|
||||
/// </summary>
|
||||
|
|
|
@ -128,9 +128,31 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public Guid? JudgeResultTaskId { get; set; }
|
||||
|
||||
//public List
|
||||
public List<JudgeReadingInfoDto> VisitTaskInfoList { get; set; }
|
||||
|
||||
public ReadingTaskState ReadingTaskState { get; set; }
|
||||
}
|
||||
|
||||
public class SaveJudgeVisitTaskResult
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid JudgeResultTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class GetJudgeReadingInfo
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class JudgeReadingInfoDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
|
||||
public List<GetTrialReadingQuestionOutDto> TaskReadingQuestionList { get; set; }
|
||||
}
|
||||
|
||||
public class GetTrialReadingQuestionInDto
|
||||
{
|
||||
[NotDefault]
|
||||
|
|
|
@ -12,5 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public interface IReadingImageTaskService
|
||||
{
|
||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||
|
||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
|
||||
}
|
||||
}
|
|
@ -275,13 +275,103 @@ namespace IRaCIS.Application.Services
|
|||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取阅片任务和答案
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<List<GetTrialReadingQuestionOutDto>> GetTaskAndAnswer(Guid visitTaskId)
|
||||
{
|
||||
var taskQuery=from questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId== visitTaskId)
|
||||
join trialQuestion in _readingQuestionTrialRepository.AsQueryable() on questionAnswer.ReadingQuestionTrialId equals trialQuestion.Id
|
||||
select new GetTrialReadingQuestionOutDto()
|
||||
{
|
||||
ReadingQuestionTrialId = trialQuestion.Id,
|
||||
ReadingQuestionCriterionTrialId = trialQuestion.ReadingQuestionCriterionTrialId,
|
||||
TrialId = trialQuestion.TrialId,
|
||||
Type = trialQuestion.Type,
|
||||
ParentTriggerValue = trialQuestion.ParentTriggerValue,
|
||||
GroupName = trialQuestion.GroupName,
|
||||
QuestionName = trialQuestion.QuestionName,
|
||||
IsRequired = trialQuestion.IsRequired,
|
||||
ShowOrder = trialQuestion.ShowOrder,
|
||||
ParentId = trialQuestion.ParentId,
|
||||
TypeValue = trialQuestion.TypeValue,
|
||||
Answer = questionAnswer.Answer
|
||||
};
|
||||
var qusetionList = await taskQuery.OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
FindChildQuestion(x, qusetionList);
|
||||
});
|
||||
|
||||
return groupList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取裁判阅片任务信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task GetJudgeReadingInfo()
|
||||
[HttpPost]
|
||||
public async Task<GetJudgeReadingInfoOutDto> GetJudgeReadingInfo(GetJudgeReadingInfo inDto)
|
||||
{
|
||||
|
||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => new
|
||||
{
|
||||
x.ReadingTaskState,
|
||||
x.JudgeResultTaskId,
|
||||
}).FirstOrDefaultAsync();
|
||||
GetJudgeReadingInfoOutDto judgeInfo = new GetJudgeReadingInfoOutDto()
|
||||
{
|
||||
ReadingTaskState = visitTask.ReadingTaskState,
|
||||
JudgeResultTaskId = visitTask.JudgeResultTaskId,
|
||||
VisitTaskInfoList = new List<JudgeReadingInfoDto>()
|
||||
};
|
||||
var visitIds = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Select(x => x.Id).ToListAsync();
|
||||
foreach (var item in visitIds)
|
||||
{
|
||||
var taskReadingQuestionList = await this.GetTaskAndAnswer(item);
|
||||
judgeInfo.VisitTaskInfoList.Add(
|
||||
new JudgeReadingInfoDto()
|
||||
{
|
||||
VisitTaskId = item,
|
||||
TaskReadingQuestionList = taskReadingQuestionList,
|
||||
});
|
||||
}
|
||||
return judgeInfo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存裁判问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SaveJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
|
||||
{
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||
{
|
||||
JudgeResultTaskId = inDto.JudgeResultTaskId
|
||||
});
|
||||
var result=await _visitTaskRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交裁判问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
|
||||
{
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||
{
|
||||
JudgeResultTaskId = inDto.JudgeResultTaskId,
|
||||
ReadingTaskState = ReadingTaskState.HaveSigned,
|
||||
SignTime = DateTime.Now,
|
||||
});
|
||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -188,10 +188,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public SubjectUser SujectArm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判结果的任务ID
|
||||
/// </summary>
|
||||
public Guid? JudgeResultTaskId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
//建议完成时间
|
||||
//public int SuggesteDays { get; set; }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue