This commit is contained in:
he
2023-07-05 17:50:31 +08:00
parent 4c6315f2a5
commit 6dbfda36ee
6 changed files with 84 additions and 12 deletions
@@ -105,6 +105,10 @@ namespace IRaCIS.Core.Application.Contracts
public int? ToBeApprovalCount { get; set; }
}
public class GetPMClinicalDataToBeDoneListOutDto: TrialBaseInfoDto
{
public int? ToBeApprovalCount { get; set; }
}
public class ReviewerSelectToBeDoneQuery : PageInput
{
@@ -294,6 +294,33 @@ namespace IRaCIS.Core.Application
}
/// <summary>
/// 获取PM核对临床数据
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<PageOutput<GetPMClinicalDataToBeDoneListOutDto>>> GetPMClinicalDataToBeDoneList(ReviewerSelectToBeDoneQuery inQuery)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm&&!u.IsPMConfirm).Count()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
return ResponseOutput.Ok(result, new { ToBeApprovalCount = query.Sum(x=>x.ToBeApprovalCount) }); ;
}
#endregion