Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
This commit is contained in:
@@ -291,7 +291,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (filterObj == null)
|
||||
{
|
||||
return ResponseOutput.Ok(new PageOutput<DoctorGroupConsistentSubjectView>()) ;
|
||||
object tt = null;
|
||||
return ResponseOutput.Ok(new PageOutput<DoctorGroupConsistentSubjectView>(), new { Rule = tt, IsAllowAutoAllocate = false }) ;
|
||||
}
|
||||
|
||||
var query = await GetGroupConsistentQueryAsync(filterObj);
|
||||
@@ -300,7 +301,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
var pagedList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
|
||||
|
||||
var rule = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == false && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo<TaskConsistentRuleBasic>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
return ResponseOutput.Ok(pagedList, rule);
|
||||
|
||||
var list = await GetGroupConsistentRuleMatchSubjectIdListAsync(new GroupConsistentSimpleQuery() { TrialId = inQuery.TrialId, TrialReadingCriterionId = inQuery.TrialReadingCriterionId });
|
||||
|
||||
var isAllowAutoAllocate = !list.Any(t => t.IsHaveGeneratedTask) && list.Count() > 2*(rule?.PlanSubjectCount??0);
|
||||
|
||||
return ResponseOutput.Ok(pagedList, new {Rule=rule, IsAllowAutoAllocate = isAllowAutoAllocate });
|
||||
}
|
||||
|
||||
|
||||
@@ -829,8 +835,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<IResponseOutput> UpdateTrialVirtualSiteCode(UpdateTrialSiteCodeCommand inCommand)
|
||||
{
|
||||
|
||||
if (_trialSiteRepository.Where(t => t.TrialId == inCommand.TrialId, false, true).Any(t => t.TrialSiteCode == inCommand.VirtualSiteCode))
|
||||
{
|
||||
return ResponseOutput.NotOk(_localizer["TaskConsistent_SiteCodeExists"]);
|
||||
}
|
||||
|
||||
var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == inCommand.TrialId);
|
||||
|
||||
var oldCode = trial.VitrualSiteCode;
|
||||
|
||||
trial.VitrualSiteCode = inCommand.VirtualSiteCode;
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trial.Id, u => new VisitTask() { BlindTrialSiteCode = inCommand.VirtualSiteCode });
|
||||
@@ -838,6 +851,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _taskConsistentRuleRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trial.Id, u => new TaskConsistentRule() { BlindTrialSiteCode = inCommand.VirtualSiteCode });
|
||||
|
||||
|
||||
await _visitTaskRepository.ExecuteUpdateAsync(t => t.TrialId == trial.Id, s => s.SetProperty(e => e.BlindSubjectCode, u => u.BlindSubjectCode.Replace(oldCode, inCommand.VirtualSiteCode)));
|
||||
|
||||
await _trialVirtualSiteCodeUpdateRepository.AddAsync(new TrialVirtualSiteCodeUpdate() { VirturalSiteCode = inCommand.VirtualSiteCode, TrialId = inCommand.TrialId });
|
||||
|
||||
await _trialRepository.SaveChangesAsync();
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate"]);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(editTrialSiteCommand.TrialSiteCode) && await _trialRepository.AnyAsync(t=>t.Id==trialId && t.VitrualSiteCode == editTrialSiteCommand.TrialSiteCode) )
|
||||
if(!string.IsNullOrEmpty(editTrialSiteCommand.TrialSiteCode) && await _trialRepository.AnyAsync(t=>t.Id==trialId && t.VitrualSiteCode == editTrialSiteCommand.TrialSiteCode,true) )
|
||||
{
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate2"]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user