中心调研增加字段返回禁用的中心

Test_IRC_Net10
hang 2026-06-16 17:11:10 +08:00
parent ddd06c8313
commit 7ed0258cfd
1 changed files with 9 additions and 2 deletions

View File

@ -270,11 +270,18 @@ namespace IRaCIS.Core.Application.Services
/// <param name="trialId"></param>
/// <returns></returns>
[HttpGet("{trialId:guid}")]
public async Task<IEnumerable<TrialSiteForSelect>> GetTrialSiteSelect(Guid trialId)
public async Task<IEnumerable<TrialSiteForSelect>> GetTrialSiteSelect(Guid trialId, bool? ignoreDisable)
{
//CRC只看到他负责的
var list = await _trialSiteRepository.Where(t => t.TrialId == trialId)
var query = _trialSiteRepository.Where(t => t.TrialId == trialId);
if (ignoreDisable == true)
{
query = query.IgnoreQueryFilters();
}
var list = await query
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
.ProjectTo<TrialSiteForSelect>(_mapper.ConfigurationProvider).OrderBy(t => t.TrialSiteCode).ToListAsync();