+42
-15
@@ -22,8 +22,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository,
|
||||
IReadingImageTaskService _iReadingImageTaskService,
|
||||
IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> _readingSystemCriterionDictionaryRepository,
|
||||
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingCriterionPage> _readingCriterionPageRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
@@ -939,8 +940,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> CopySystemCriterionData(CopySystemCriterionDataInDto inDto)
|
||||
{
|
||||
if (inDto.IsCopyQuestion)
|
||||
{
|
||||
|
||||
var newSystemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.SourceSystemCriterionId)
|
||||
.ProjectTo<ReadingQuestionSystemData>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
newSystemQuestionList.ForEach(x =>
|
||||
@@ -993,22 +993,49 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
await _readingTableQuestionSystemRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
|
||||
await _readingTableQuestionSystemRepository.AddRangeAsync(needAddTableDatas);
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
#region 器官
|
||||
var organData = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId).ToListAsync();
|
||||
|
||||
organData.ForEach(x =>
|
||||
{
|
||||
var organData = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId).ToListAsync();
|
||||
x.Id = NewId.NextGuid();
|
||||
x.SystemCriterionId = inDto.NewSystemCriterionId;
|
||||
});
|
||||
await _organInfoRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
|
||||
await _organInfoRepository.AddRangeAsync(organData);
|
||||
#endregion
|
||||
|
||||
#region 字典Code
|
||||
var dictionaryCodes = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId).ToListAsync();
|
||||
|
||||
dictionaryCodes.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.SystemCriterionId = inDto.NewSystemCriterionId;
|
||||
});
|
||||
await _systemCriterionDictionaryCodeRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
|
||||
await _systemCriterionDictionaryCodeRepository.AddRangeAsync(dictionaryCodes);
|
||||
#endregion
|
||||
|
||||
#region 字典
|
||||
|
||||
|
||||
var criterionDictionaries = await _readingSystemCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.SourceSystemCriterionId).ToListAsync();
|
||||
|
||||
criterionDictionaries.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.CriterionId = inDto.NewSystemCriterionId;
|
||||
});
|
||||
await _readingSystemCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.NewSystemCriterionId);
|
||||
await _readingSystemCriterionDictionaryRepository.AddRangeAsync(criterionDictionaries);
|
||||
|
||||
#endregion
|
||||
|
||||
organData.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.SystemCriterionId = inDto.NewSystemCriterionId;
|
||||
});
|
||||
await _organInfoRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
|
||||
await _organInfoRepository.AddRangeAsync(organData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user