From 5d2acf44c10b4e340868908cf1f94c0fc9b50f6f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 15 Aug 2023 15:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E5=BF=83=E8=B0=83?= =?UTF-8?q?=E7=A0=94=20isJoin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskHelpeService.cs | 2 +- .../Service/SiteSurvey/TrialSiteSurveyService.cs | 10 ++++++---- IRaCIS.Core.Application/TestService.cs | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index d5498f96f..548987b2b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -55,7 +55,7 @@ namespace IRaCIS.Core.Application.Service public VisitTaskHelpeService(IRepository visitTaskRepository, IRepository trialRepository, IEasyCachingProvider provider, IRepository subjectVisitRepository, IRepository readModuleRepository, - IRepository readingTaskQuestionAnswerRepository, + IRepository readingTaskQuestionAnswerRepository, IRepository readingTableAnswerRowInfoRepository, IRepository readingTableQuestionAnswerRepository, IRepository readingTableQuestionTrialRepository, diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 2273d8add..784239717 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -729,17 +729,18 @@ namespace IRaCIS.Core.Application.Contracts sysUserInfo = newUser; + } + await _trialSiteUserSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new TrialSiteUserSurvey() { IsGenerateSuccess = true, SystemUserId = sysUserInfo.Id }); + } + // //发送邮件的时候需要用到该字段 item.SystemUserId = sysUserInfo.Id; - await _trialSiteUserSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new TrialSiteUserSurvey() { IsGenerateSuccess = true, SystemUserId = sysUserInfo.Id }); - - } await _trialSiteUserSurveyRepository.SaveChangesAsync(); @@ -784,10 +785,11 @@ namespace IRaCIS.Core.Application.Contracts await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable }); - + await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == userInfo.Id, u => new TrialSiteUserSurvey() { IsJoin = true }); } await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurvey.Id && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.Id, ReviewerTime = DateTime.Now }); + await _userRepository.SaveChangesAsync(); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 54a486acc..a2b12a4da 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -2,6 +2,7 @@ using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; +using MassTransit; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; @@ -171,9 +172,19 @@ namespace IRaCIS.Application.Services [AllowAnonymous] - public async Task testwwwww([FromServices] IWebHostEnvironment env) + public async Task> testwwwww([FromServices] IWebHostEnvironment env) { - await Task.CompletedTask; + int count = 200; + + var list=new List(); + + for (int i = 0; i < count; i++) + { + Guid guid = NewId.NextGuid(); + list.Add(guid); + } + + return list; }