QC复核 -二次提交-uat-2
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5e31d0d853
commit
9a5258bf83
|
@ -429,11 +429,21 @@ namespace IRaCIS.Core.API.Controllers
|
|||
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
if (opt.Data.IsSecondPass != null)
|
||||
{
|
||||
var result = await _qCOperationService.QCSecondReviewPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, (bool)opt.Data.IsSecondPass);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一致性核查 回退 对话记录不清除 只允许PM回退
|
||||
/// </summary>
|
||||
|
|
|
@ -199,6 +199,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
public Guid subjectVisitId { get; set; }
|
||||
|
||||
public AuditStateEnum auditState { get; set; }
|
||||
|
||||
public bool? IsSecondPass { get; set; }
|
||||
}
|
||||
|
||||
public class SetSeriesStateDto
|
||||
|
|
|
@ -251,7 +251,13 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
}
|
||||
|
||||
|
||||
|
||||
public class SecondReviewDto
|
||||
{
|
||||
public DateTime? SecondReviewTime { get; set; }
|
||||
public string FullName { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public DateTime? SignTime { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class TrialVisitQADTO
|
||||
|
@ -270,7 +276,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
|
||||
public QARelationInfo RelationInfo { get; set; } = new QARelationInfo();
|
||||
|
||||
public List<DateTime?> SecondReviewTimeList { get; set; }
|
||||
public List<SecondReviewDto> SecondReviewList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
|
||||
Task<IResponseOutput> SetCheckPass(SetCheckPassDt data);
|
||||
|
||||
|
||||
Task<IResponseOutput> QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass);
|
||||
|
||||
|
||||
Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand);
|
||||
|
|
|
@ -410,29 +410,49 @@ 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<SecondReviewDto> secondReviewList = new List<SecondReviewDto>();
|
||||
|
||||
List<DateTime?> secondReviewTimeList = new List<DateTime?>();
|
||||
|
||||
if (sv.SecondReviewState != SecondReviewState.None)
|
||||
{
|
||||
secondReviewTimeList = _trialQCQuestionAnswerRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.SecondReview).Where(t => t.SecondReviewTime != null)
|
||||
.Select(t => t.SecondReviewTime).Distinct().ToList();
|
||||
|
||||
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();
|
||||
|
||||
var secondReviewTimeList = secondReviewList.Select(t => t.SecondReviewTime).Distinct().ToList();
|
||||
|
||||
//首次加入
|
||||
if (!secondReviewTimeList.Contains(trialConfirmTime))
|
||||
{
|
||||
secondReviewTimeList.Add(trialConfirmTime);
|
||||
secondReviewList.Add(new SecondReviewDto() { SecondReviewTime = trialConfirmTime });
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sv.SecondReviewState == SecondReviewState.WaitAudit)
|
||||
{
|
||||
foreach (var item in secondReviewList)
|
||||
{
|
||||
if (item.SecondReviewTime == trialConfirmTime)
|
||||
{
|
||||
item.SignTime = null;
|
||||
item.FullName = "";
|
||||
item.UserName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
secondReviewList = secondReviewList.OrderByDescending(t => t.SecondReviewTime).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new TrialVisitQADTO
|
||||
{
|
||||
QCQuestionAnswerList = qacheckList,
|
||||
//QCQuestionAnswerList = qacheckList,
|
||||
|
||||
SecondReviewTimeList = secondReviewTimeList,
|
||||
SecondReviewList = secondReviewList,
|
||||
|
||||
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
|
||||
StudyList = temp.StudyList,
|
||||
|
|
|
@ -727,9 +727,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
||||
{
|
||||
if (currentQCType == CurrentQC.SecondReview)
|
||||
{
|
||||
//二次复核自动领取,如果有人先领取了,那么后续不能操作
|
||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.CurrentActionUserId == null, u => new SubjectVisit() { CurrentActionUserId = _userInfo.UserRoleId });
|
||||
}
|
||||
//验证是否能操作
|
||||
await VerifyIsCanQCAsync(null, subjectVisitId);
|
||||
|
||||
|
||||
var trialConfirmTime = _trialRepository.Where(t => t.Id == trialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||
|
||||
//更新
|
||||
|
@ -2081,8 +2087,43 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass)
|
||||
{
|
||||
if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
|
||||
{
|
||||
//---您已经被移出项目,没有操作权限。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]);
|
||||
}
|
||||
|
||||
|
||||
var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||
|
||||
await VerifyIsCanQCAsync(sv);
|
||||
|
||||
var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||
|
||||
if (sv.SecondReviewState == SecondReviewState.WaitAudit)
|
||||
{
|
||||
if (isSecondPass)
|
||||
{
|
||||
sv.SecondReviewState = SecondReviewState.AuditPassed;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
sv.SecondReviewState = SecondReviewState.AuditFailed;
|
||||
}
|
||||
|
||||
await _trialQCQuestionAnswerRepository.BatchUpdateNoTrackingAsync(t => t.SubjectVisitId == sv.Id && t.CurrentQCEnum == CurrentQC.SecondReview && t.SecondReviewTime == trialConfirmTime, u => new TrialQCQuestionAnswer()
|
||||
{
|
||||
UpdateUserId = _userInfo.UserRoleId,
|
||||
UpdateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置、取消 访视紧急
|
||||
|
|
|
@ -108,6 +108,11 @@ public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
|
|||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public UserRole CreateUserRole { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public UserRole UpdateUserRole { get; set; }
|
||||
}
|
||||
public abstract class BaseFullDeleteAuditEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue