From 0d26daa3b0ef395ea1904b3e3d26e7d31a6c06ac Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 25 Aug 2025 14:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 2 +- .../Recurring/TrialDocumentConsumer.cs | 31 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 26a2ff1e8..9bea1fdb8 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -13066,7 +13066,7 @@ - + IR影像阅片 diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs index 955ffb18a..1002094bd 100644 --- a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs @@ -9,6 +9,7 @@ using MassTransit; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using MimeKit; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Globalization; @@ -57,17 +58,15 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring join trialIdentityUser in _trialIdentityUserRepository.Where(x => x.IsDeleted == false) on trialDoc.TrialId equals trialIdentityUser.TrialId join trialUserRole in _trialUserRoleRepository.Where(x => x.IsDeleted == false) on trialIdentityUser.Id equals trialUserRole.TrialUserId - from identityUser in _identityUserRepository.AsQueryable(false) - - .Where(t => t.Status == UserStateEnum.Enable && - t.Id == trialIdentityUser.IdentityUserId && - t.UserRoleList.Where(t => t.IsUserRoleDisabled == false) - .Any(t => trialDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId))) + join identityUser in _identityUserRepository.AsQueryable(false).Where(u => u.Status == UserStateEnum.Enable) + on trialIdentityUser.IdentityUserId equals identityUser.Id + join confirm in _trialDocConfirmedUserRepository.Where() on new { trialIdentityUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc from confirm in cc.DefaultIfEmpty() + where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted && trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId)) select new TrialSignDocView() { TrialCode = trialDoc.Trial.TrialCode, @@ -191,12 +190,10 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id)) join trialIdentityUser in _trialIdentityUserRepository.Where(x=>x.IsDeleted==false) on trialDoc.TrialId equals trialIdentityUser.TrialId join trialUserRole in _trialUserRoleRepository.Where(x => x.IsDeleted == false) on trialIdentityUser.Id equals trialUserRole.TrialUserId - from identityUser in _identityUserRepository.AsQueryable(false) - .Where(t => t.Status == UserStateEnum.Enable && - t.Id == trialIdentityUser.IdentityUserId && - t.UserRoleList.Where(t => t.IsUserRoleDisabled == false) - .Any(t => context.Message.NewUserTypeIds.Contains(t.UserTypeId) && - trialDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId))) + join identityUser in _identityUserRepository.AsQueryable(false).Where(u => u.Status == UserStateEnum.Enable) + on trialIdentityUser.IdentityUserId equals identityUser.Id + where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted && context.Message.NewUserTypeIds.Contains(ur.UserRole.UserTypeId) && trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId)) + select new UnionDocumentWithConfirmInfoView() { IsSystemDoc = true, @@ -222,11 +219,11 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id)) join trialIdentityUser in _trialIdentityUserRepository.Where(x => x.IsDeleted == false) on trialDoc.TrialId equals trialIdentityUser.TrialId join trialUserRole in _trialUserRoleRepository.Where(x=>x.IsDeleted==false) on trialIdentityUser.Id equals trialUserRole.TrialUserId - from identityUser in _identityUserRepository.AsQueryable(false) - .Where(t => t.Status == UserStateEnum.Enable && - t.Id== trialIdentityUser.IdentityUserId&& - t.UserRoleList.Where(t => t.IsUserRoleDisabled == false) - .Any(t => trialDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId))) + join identityUser in _identityUserRepository.AsQueryable(false).Where(u => u.Status == UserStateEnum.Enable) + on trialIdentityUser.IdentityUserId equals identityUser.Id + where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted &&trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId)) + + select new UnionDocumentWithConfirmInfoView() { IsSystemDoc = false,