This commit is contained in:
he
2022-10-18 11:57:53 +08:00
parent e628fd0dc7
commit 1f0d5c77da
3 changed files with 27 additions and 18 deletions
@@ -136,6 +136,27 @@ namespace IRaCIS.Core.Application
[HttpPost]
public async Task<GetTrialReadingInfoOutDto> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
{
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
if (trialCriterion.SynchronizeOriginalTime == null && trialCriterion.ReadingQuestionCriterionSystemId != null)
{
// 同步器官
await _iOrganInfoService.SynchronizeSystemOrganToTrial(new SynchronizeSystemOrganToTrialInDto()
{
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
SystemCriterionId = trialCriterion.ReadingQuestionCriterionSystemId
});
// 同步问题
await iReadingQuestionService.SynchronizeCriterion(new SynchronizeCriterionInDto()
{
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
});
}
GetTrialReadingInfoOutDto trialInfo= await _readingQuestionCriterionTrialRepository.Where(x=>x.Id==inDto.TrialReadingCriterionId).ProjectTo<GetTrialReadingInfoOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
trialInfo.GlobalAssessTypeIds = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.TrialReadingCriterionId && x.ParentCode == "GlobalAssessType").Select(x => x.DictionaryId).ToListAsync();
@@ -262,22 +283,6 @@ namespace IRaCIS.Core.Application
result.FormType = trialCriterion.FormType;
result.IsFromSystem = trialCriterion.ReadingQuestionCriterionSystemId != null;
if (trialCriterion.SynchronizeOriginalTime == null && trialCriterion.ReadingQuestionCriterionSystemId != null)
{
// 同步器官
await _iOrganInfoService.SynchronizeSystemOrganToTrial(new SynchronizeSystemOrganToTrialInDto()
{
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
SystemCriterionId = trialCriterion.ReadingQuestionCriterionSystemId
});
// 同步问题
await iReadingQuestionService.SynchronizeCriterion(new SynchronizeCriterionInDto()
{
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
});
}
};