From ad7d7c4311ea810b855a35e21f5991c6f9da6fae Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 18 May 2022 18:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=82=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/SiteSurvey/TrialSiteSurveyService.cs | 7 +++++-- .../Service/TrialSiteUser/TrialExternalUserService.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 1b3983b3..e90b4a1d 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -28,11 +28,14 @@ namespace IRaCIS.Core.Application.Contracts private readonly IRepository _userRepository; private readonly IRepository _trialSiteRepository; - public TrialSiteSurveyService(IRepository trialSiteSurveyRepository, IRepository trialSiteUserSurveyRepository, IRepository userRepository, IRepository trialSiteRepository) + private readonly IRepository _trialUserRepository; + + public TrialSiteSurveyService(IRepository trialSiteSurveyRepository, IRepository trialUserRepository,IRepository trialSiteUserSurveyRepository, IRepository userRepository, IRepository trialSiteRepository) { _trialSiteSurveyRepository = trialSiteSurveyRepository; _trialSiteUserSurveyRepository = trialSiteUserSurveyRepository; _userRepository = userRepository; + _trialUserRepository = trialUserRepository; _trialSiteRepository = trialSiteRepository; } @@ -854,7 +857,7 @@ namespace IRaCIS.Core.Application.Contracts var siteId = trialSiteSurvey.SiteId; //判断TrialUser中是否存在 不存在就插入 - if (!await _repository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId)) + if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId,true)) { await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId }); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index b898cdf0..00ce0604 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -273,7 +273,7 @@ namespace IRaCIS.Core.Application.Service var userId = sysUserInfo.Id; //判断TrialUser中是否存在 不存在就插入 - if (!await _repository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId)) + if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId,true)) { await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });