修改申请重阅 任务处理

This commit is contained in:
2022-08-04 13:26:38 +08:00
parent 79fd496fc3
commit a9b161783b
2 changed files with 5 additions and 5 deletions
@@ -1105,16 +1105,16 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
var visitGroupQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id)
.Where(x => !x.Subject.IsDeleted)
.Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed) && t.TaskState == TaskState.Effect)
.Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed||t.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) && t.TaskState == TaskState.Effect)
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
{
SubjectId = x.Key.SubjectId,
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).Count(),
UnReadTaskCount = x.Where(y => y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
ExistReadingApply = x.Any(y => y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed),
UnReadTaskList = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).OrderBy(x => x.VisitTaskNum)
UnReadTaskList = x.Where(y => y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
.Select(u => new IRUnreadTaskView()
{
Id = u.Id,
@@ -1132,7 +1132,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var count = visitGroupQuery.Select(x => new
{
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).Count(),
UnReadTaskCount = x.Where(y => y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
}).Where(x => x.UnReadTaskCount > 0).Count();
return (count, visitTaskQuery);
}