diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index afa222737..2e0673c7a 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -159,11 +159,11 @@ - - - - - + + 影像转发 + + + diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 274a745ab..ee38855d6 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -170,9 +170,10 @@ namespace IRaCIS.Core.Application [HttpGet("{trialId:guid}")] public async Task IfTrialCanOngoing(Guid trialId) { - return ResponseOutput.Ok(await _trialRepository.AnyAsync(trial => + var canOPt = await _trialRepository.AnyAsync(trial => trial.Id == trialId && trial.IsTrialBasicLogicConfirmed && trial.IsTrialProcessConfirmed && - trial.IsTrialUrgentConfirmed && trial.VisitPlanConfirmed)); + trial.IsTrialUrgentConfirmed && trial.VisitPlanConfirmed); + return ResponseOutput.Ok(canOPt, msg: canOPt?"": "项目 基础配置、流程配置、加急配置 、访视计划,有未确认项"); } /// diff --git a/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs b/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs new file mode 100644 index 000000000..99b0342db --- /dev/null +++ b/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs @@ -0,0 +1,42 @@ +using EntityFrameworkCore.Triggered; +using IRaCIS.Core.Domain.Share; + +namespace IRaCIS.Core.Application.Triggers +{ + public class ChallengeStateTrigger : IAfterSaveTrigger + { + private readonly IRepository _repository; + + public ChallengeStateTrigger(IRepository repository) + { + _repository = repository; + } + + public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) + { + var subjectVisitId = context.Entity.SubjectVisitId; + + ChallengeStateEnum subjectVisitChallengeState = default; + + + var closedStateList = await _repository.Where(t => t.SubjectVisitId == subjectVisitId).Select(t => t.IsClosed).ToListAsync(); + + if (closedStateList.Count == 0) + { + subjectVisitChallengeState = ChallengeStateEnum.No; + } + else if (closedStateList.All(t => t is true)) + { + subjectVisitChallengeState = ChallengeStateEnum.HaveAndAllClosed; + } + else + { + subjectVisitChallengeState = ChallengeStateEnum.HaveAndHaveNotClosed; + } + + + await _repository.BatchUpdateAsync(t => t.Id == subjectVisitId, + u => new SubjectVisit() { ChallengeState = subjectVisitChallengeState }); + } + } +} \ No newline at end of file