问题修改

Uat_Study
he 2022-05-23 10:19:25 +08:00
parent c876c1d0fa
commit b75366315b
2 changed files with 19 additions and 1 deletions

View File

@ -154,6 +154,21 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
var entity = item.Entity as Trial;
List<string> trials = new List<string>();
var trialids =new List<Guid>();
if (entity.TrialDicList == null|| entity.TrialDicList.Count==0)
{
trialids = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id&&x.KeyName== "Criterion").Select(x => x.DictionaryId).ToListAsync();
}
else
{
trialids = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
}
trials = await this._dbContext.Dictionary.Where(x => trialids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
await InsertInspection<Trial>(item, type, x => new DataInspection()
{
TrialId = x.Id,
@ -161,7 +176,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ResearchProgramNo=x.ResearchProgramNo,
GeneralId = x.Id,
},new {
TrialDicList= string.Join(",",entity.TrialDicList.Select(x => x.KeyName).ToList())
TrialDicList= string.Join(",", trials)
});
}

View File

@ -224,6 +224,9 @@ namespace IRaCIS.Core.Infra.EFCore
#region Trial
public virtual DbSet<Trial> Trial { get; set; }
public virtual DbSet<TrialDictionary> TrialDictionary { get; set; }
public virtual DbSet<TrialStatusDetail> TrialDetail { get; set; }
public virtual DbSet<TrialUser> UserTrial { get; set; }