修改一版

This commit is contained in:
he
2022-06-30 13:09:44 +08:00
parent ab6c7362ec
commit 6cf36710e3
3 changed files with 19 additions and 4 deletions
@@ -155,8 +155,9 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<IResponseOutput> AddTrialDataFromSystem(AddTrialDataFromSystemInDto inDto)
{
var needList = _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id))
.Select(x => new ReadingMedicineTrialQuestion()
// 直接写??
var systemList = await _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id)).ToListAsync();
var needList= systemList.Select(x => new ReadingMedicineTrialQuestion()
{
Id = NewId.NextGuid(),
ShowOrder = x.ShowOrder,
@@ -166,7 +167,9 @@ namespace IRaCIS.Core.Application.Service
Type = x.Type,
TypeValue = x.TypeValue,
TrialId=inDto.TrialId,
});
}).ToList();
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
@@ -540,6 +540,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionTrial(AddOrUpdateReadingQuestionCriterionTrialInDto indto)
{
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
return ResponseOutput.Ok(entity.Id.ToString());
}