From 0a5164682fbb3e6a829e8c020e41a22399caff12 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Sep 2025 14:09:21 +0800 Subject: [PATCH 1/8] =?UTF-8?q?admin=20=E5=8F=AF=E4=BB=A5=E7=9C=8B?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=8C=BB=E9=99=A2=EF=BC=8C=E4=B8=8D=E5=8F=97?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=8C=BB=E9=99=A2=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.Test_HIR.json | 2 +- IRaCIS.Core.API/appsettings.Uat_HIR.json | 23 +++++++------------ .../IRaCIS.Core.Application.xml | 2 +- .../Service/TrialSiteUser/TrialService.cs | 2 +- .../Service/Visit/PatientService.cs | 2 +- IRaCIS.Core.Application/TestService.cs | 18 +++++++++++++++ 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/IRaCIS.Core.API/appsettings.Test_HIR.json b/IRaCIS.Core.API/appsettings.Test_HIR.json index 093dc9938..c2b5e67d4 100644 --- a/IRaCIS.Core.API/appsettings.Test_HIR.json +++ b/IRaCIS.Core.API/appsettings.Test_HIR.json @@ -42,7 +42,7 @@ "IsNeedChangePassWord": true, // 密码有效期(天),到期后必须修改 "ChangePassWordDays": 1000, - "OpenImageShare": true, + "OpenImageShare": true }, "SystemEmailSendConfig": { diff --git a/IRaCIS.Core.API/appsettings.Uat_HIR.json b/IRaCIS.Core.API/appsettings.Uat_HIR.json index e3293cd39..87bd29ced 100644 --- a/IRaCIS.Core.API/appsettings.Uat_HIR.json +++ b/IRaCIS.Core.API/appsettings.Uat_HIR.json @@ -36,20 +36,12 @@ "AutoLoginOutMinutes": 120, "AESKey": "HIR_System_AES_Key_Info", "CmoveIntervalMinutes": 1, - "CmoveInstanceIntervalMinutes": 1 - }, - "SystemHospitalConfig": { - "HospitalCode": "EI", - "HospitalLogoPath": "/System/GeneralDocuments/1716453306898_图片2.png", - "TrialKeepCount": 60, - "HospitalName": "上海展影医疗科技有限公司", - "HospitalAliasName": "展影医疗", - "Country": "中国", - "City": "上海", - "Province": "上海", - "Address": "上海市杨浦区国泰路复旦科技园", - "Phone": "021-60702575", - "IsCanConnectInternet": false + "CmoveInstanceIntervalMinutes": 1, + // 是否强制用户定期修改密码 + "IsNeedChangePassWord": true, + // 密码有效期(天),到期后必须修改 + "ChangePassWordDays": 1000, + "OpenImageShare": true }, "SystemEmailSendConfig": { "Port": 465, @@ -57,6 +49,7 @@ "FromEmail": "test-study@extimaging.com", "FromName": "Test_HIR", "AuthorizationCode": "zhanying123", - "SiteUrl": "http://hir.test.extimaging.com/login" + "SiteUrl": "http://hir.test.extimaging.com/login", + "EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 1bf0fb780..1b7d56be5 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -7210,7 +7210,7 @@ 部位 - + 检查号 diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 827288e03..4f1258df6 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -134,7 +134,7 @@ namespace IRaCIS.Core.Application.Service var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hIRHospitalRepository), TimeSpan.FromDays(7)); return await _trialRepository.AsQueryable() //过滤医院,切换会有问题 - .Where(t => t.HospitalId == hospitalInfo.Id) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin, t => t.HospitalId == hospitalInfo.Id) //SuperAdmin Admin OP OA .WhereIf(sap.Contains(_userInfo.UserTypeEnumInt), x => trialState.Contains(x.TrialStatusStr)) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index cb9841148..a39dbad3c 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -218,7 +218,7 @@ namespace IRaCIS.Application.Services .WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode)) //过滤医院,切换会有问题 - .Where(t => t.HospitalId == hospitalInfo.Id) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin, t => t.HospitalId == hospitalInfo.Id) //GA 要过滤课题组 .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA && hospitalGroupAdminIdList.Any(), t => hospitalGroupAdminIdList.Contains(t.HospitalGroupId)) .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 36b3ccd24..e638eec97 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -300,6 +300,24 @@ namespace IRaCIS.Core.Application.Service return ResponseOutput.Ok(); } + [AllowAnonymous] + public async Task NewUserHospitalGroup( + [FromServices] IRepository _SCPStudyHospitalGroupRepository, + [FromServices] IRepository _SCPStudyRepository, Guid hospitalGroupId) + { + + var scpStudyIdList = _SCPStudyRepository.Where().Select(t => t.Id).ToList(); + + foreach (var item in scpStudyIdList) + { + await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId }); + } + + await _SCPStudyRepository.SaveChangesAsync(); + + return ResponseOutput.Ok(); + } + /// /// 外部人员 中心调研人员维护 /// From ffedc3f378e4b625812dc5b5f41033309707e267 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Sep 2025 14:29:45 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E7=BB=91=E5=AE=9A+=20GA=20=E7=9C=8B=E5=88=B0=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E7=BB=84=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs | 2 ++ IRaCIS.Core.Application/Service/Visit/PatientService.cs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs index 96ec3c8b2..bca76026d 100644 --- a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs +++ b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs @@ -81,8 +81,10 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos [HttpPost] public async Task> GetHospitalGroupPageList(HospitalGroupQuery inQuery) { + //GA 只能看到自己是管理员的课题组 var hospitalGroupQueryable = _hospitalGroupRepository + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => t.IdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsManager && t.IsDisabled == false)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Code), t => t.Code.Contains(inQuery.Code)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.Name.Contains(inQuery.Name)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation)) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index a39dbad3c..67e882fc5 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -2593,7 +2593,11 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetPatientOtherStudyList(PatientStudyOtherQuery inQuery) { + + var trialHospitalGroupId = await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.HospitalGroupId).FirstOrDefaultAsync(); + var query = from scpStudy in _studyRepository.Where(t => inQuery.PatientIdList.Contains(t.PatientId) && !t.SCPStudySubjectVisitList.Any(t => (t.SubjectVisitId == inQuery.SujectVisitId || t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted) && t.TrialId == inQuery.TrialId)) + .Where(t => t.HospitalGroupList.Any(t => t.HospitalGroupId == trialHospitalGroupId)) .WhereIf(inQuery.EarliestStudyTime != null, t => t.StudyTime >= inQuery.EarliestStudyTime) .WhereIf(inQuery.LatestStudyTime != null, t => t.StudyTime <= inQuery.LatestStudyTime) .WhereIf(!string.IsNullOrEmpty(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr)) From b2022a912fd5ce8acbeb97943475bde25ec84d66 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Sep 2025 14:52:32 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E9=A2=98?= =?UTF-8?q?=E7=BB=84=E7=BB=91=E5=AE=9A=EF=BC=8C=E5=92=8CGA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 6 ++++-- IRaCIS.Core.Application/Service/Visit/PatientService.cs | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 35b0f99ed..212734782 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -491,8 +491,10 @@ namespace IRaCIS.Core.Application.Service .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA, t => !t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin)) //GA 只能看有该课题组的用户,并且不是admin oa - .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => !t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin || t.UserTypeEnum == UserTypeEnum.OA) - && t.IdentityUserHospitalGroupList.Any(t => isGAGroupAdmin ? hospitalGroupAdminIdList.Contains(t.HospitalGroupId) : false)) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, + t => /*!t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin || t.UserTypeEnum == UserTypeEnum.OA) &&*/ + + t.IdentityUserHospitalGroupList.Any(t => isGAGroupAdmin ? hospitalGroupAdminIdList.Contains(t.HospitalGroupId) : false)) .ProjectTo(_mapper.ConfigurationProvider); return await userQueryable.ToPagedListAsync(inQuery); diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 67e882fc5..4b2131f07 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -2722,7 +2722,10 @@ namespace IRaCIS.Application.Services // }); #endregion + var trialHospitalGroupId = await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.HospitalGroupId).FirstOrDefaultAsync(); + var query = from scpStudy in _studyRepository.Where(t => !t.SCPStudySubjectVisitList.Any(t => t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted && t.TrialId == inQuery.TrialId)) + .Where(t => t.HospitalGroupList.Any(t => t.HospitalGroupId == trialHospitalGroupId)) .WhereIf(inQuery.IsBindedVisit == false, t => !t.SCPStudySubjectVisitList.Any(t => t.TrialId == inQuery.TrialId)) .WhereIf(inQuery.IsBindedVisit == true, t => t.SCPStudySubjectVisitList.Any(t => t.TrialId == inQuery.TrialId)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.VisitName), t => t.SCPStudySubjectVisitList.Any(t => t.TrialId == inQuery.TrialId && t.SubjectVisit.VisitName.Contains(inQuery.VisitName))) From 32ca60156e8f5032512f33bd7eb975a760843781 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Sep 2025 15:49:49 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=82=A3=E8=80=85=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=A1=B9=E7=9B=AE=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/PatientService.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 4b2131f07..08f0c5b99 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -757,15 +757,25 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task>> GetPatientJoinTrialInitSelectList(PatientJoinTrialInitQuery inQuery) { + + var currentUserHospitalGroupList = _identityUserRepository.Where(t => t.Id == _userInfo.IdentityUserId).SelectMany(t => t.IdentityUserHospitalGroupList) + .Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable).Select(t => new { t.HospitalGroupId, t.IsManager }).ToList(); + + var hospitalGroupAdminIdList = currentUserHospitalGroupList.Where(t => t.IsManager).Select(t => t.HospitalGroupId).ToList(); + var hospitalGroupIdList = currentUserHospitalGroupList.Select(t => t.HospitalGroupId).ToList(); + //排除已参与的项目列表 var exceptQuery = _subjectPatientRepository.Where(t => t.PatientId == inQuery.PatientId).Select(t => t.Subject.TrialId); //患者检查所属的课题组 要和项目进行匹配,否则过滤掉 - var hospitalGroupIdList = await _studyRepository.Where(t => t.PatientId == inQuery.PatientId).SelectMany(t => t.HospitalGroupList).Select(t => t.HospitalGroupId).Distinct().ToListAsync(); + var studyhospitalGroupIdList = await _studyRepository.Where(t => t.PatientId == inQuery.PatientId).SelectMany(t => t.HospitalGroupList).Select(t => t.HospitalGroupId).Distinct().ToListAsync(); - var trialQuery = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing && hospitalGroupIdList.Contains(t.HospitalGroupId)) + + var intersection = hospitalGroupIdList.Intersect(studyhospitalGroupIdList).ToList(); + + var trialQuery = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing && intersection.Contains(t.HospitalGroupId)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Filter), t => t.ResearchProgramNo.Contains(inQuery.Filter) || t.ExperimentName.Contains(inQuery.Filter)) - .Where(t => t.TrialUserRoleList.Any(c => c.UserId == _userInfo.UserRoleId)) + .Where(t => t.TrialUserRoleList.Any(c => c.UserId == _userInfo.UserRoleId) && t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId)) .Where(t => !exceptQuery.Any(c => c == t.Id)).ProjectTo(_mapper.ConfigurationProvider); var list = trialQuery.ToList(); From 9386b891103098043678871e77d690f50d843f91 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Sep 2025 17:46:03 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=87=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 212734782..1467aafd4 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -491,7 +491,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA, t => !t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin)) //GA 只能看有该课题组的用户,并且不是admin oa - .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => /*!t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin || t.UserTypeEnum == UserTypeEnum.OA) &&*/ t.IdentityUserHospitalGroupList.Any(t => isGAGroupAdmin ? hospitalGroupAdminIdList.Contains(t.HospitalGroupId) : false)) @@ -1044,9 +1044,14 @@ namespace IRaCIS.Core.Application.Service { await _fusionCache.RemoveAsync(CacheKeys.UserToken(identityUserId)); - var userName = await _userRoleRepository.Where(t => t.Id == userRoleId).Select(t => t.UserName).FirstOrDefaultAsync(); + var userName = await _identityUserRepository.Where(t => t.Id == identityUserId).Select(t => t.UserName).FirstOrDefaultAsync(); + + if (userName.IsNotNullOrEmpty()) + { + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = identityUserId, ActionUserName = userName, OptType = UserOptType.LoginOut }, true); + + } - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = identityUserId, ActionUserName = userName, OptType = UserOptType.LoginOut }, true); return ResponseOutput.Ok(); } From 98741d9a3bf3bdfda5bbc00faca80fa3fd11644d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 12 Sep 2025 09:00:59 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8E=A5=E6=94=B6=E5=BD=B1=E5=83=8F?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E5=BC=A0=E7=9A=84=E6=97=B6=E5=80=99=E5=B0=B1?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=89=93=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 65 +++++++++++++----------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 462bad2e2..f8fda11a0 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -190,9 +190,7 @@ namespace IRaCIS.Core.SCP.Service var _dictionaryRepository = _serviceProvider.GetService>(); var _seriesRepository = _serviceProvider.GetService>(); var _studyRepository = _serviceProvider.GetService>(); - var _studyGroupRepository = _serviceProvider.GetService>(); - var _cmoveStudyRepository = _serviceProvider.GetService>(); var dicModalityList = _dictionaryRepository.Where(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList(); var seriesModalityList = _seriesRepository.Where(t => _SCPStudyIdList.Contains(t.StudyId)).Select(t => new { SCPStudyId = t.StudyId, t.Modality, t.StudyInstanceUid }).ToList(); @@ -220,34 +218,7 @@ namespace IRaCIS.Core.SCP.Service await _studyRepository.BatchUpdateNoTrackingAsync(t => t.Id == g.Key.SCPStudyId, u => new SCPStudy() { Modalities = modality, ModalityForEdit = modalityForEdit }); - //添加课题组标签 - if (CurrentHospitalGroup != null) - { - if (!_studyGroupRepository.Any(t => t.SCPStudyId == g.Key.SCPStudyId && t.HospitalGroupId == CurrentHospitalGroup.Id)) - { - await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = g.Key.SCPStudyId, HospitalGroupId = CurrentHospitalGroup.Id }); - } - } - else - { - var findCmoveInfo = _cmoveStudyRepository.Where(t => t.StudyInstanceUIDList.Any(c => c == g.Key.StudyInstanceUid)).OrderByDescending(t => t.CreateTime).FirstOrDefault(); - if (findCmoveInfo != null) - { - foreach (var item in findCmoveInfo.HopitalGroupIdList) - { - if (!_studyGroupRepository.Any(t => t.SCPStudyId == g.Key.SCPStudyId && t.HospitalGroupId == item)) - { - await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = g.Key.SCPStudyId, HospitalGroupId = item }); - - } - } - } - else - { - Log.Logger.Warning($"未找到{g.Key.StudyInstanceUid}的Cmove记录"); - } - } } @@ -319,6 +290,9 @@ namespace IRaCIS.Core.SCP.Service var ossService = _serviceProvider.GetService(); var dicomArchiveService = _serviceProvider.GetService(); var _seriesRepository = _serviceProvider.GetService>(); + var _studyGroupRepository = _serviceProvider.GetService>(); + + var _cmoveStudyRepository = _serviceProvider.GetService>(); var _distributedLockProvider = _serviceProvider.GetService(); @@ -422,6 +396,39 @@ namespace IRaCIS.Core.SCP.Service if (!_SCPStudyIdList.Contains(scpStudyId)) { _SCPStudyIdList.Add(scpStudyId); + + #region 给检查打课题组标签 + + //添加课题组标签 + if (CurrentHospitalGroup != null) + { + if (!_studyGroupRepository.Any(t => t.SCPStudyId == scpStudyId && t.HospitalGroupId == CurrentHospitalGroup.Id)) + { + await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = scpStudyId, HospitalGroupId = CurrentHospitalGroup.Id }); + } + } + else + { + var findCmoveInfo = _cmoveStudyRepository.Where(t => t.StudyInstanceUIDList.Any(c => c == studyInstanceUid)).OrderByDescending(t => t.CreateTime).FirstOrDefault(); + + if (findCmoveInfo != null) + { + foreach (var item in findCmoveInfo.HopitalGroupIdList) + { + if (!_studyGroupRepository.Any(t => t.SCPStudyId == scpStudyId && t.HospitalGroupId == item)) + { + await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = scpStudyId, HospitalGroupId = item }); + + } + } + } + else + { + Log.Logger.Warning($"未找到{g.Key.StudyInstanceUid}的Cmove记录"); + } + } + #endregion + } var series = await _seriesRepository.FirstOrDefaultAsync(t => t.Id == seriesId); From 2fe3441c3fc54fd7c84f785b88cb3af8a2464904 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 12 Sep 2025 09:07:34 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index f8fda11a0..c173a9caa 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -424,7 +424,7 @@ namespace IRaCIS.Core.SCP.Service } else { - Log.Logger.Warning($"未找到{g.Key.StudyInstanceUid}的Cmove记录"); + Log.Logger.Warning($"未找到{studyInstanceUid}的Cmove记录"); } } #endregion From 7eff5fd1bb4c5633dbdd4396b11921026f8b763c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 12 Sep 2025 09:49:55 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E4=BA=BA=E5=91=98=20=E5=8E=BB=E6=8E=89GA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/TrialMaintenanceService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 013482a8a..f2fb44a0d 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -115,7 +115,7 @@ namespace IRaCIS.Core.Application.Service //之前已经选择的用户 不放在列表中,现在又要改回去 废弃 - var query = _userRoleRepository.Where(t => t.UserTypeEnum != UserTypeEnum.SuperAdmin && t.UserTypeEnum != UserTypeEnum.Admin && t.UserTypeEnum != UserTypeEnum.OA) + var query = _userRoleRepository.Where(t => t.UserTypeEnum != UserTypeEnum.SuperAdmin && t.UserTypeEnum != UserTypeEnum.Admin && t.UserTypeEnum != UserTypeEnum.OA && t.UserTypeEnum != UserTypeEnum.GA) ////正式或者培训的项目 不能允许测试用户(必须正式用户) 同时必须是内部的用户 //.WhereIf(trialType == TrialType.OfficialTrial || trialType == TrialType.Training, t => t.IsTestUser == false && t.IsZhiZhun)