数据库异常处理

This commit is contained in:
2023-06-14 13:35:46 +08:00
parent a20ed9c876
commit 2ea2c037e8
3 changed files with 18 additions and 7 deletions
@@ -192,8 +192,8 @@ namespace IRaCIS.Core.Application
ToBeCheckedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck).Count(),
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck &&
u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).Count(),
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t=>t.CreateTime).First().UserTypeEnum== UserTypeEnum.ClinicalResearchCoordinator).Count(),
});
@@ -204,8 +204,8 @@ namespace IRaCIS.Core.Application
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.ToCheck &&
u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).CountAsync();
.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).CountAsync();
return ResponseOutput.Ok(result, new { TotalToBeCheckedCount = totalToBeCheckedCount, TotalToBeRepliedCount = totalToBeRepliedCount });
@@ -892,7 +892,7 @@ namespace IRaCIS.Core.Application
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
var isPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager;
var isPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM;
var isCRC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator;
var isIQC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC;
var isMIM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM;
@@ -917,9 +917,13 @@ namespace IRaCIS.Core.Application
TrialStatusStr=t.TrialStatusStr,
ExpetiedTaskCount= isPM ? t.VisitTaskList.Where(t=>t.IsUrgent).Count():0,
ReReadingApprovalCount= isPM? t.VisitTaskReReadingList.Where(t=>t.OriginalReReadingTask.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed).Count():0,
PendingReconciliationCount=isPM? t.SubjectVisitList.Where(t=>t.CheckState==CheckStateEnum.ToCheck).Count():0,
PendingResponseCount=isPM? t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0
@@ -934,6 +938,9 @@ namespace IRaCIS.Core.Application
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = 0 });
}
#endregion
}
}