diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingQuestionService.cs index 41d62e890..659c0750a 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingQuestionService.cs @@ -13,6 +13,9 @@ namespace IRaCIS.Core.Application.Contracts { Task SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId); - + Task VerifyeCriterionNeedSynchronize(VerifyeCriterionNeedSynchronizeInDto inDto); + + + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index cb53d2263..2501a56fe 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -112,7 +112,9 @@ namespace IRaCIS.Application.Services var systemCriterion = await _readingQuestionCriterionSystemRepository.Where(x => x.Id == trialCriterion.ReadingQuestionCriterionSystemId).FirstNotNullAsync(); if (systemCriterion.ConfirmTime > trialCriterion.SynchronizeTime) { + await SynchronizeCriterion(inDto.TrialCriterionId); return true; + } else { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 839c4b8df..0c3043662 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization; using IRaCIS.Core.Application.Auth; using Panda.DynamicWebApi.Attributes; using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Application.Service.Reading.Dto; namespace IRaCIS.Core.Application { @@ -25,6 +26,7 @@ namespace IRaCIS.Core.Application private readonly IEasyCachingProvider _provider; private readonly IRepository _taskAllocationRuleRepository; + private readonly IReadingQuestionService iReadingQuestionService; public TrialConfigService(IRepository trialRepository, IRepository trialQCQuestionRepository, @@ -33,11 +35,13 @@ namespace IRaCIS.Core.Application IRepository clinicalDataTrialSetRepository, IRepository readingCriterionPageRepository, IRepository taskAllocationRuleRepository, + IReadingQuestionService iReadingQuestionService, IEasyCachingProvider provider ) { _trialRepository = trialRepository; _taskAllocationRuleRepository = taskAllocationRuleRepository; + this.iReadingQuestionService = iReadingQuestionService; this._trialQCQuestionRepository = trialQCQuestionRepository; this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; this._readingQuestionTrialRepository = readingQuestionTrialRepository; @@ -234,7 +238,11 @@ namespace IRaCIS.Core.Application result.FormType = trialCriterion.FormType; result.IsFromSystem = trialCriterion.ReadingQuestionCriterionSystemId != null; - + // 验证并同步 + await iReadingQuestionService.VerifyeCriterionNeedSynchronize(new VerifyeCriterionNeedSynchronizeInDto() + { + TrialCriterionId = trialCriterion.Id + }); }; result.TrialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId == result.TrialCriterionId