diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index c701f578f..c26c8783e 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -7,6 +7,7 @@ using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using MassTransit.Initializers; using Microsoft.AspNetCore.Mvc; +using NPOI.SS.Formula.Functions; using System.Linq; namespace IRaCIS.Core.Application.Image.QA @@ -25,6 +26,7 @@ namespace IRaCIS.Core.Application.Image.QA IRepository _noneDicomStudyRepository, IRepository _qcChallengeRepository, IRepository _subjectVisitImageBackRecordReposiotry, + IRepository _userRoleReposiotry, IReadingImageTaskService _IReadingImageTaskService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IQCListService { @@ -410,7 +412,7 @@ namespace IRaCIS.Core.Application.Image.QA var temp = await GetVisitQCStudyAndSeriesList(subjectVisitId); - //var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType); + var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType); List secondReviewList = new List(); @@ -419,8 +421,10 @@ namespace IRaCIS.Core.Application.Image.QA { var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault(); - secondReviewList = _trialQCQuestionAnswerRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.SecondReview).Where(t => t.SecondReviewTime != null) - .Select(t => new SecondReviewDto { SecondReviewTime = t.SecondReviewTime, SignTime = t.UpdateTime, FullName = t.UpdateUserRole.FullName, UserName = t.UpdateUserRole.UserName }).Distinct().ToList(); + secondReviewList = (from answer in _trialQCQuestionAnswerRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.SecondReview).Where(t => t.SecondReviewTime != null) + join userRole in _userRoleReposiotry.Where() on answer.UpdateUserId equals userRole.Id + select new SecondReviewDto { SecondReviewTime = answer.SecondReviewTime, SignTime = answer.UpdateTime, FullName = userRole.FullName, UserName = userRole.UserName }) + .Distinct().ToList(); var secondReviewTimeList = secondReviewList.Select(t => t.SecondReviewTime).Distinct().ToList(); @@ -450,7 +454,7 @@ namespace IRaCIS.Core.Application.Image.QA return new TrialVisitQADTO { - //QCQuestionAnswerList = qacheckList, + QCQuestionAnswerList = qacheckList, SecondReviewList = secondReviewList, diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index ecd0b0343..8967eb168 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -788,7 +788,7 @@ namespace IRaCIS.Core.Application.Image.QA await _trialQCQuestionAnswerRepository.AddRangeAsync(addlist); - return ResponseOutput.Result(await _trialQCQuestionAnswerRepository.SaveChangesAsync()); + return ResponseOutput.Ok(await _trialQCQuestionAnswerRepository.SaveChangesAsync()); } diff --git a/IRaCIS.Core.Domain/BaseModel/Entity.cs b/IRaCIS.Core.Domain/BaseModel/Entity.cs index 8fc614e3e..e4ec8e538 100644 --- a/IRaCIS.Core.Domain/BaseModel/Entity.cs +++ b/IRaCIS.Core.Domain/BaseModel/Entity.cs @@ -109,10 +109,6 @@ public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd [JsonIgnore] public UserRole CreateUserRole { get; set; } - - [ForeignKey("CreateUserId")] - [JsonIgnore] - public UserRole UpdateUserRole { get; set; } } public abstract class BaseFullDeleteAuditEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete {