修改稽查
parent
ab5b0ba083
commit
86e330c586
|
@ -65,7 +65,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
if (addOrEditTrialSiteUserSurvey.IsGenerateAccount )
|
if (addOrEditTrialSiteUserSurvey.IsGenerateAccount )
|
||||||
{
|
{
|
||||||
var trialId= _trialSiteUserSurveyRepository.Where(t=>t.Id == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId).Select(t=>t.TrialSiteSurvey.TrialId).FirstOrDefault();
|
var trialId= _trialSiteUserSurveyRepository.Where(t=>t.TrialSiteSurveyId == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId).Select(t=>t.TrialSiteSurvey.TrialId).FirstOrDefault();
|
||||||
|
|
||||||
var trialType = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
|
var trialType = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
|
||||||
|
|
||||||
|
|
|
@ -28,16 +28,16 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Task<bool> Handle(TrialStateCacheRequest request, CancellationToken cancellationToken)
|
public async Task<bool> Handle(TrialStateCacheRequest request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
//项目启动,将项目状态缓存,因为hangfire 加入后台任务,还是向队列添加任务,执行都有延迟,效果不好
|
//项目启动,将项目状态缓存,因为hangfire 加入后台任务,还是向队列添加任务,执行都有延迟,效果不好
|
||||||
var list = _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }).ToList();
|
var list = await _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }).ToListAsync();
|
||||||
|
|
||||||
// 每天都会有任务刷新状态,项目编辑 添加时 都会处理到缓存中
|
// 每天都会有任务刷新状态,项目编辑 添加时 都会处理到缓存中
|
||||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
||||||
|
|
||||||
|
|
||||||
return Task.FromResult(true);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1557,11 +1557,42 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
extraIdentification = "/ConfirmSelect";
|
extraIdentification = "/ConfirmSelect";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取配置的标准名称
|
||||||
|
|
||||||
|
//List<string> trialDics = new List<string>();
|
||||||
|
//var dictionaryIds = new List<Guid>();
|
||||||
|
//if (entity.TrialDicList == null || entity.TrialDicList.Count == 0)
|
||||||
|
//{
|
||||||
|
// dictionaryIds = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id && x.KeyName == "Criterion").Select(x => x.DictionaryId).ToListAsync();
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// dictionaryIds = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
|
||||||
|
//}
|
||||||
|
//trialDics = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
|
||||||
|
|
||||||
|
var trialReadingCritiralIdList= new List<Guid>();
|
||||||
|
|
||||||
|
var criterionNameList = new List<string>();
|
||||||
|
|
||||||
|
if (entity.TrialClinicalDataSetCriteriaList==null || entity.TrialClinicalDataSetCriteriaList.Count() == 0)
|
||||||
|
{
|
||||||
|
criterionNameList = await _dbContext.TrialClinicalDataSetCriterion.Where(t => t.TrialClinicalDataSetId == entity.Id).Select(t => t.TrialReadingCriterion.CriterionName).ToListAsync();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ids = entity.TrialClinicalDataSetCriteriaList.Select(t => t.TrialReadingCriterionId).ToList();
|
||||||
|
criterionNameList = await _dbContext.ReadingQuestionCriterionTrial.Where(t => ids.Contains(t.Id)).Select(t => t.CriterionName).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
await InsertInspection<ClinicalDataTrialSet>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<ClinicalDataTrialSet>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
IsDistinctionInterface = false,
|
IsDistinctionInterface = false,
|
||||||
ObjectRelationParentId = entity.TrialId,
|
ObjectRelationParentId = entity.TrialId,
|
||||||
ExtraIndentification = extraIdentification,
|
ExtraIndentification = extraIdentification,
|
||||||
|
},new
|
||||||
|
{
|
||||||
|
CriterionNames= criterionNameList?.Count()>0? string.Join(",", criterionNameList):string.Empty
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue