Merge branch 'Test_IRC_Net10' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net10

Test_IRC_Net10
he 2026-06-09 16:33:19 +08:00
commit f69c7af9d6
1 changed files with 27 additions and 0 deletions

View File

@ -215,6 +215,33 @@ namespace IRaCIS.Core.Application.Service
CriterionType = g.Key.CriterionType,
}).ToList();
// 获取所有符合条件的医生ID
var allDoctorIds = _enrollRepository
.Where(x => x.TrialId == inQuery.TrialId
&& x.EnrollStatus >= EnrollStatus.ConfirmIntoGroup)
.WhereIf(inQuery.DoctorUserIdList.Count > 0,
t => inQuery.DoctorUserIdList.Contains(t.DoctorUserId))
.Select(x => x.DoctorUserId)
.Distinct()
.ToList();
// 补全缺失的医生记录
var missingDoctors = allDoctorIds
.Except(list.Select(r => r.DoctorUserId))
.Select(doctorId => new DoctorTaskStat()
{
DoctorUserId = doctorId,
PendingCount = 0,
TotalCount = 0,
ComplectedCount = 0,
TrialReadingCriterionId = inQuery.TrialReadingCriterionId,
})
.ToList();
list.AddRange(missingDoctors);
return list;
}