From 1d90aba7cd5de28ea27e8c1b72f874f64ae8a7dd Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Tue, 30 Jun 2026 14:04:11 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=A4=8D?=
=?UTF-8?q?=E8=AF=B7=E6=B1=82=E9=80=9A=E7=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../RequestDuplicationFilter.cs | 44 ++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/IRaCIS.Core.Application/BusinessFilter/LegacyController/RequestDuplicationFilter.cs b/IRaCIS.Core.Application/BusinessFilter/LegacyController/RequestDuplicationFilter.cs
index a64d098bd..d462948dd 100644
--- a/IRaCIS.Core.Application/BusinessFilter/LegacyController/RequestDuplicationFilter.cs
+++ b/IRaCIS.Core.Application/BusinessFilter/LegacyController/RequestDuplicationFilter.cs
@@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
{
using Database.Api;
using DocumentFormat.OpenXml.InkML;
+ using IRaCIS.Core.Application.Helper.OtherTool;
using IRaCIS.Core.Application.Service.Common;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
@@ -17,6 +18,7 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.ModelBinding;
+ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
@@ -35,7 +37,7 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
///
/// logger
/// loggerHelper
- public class RequestDuplicationFilter(ILogger logger, IHttpContextAccessor accessor, IUserInfo _userInfo, IStringLocalizer _localizer, IOptionsMonitor RequestDuplicationOptionsMonitor) : ExceptionFilterAttribute, IAsyncActionFilter
+ public class RequestDuplicationFilter(ILogger logger, IHttpContextAccessor accessor, IUserInfo _userInfo, IStringLocalizer _localizer, IOptionsMonitor RequestDuplicationOptionsMonitor, IConfiguration _config) : ExceptionFilterAttribute, IAsyncActionFilter
{
///
/// 传入的参数
@@ -118,11 +120,51 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
RequestDuplicationOptionsMonitor.CurrentValue.DuplicationWindowMs);
if (!isAdded)
{
+ SendRequestDuplicationWeComNotice(requestPath);
+ logger.LogError($"重复请求出现错误:{this.Intoparam}");
throw new BusinessValidationFailedException(_localizer["RequestDuplicationFilter_RequestDuplication"], ApiResponseCodeEnum.BusinessValidationFailed);
}
}
}
+ private void SendRequestDuplicationWeComNotice(string requestPath)
+ {
+ try
+ {
+ bool isOpenWeComNotice = _config.GetValue("WeComNoticeConfig:IsOpenWeComNotice");
+
+ if (isOpenWeComNotice)
+ {
+ string webhook = _config["WeComNoticeConfig:WebhookUrl"] ?? string.Empty;
+
+ var uri = new Uri(_config["SystemEmailSendConfig:SiteUrl"]);
+ var baseUrl = uri.GetLeftPart(UriPartial.Authority);
+
+ var userList = _config.GetSection("WeComNoticeConfig:APINoticeUserList").Get();
+
+ var request = accessor?.HttpContext?.Request;
+
+ _ = WeComNotifier.SendAlertAsync(
+ webhook: webhook,
+ alert: new WeComAlert
+ {
+ Env = baseUrl,
+ UserName = _userInfo.UserName.IsNotNullOrEmpty() ? $"{_userInfo.UserName}({_userInfo.UserTypeShortName})" : "匿名",
+ Api = $"{request?.Method} {requestPath}",
+ Message = "重复请求拦截",
+ JsonData = this.Intoparam,
+ Stack = string.Empty,
+ AtUsers = userList ?? []
+ }
+ );
+ }
+ }
+ catch (Exception ex)
+ {
+ logger.LogError($"重复请求过滤器里发送企业微信出现错误:{ex.Message}");
+ }
+ }
+
public string GenerateParameterHash(string parameters)
{
if (string.IsNullOrEmpty(parameters))
From dd05e26febe2e475e885f1153b7810a00e87a8aa Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Tue, 30 Jun 2026 15:33:55 +0800
Subject: [PATCH 2/5] =?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
---
.../Recurring/SystemDocumentConsumer.cs | 6 ++--
.../Recurring/TrialDocumentConsumer.cs | 32 +++++++++++++------
.../Document/DTO/SystemDocumentViewModel.cs | 2 ++
3 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
index b07ec8da6..3e9ec1470 100644
--- a/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
@@ -51,7 +51,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
- from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable&&!t.IsTestUser).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
+ from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
join confirmc in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirmc.ConfirmUserId, confirmc.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
select new UnionDocumentWithConfirmInfoView()
@@ -176,7 +176,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
from identityUser in _identityUserRepository.AsQueryable(false)
- .Where(t => t.Status == UserStateEnum.Enable && !t.IsTestUser &&
+ .Where(t => t.Status == UserStateEnum.Enable &&
t.UserRoleList.Where(t => t.IsUserRoleDisabled == false)
.Any(t => context.Message.NewUserTypeIds.Contains(t.UserTypeId) &&
sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
@@ -204,7 +204,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
from identityUser in _identityUserRepository.AsQueryable(false)
- .Where(t => t.Status == UserStateEnum.Enable && !t.IsTestUser &&
+ .Where(t => t.Status == UserStateEnum.Enable &&
t.UserRoleList.Where(t => t.IsUserRoleDisabled == false)
.Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
select new UnionDocumentWithConfirmInfoView()
diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
index 1a555bc73..ec374fa6c 100644
--- a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
@@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
var trialDocQuery =
from trialDoc in _trialDocumentRepository.AsQueryable(true)
-
+ join trial in _trialRepository.Where(x => x.IsDeleted == false) on trialDoc.TrialId equals trial.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
join identityUser in _identityUserRepository.AsQueryable(false).Where(u => u.Status == UserStateEnum.Enable && !u.IsTestUser)
@@ -72,7 +72,9 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
CurrentStaffTrainDays = trialDoc.CurrentStaffTrainDays,
NewStaffTrainDays = trialDoc.NewStaffTrainDays,
Id = trialDoc.Id,
- TrialId= trialDoc.TrialId,
+ TrialType= trial.TrialType,
+ IsTestUser= identityUser.IsTestUser,
+ TrialId = trialDoc.TrialId,
IsSystemDoc = false,
CreateTime = trialDoc.CreateTime,
FullFilePath = trialDoc.Path,
@@ -94,7 +96,11 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
};
var datalist = await trialDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted == false && t.ConfirmTime == null&&t.ConfirmTime==null)
.ToListAsync();
- datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
+
+
+ datalist = datalist
+ .Where(x=>((x.TrialType== TrialType.OfficialTrial|| x.TrialType== TrialType.Training) && !x.IsTestUser) || (x.TrialType==TrialType.NoneOfficial &&x.IsTestUser))
+ .Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
.ToList();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
@@ -203,20 +209,21 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
Console.WriteLine($"只发送给新增项目的角色,角色数量: {context.Message.NewUserTypeIds.Count}");
}
// 构建查询
- IQueryable systemDocQuery;
+ IQueryable trialDocQuery;
if (context.Message.NewUserTypeIds != null && context.Message.NewUserTypeIds.Any())
{
// 只查询新增角色的用户
- systemDocQuery =
+ trialDocQuery =
from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
+ join trial in _trialRepository.Where(x => x.IsDeleted == false) on trialDoc.TrialId equals trial.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
join identityUser in _identityUserRepository.AsQueryable(false).Where(u => u.Status == UserStateEnum.Enable && !u.IsTestUser)
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()
+ select new TrialSignDocView()
{
IsSystemDoc = true,
Id = trialDoc.Id,
@@ -224,6 +231,8 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
CreateTime = trialDoc.CreateTime,
IsDeleted = trialDoc.IsDeleted,
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
+ TrialType = trial.TrialType,
+ IsTestUser = identityUser.IsTestUser,
Name = trialDoc.Name,
Path = trialDoc.Path,
FileTypeId = trialDoc.FileTypeId,
@@ -238,8 +247,9 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
else
{
// 查询所有相关角色的用户
- systemDocQuery =
+ trialDocQuery =
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
@@ -249,7 +259,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted &&trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId))
- select new UnionDocumentWithConfirmInfoView()
+ select new TrialSignDocView()
{
IsSystemDoc = false,
Id = trialDoc.Id,
@@ -258,6 +268,8 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
CreateTime = trialDoc.CreateTime,
IsDeleted = trialDoc.IsDeleted,
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
+ TrialType = trial.TrialType,
+ IsTestUser = identityUser.IsTestUser,
Name = trialDoc.Name,
Path = trialDoc.Path,
FileTypeId = trialDoc.FileTypeId,
@@ -270,7 +282,9 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
};
}
- var datalist = await systemDocQuery.IgnoreQueryFilters().ToListAsync();
+ var datalist = await trialDocQuery
+ .IgnoreQueryFilters().Where(x => ((x.TrialType == TrialType.OfficialTrial || x.TrialType == TrialType.Training) && !x.IsTestUser) || (x.TrialType == TrialType.NoneOfficial && x.IsTestUser))
+ .ToListAsync();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
index 02e7e2dde..4f50ce1c9 100644
--- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
@@ -87,7 +87,9 @@ namespace IRaCIS.Core.Application.Contracts
public string ExperimentName { get; set; }
+ public TrialType TrialType { get; set; }
+ public bool IsTestUser { get; set; }
}
From a69e8969a4520a36f841f42aeb919897805d50ec Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Tue, 30 Jun 2026 16:45:34 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.API/appsettings.Prod_Event_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.Prod_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.Test_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json | 2 +-
IRaCIS.Core.API/appsettings.US_Prod_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.US_Test_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.US_Uat_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.Uat_IRC.json | 2 +-
IRaCIS.Core.API/appsettings.json | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/IRaCIS.Core.API/appsettings.Prod_Event_IRC.json b/IRaCIS.Core.API/appsettings.Prod_Event_IRC.json
index 47936737a..b4d3027b1 100644
--- a/IRaCIS.Core.API/appsettings.Prod_Event_IRC.json
+++ b/IRaCIS.Core.API/appsettings.Prod_Event_IRC.json
@@ -117,7 +117,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.Prod_IRC.json b/IRaCIS.Core.API/appsettings.Prod_IRC.json
index db86245af..671c9e50b 100644
--- a/IRaCIS.Core.API/appsettings.Prod_IRC.json
+++ b/IRaCIS.Core.API/appsettings.Prod_IRC.json
@@ -117,7 +117,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.Test_IRC.json b/IRaCIS.Core.API/appsettings.Test_IRC.json
index 3e3eea57b..01c61ee21 100644
--- a/IRaCIS.Core.API/appsettings.Test_IRC.json
+++ b/IRaCIS.Core.API/appsettings.Test_IRC.json
@@ -206,7 +206,7 @@
// 是否启用重复请求检测
"IsEnabled": true,
// 重复请求时间窗口(毫秒)
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
// 缓存请求时间(秒)
"CacheTimeSeconds": 5,
"ExcludedPaths": [
diff --git a/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json b/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json
index ebd2c44fe..22ca28136 100644
--- a/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json
+++ b/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json
@@ -97,7 +97,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
index 14b84eaf0..25dd2dc87 100644
--- a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json
@@ -122,7 +122,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.US_Test_IRC.json b/IRaCIS.Core.API/appsettings.US_Test_IRC.json
index b455bdf8c..dd3b6a562 100644
--- a/IRaCIS.Core.API/appsettings.US_Test_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Test_IRC.json
@@ -102,7 +102,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
index d9408c07b..73d2c1a1b 100644
--- a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
+++ b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json
@@ -107,7 +107,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.Uat_IRC.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json
index 2186b76d6..015052fe4 100644
--- a/IRaCIS.Core.API/appsettings.Uat_IRC.json
+++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json
@@ -134,7 +134,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json
index 4889af5de..c0f519a6e 100644
--- a/IRaCIS.Core.API/appsettings.json
+++ b/IRaCIS.Core.API/appsettings.json
@@ -77,7 +77,7 @@
},
"RequestDuplicationOptions": {
"IsEnabled": true,
- "DuplicationWindowMs": 200,
+ "DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
From 5871d054d3b058bc6aea76048a274ff571850b0f Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 1 Jul 2026 09:25:24 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=96=87=E6=A1=A3?=
=?UTF-8?q?=E5=8C=BA=E5=88=86=E8=AF=AD=E8=A8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Recurring/SystemDocumentConsumer.cs | 20 +++++++++++++------
.../Recurring/TrialDocumentConsumer.cs | 9 +++++----
.../Document/DTO/SystemDocumentViewModel.cs | 6 +++++-
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
index 3e9ec1470..d9361c315 100644
--- a/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Recurring/SystemDocumentConsumer.cs
@@ -54,8 +54,10 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
join confirmc in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirmc.ConfirmUserId, confirmc.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
- select new UnionDocumentWithConfirmInfoView()
+ select new TriaAndSystemlSignDocView()
{
+ DocLanguageType=sysDoc.DocLanguageType,
+ UserWorkLanguage=identityUser.UserWorkLanguage,
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
@@ -79,7 +81,9 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
};
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted == false && t.ConfirmTime == null)
.ToListAsync();
- datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
+ datalist = datalist
+ .Where(x=>x.DocLanguageType == DocLanguageType.CN_US || (int)x.DocLanguageType == (int)x.UserWorkLanguage)
+ .Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
.Where(x => x.IsNeedSendEmial).ToList();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
@@ -168,7 +172,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
Console.WriteLine($"只发送给新增的角色,角色数量: {context.Message.NewUserTypeIds.Count}");
}
// 构建查询
- IQueryable systemDocQuery;
+ IQueryable systemDocQuery;
if (context.Message.NewUserTypeIds != null && context.Message.NewUserTypeIds.Any())
{
@@ -180,8 +184,10 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
t.UserRoleList.Where(t => t.IsUserRoleDisabled == false)
.Any(t => context.Message.NewUserTypeIds.Contains(t.UserTypeId) &&
sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
- select new UnionDocumentWithConfirmInfoView()
+ select new TriaAndSystemlSignDocView()
{
+ DocLanguageType = sysDoc.DocLanguageType,
+ UserWorkLanguage = identityUser.UserWorkLanguage,
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
@@ -207,8 +213,10 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
.Where(t => t.Status == UserStateEnum.Enable &&
t.UserRoleList.Where(t => t.IsUserRoleDisabled == false)
.Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
- select new UnionDocumentWithConfirmInfoView()
+ select new TriaAndSystemlSignDocView()
{
+ DocLanguageType = sysDoc.DocLanguageType,
+ UserWorkLanguage = identityUser.UserWorkLanguage,
IsSystemDoc = true,
Id = sysDoc.Id,
CreateTime = sysDoc.CreateTime,
@@ -226,7 +234,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
};
}
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(x => x.IsNeedSendEmial).ToListAsync();
-
+ datalist = datalist.Where(x => x.DocLanguageType == DocLanguageType.CN_US || (int)x.DocLanguageType == (int)x.UserWorkLanguage).ToList();
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
index ec374fa6c..0a2bc5fa1 100644
--- a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs
@@ -64,8 +64,9 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
from confirm in cc.DefaultIfEmpty()
where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted && trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId))
- select new TrialSignDocView()
+ select new TriaAndSystemlSignDocView()
{
+
TrialCode = trialDoc.Trial.TrialCode,
ResearchProgramNo = trialDoc.Trial.ResearchProgramNo,
ExperimentName = trialDoc.Trial.ExperimentName,
@@ -209,7 +210,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
Console.WriteLine($"只发送给新增项目的角色,角色数量: {context.Message.NewUserTypeIds.Count}");
}
// 构建查询
- IQueryable trialDocQuery;
+ IQueryable trialDocQuery;
if (context.Message.NewUserTypeIds != null && context.Message.NewUserTypeIds.Any())
{
@@ -223,7 +224,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
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 TrialSignDocView()
+ select new TriaAndSystemlSignDocView()
{
IsSystemDoc = true,
Id = trialDoc.Id,
@@ -259,7 +260,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
where trialIdentityUser.TrialUserRoleList.Any(ur => !ur.IsDeleted &&trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == ur.UserRole.UserTypeId))
- select new TrialSignDocView()
+ select new TriaAndSystemlSignDocView()
{
IsSystemDoc = false,
Id = trialDoc.Id,
diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
index 4f50ce1c9..e192c1bfd 100644
--- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs
@@ -80,7 +80,7 @@ namespace IRaCIS.Core.Application.Contracts
}
- public class TrialSignDocView : UnionDocumentWithConfirmInfoView
+ public class TriaAndSystemlSignDocView : UnionDocumentWithConfirmInfoView
{
public string TrialCode { get; set; }
public string ResearchProgramNo { get; set; }
@@ -90,6 +90,8 @@ namespace IRaCIS.Core.Application.Contracts
public TrialType TrialType { get; set; }
public bool IsTestUser { get; set; }
+
+ public UserWorkLanguage UserWorkLanguage { get; set; }
}
@@ -367,6 +369,8 @@ namespace IRaCIS.Core.Application.Contracts
public DocLanguageType DocLanguageType { get; set; }
+
+
}
From dae0cab2613b7d6eea7d44a165332b0d3a4f4a9b Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 1 Jul 2026 11:20:49 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91=20?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8F=91=E5=B8=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Application/IRaCIS.Core.Application.xml | 7 +------
.../Service/Document/SystemDocumentService.cs | 2 ++
.../Service/Document/TrialDocumentService.cs | 4 ++--
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 2b2c2ba2c..91df3c337 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -16275,7 +16275,7 @@
logger
loggerHelper
-
+
请求拦截 请求前后的操作
@@ -21905,11 +21905,6 @@
读片数量分类统计
-
-
- 打开失访可读
-
-
影像质控风险控制
diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
index 4e70aa087..cb1da9823 100644
--- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs
@@ -216,6 +216,8 @@ namespace IRaCIS.Core.Application.Services
return ResponseOutput.Result(true);
}
+
+
///
/// 下线系统文档
///
diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
index 680450732..ed708e630 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
@@ -153,7 +153,7 @@ namespace IRaCIS.Core.Application.Services
}
[HttpPost]
- public async Task> GetTrialSignDocumentList(TrialDocQuery inQuery)
+ public async Task> GetTrialSignDocumentList(TrialDocQuery inQuery)
{
var trialDocQueryable = from trialDoc in _trialDocumentRepository.Where(t => t.IsPublish)
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
@@ -164,7 +164,7 @@ namespace IRaCIS.Core.Application.Services
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
- select new TrialSignDocView()
+ select new TriaAndSystemlSignDocView()
{
TrialCode = trialDoc.Trial.TrialCode,
ResearchProgramNo = trialDoc.Trial.ResearchProgramNo,