diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs index b0e97c149..f6e36f723 100644 --- a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs @@ -154,7 +154,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring IRepository _visitTaskRepository, IRepository _trialDocumentRepository, IRepository _identityUserRepository, - + IRepository _trialIdentityUserRepository, IRepository _dictionaryRepository, IRepository _trialUserRoleRepository, IRepository _emailNoticeConfigrepository, @@ -180,8 +180,10 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring // 只查询新增角色的用户 systemDocQuery = from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id)) + join trialIdentityUser in _trialIdentityUserRepository.AsQueryable() on trialDoc.TrialId equals trialIdentityUser.TrialId 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))) @@ -208,13 +210,15 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring // 查询所有相关角色的用户 systemDocQuery = from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id)) + join trialIdentityUser in _trialIdentityUserRepository.AsQueryable() on trialDoc.TrialId equals trialIdentityUser.TrialId 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))) select new UnionDocumentWithConfirmInfoView() { - IsSystemDoc = true, + IsSystemDoc = false, Id = trialDoc.Id, CreateTime = trialDoc.CreateTime, IsDeleted = trialDoc.IsDeleted, diff --git a/IRaCIS.Core.Application/Service/Document/TrialHistoryRecordFileService.cs b/IRaCIS.Core.Application/Service/Document/TrialHistoryRecordFileService.cs index bfa69f3a6..6dc373690 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialHistoryRecordFileService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialHistoryRecordFileService.cs @@ -11,6 +11,7 @@ using IRaCIS.Core.Infrastructure.Extention; using System.Threading.Tasks; using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Application.Service.DTO; +using IRaCIS.Core.Application.MassTransit.Command; namespace IRaCIS.Core.Application.Service; /// @@ -41,6 +42,21 @@ public class TrialHistoryRecordFileService(IRepository _ return pageList; } + /// + /// 批量新增稽查记录文件 + /// + /// + /// + [HttpPost] + public async Task BatchAddTrialHistoryRecordFile(List inDto) + { + List entities = _mapper.Map>(inDto); + await _trialHistoryRecordFileRepository.AddRangeAsync(entities); + + await _trialHistoryRecordFileRepository.SaveChangesAsync(); + return ResponseOutput.Ok(true); + } + /// /// 新增或修改稽查记录文件 ///