修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
9c95928add
commit
1a3ad4f602
|
@ -1107,6 +1107,17 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GetNextCRCChallengeInDto
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// QCChallengeId
|
||||||
|
/// </summary>
|
||||||
|
public Guid QCChallengeId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class ChallengeQuery : PageInput
|
public class ChallengeQuery : PageInput
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,7 @@ using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Image.QA
|
namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
|
@ -87,6 +88,59 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取下一个crc的未关闭的质疑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<QCCRCChallengeViewModel> GetNextCRCChallenge(GetNextCRCChallengeInDto inDto)
|
||||||
|
{
|
||||||
|
var list =await GetCRCChallengeList(new ChallengeQuery()
|
||||||
|
{
|
||||||
|
TrialId = inDto.TrialId,
|
||||||
|
PageIndex = 1,
|
||||||
|
PageSize = 9999
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var data = list.Item1.CurrentPageData.Where(x=>x.Id==inDto.QCChallengeId||x.IsClosed==false).ToList();
|
||||||
|
|
||||||
|
if (data.Count > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId);
|
||||||
|
|
||||||
|
var result = new QCCRCChallengeViewModel() { };
|
||||||
|
|
||||||
|
if (index + 1 == data.Count()) // 最后一个
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
|
||||||
|
}
|
||||||
|
else if (index == -1 || data.Count == 1) // 第一个或者只有一个
|
||||||
|
{
|
||||||
|
if (data[0].Id == inDto.QCChallengeId)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
|
||||||
|
}
|
||||||
|
result = data[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = data.Skip(index + 1).Take(1).First();
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -117,7 +171,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||||
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
|
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" });
|
var pageList = await query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "CreateTime asc" });
|
||||||
|
|
||||||
var config = await _repository.Where<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
var config = await _repository.Where<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||||
return (pageList, config);
|
return (pageList, config);
|
||||||
|
|
Loading…
Reference in New Issue