From 4a1e0a87ba638496d5515212e89b2c2a31217850 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 24 Feb 2025 17:21:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=B1=BB=E5=9E=8B=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/IRaCIS.Core.Application.xml | 7 +++++++ .../Service/Management/UserTypeService.cs | 2 +- IRaCIS.Core.Application/TestService.cs | 10 ++++++++++ IRaCIS.Core.Domain.Share/User/UserType.cs | 3 +++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 8e1e76138..f12d748c1 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1466,6 +1466,13 @@ + + + 复制系统数据到项目 + + + + 项目定稿记录 diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index 3876f5a1e..0fabc11dd 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -141,7 +141,7 @@ namespace IRaCIS.Core.Application.Contracts - var query = _userTypeRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) + var query = _userTypeRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin && x.IsEnable==true) .WhereIf(userTypeSelectEnum != UserTypeSelectEnum.None, t => userTypeEnums.Contains(t.UserTypeEnum)) .OrderBy(t => t.UserTypeShortName).ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index b223f086a..534d32aaf 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -166,6 +166,16 @@ namespace IRaCIS.Core.Application.Service { var userRoleList = item.OrderBy(t => t.CreateTime).ToList(); + foreach (var userRole in userRoleList) + { + var isTrue = userRole.UserTypeEnum == UserTypeEnum.SystemAdmin || userRole.UserTypeEnum == UserTypeEnum.OP || userRole.UserTypeEnum == UserTypeEnum.Dashboard; + + if (isTrue) + { + await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userRole.Id, t => new UserRole() { IsUserRoleDisabled = true }); + } + } + var firstCreateRole = userRoleList.FirstOrDefault(); var firstTrialId = _trialUserRoleRepository.Where(t => t.TrialUser.IdentityUserId == firstCreateRole.IdentityUserId).IgnoreQueryFilters().OrderBy(t => t.CreateTime).Select(t => t.TrialId).FirstOrDefault(); diff --git a/IRaCIS.Core.Domain.Share/User/UserType.cs b/IRaCIS.Core.Domain.Share/User/UserType.cs index b38f45d76..fa26e0c23 100644 --- a/IRaCIS.Core.Domain.Share/User/UserType.cs +++ b/IRaCIS.Core.Domain.Share/User/UserType.cs @@ -62,6 +62,9 @@ OP=31, + //仅仅管理后端部分数据,现在不用 + SystemAdmin=32, + //医生用户类型暂不处理 ShareImage = 125, From 812035686ed00a4254f0a40fa68fc76547e3da5a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 25 Feb 2025 09:57:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/DTO/UserTypeRoleModel.cs | 1 + .../Service/TrialSiteUser/DTO/UserTrialViewModel.cs | 5 +++++ .../Service/TrialSiteUser/TrialMaintenanceService.cs | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs index 2b448a868..2a37c712e 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs @@ -95,6 +95,7 @@ namespace IRaCIS.Core.Application.Contracts public class UserTypeSelectDto { + public bool IsDeleted { get; set; } public Guid UserTypeId { get; set; } public string UserTypeShortName { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index 6a8657487..68fba3f4a 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -139,6 +139,11 @@ namespace IRaCIS.Application.Contracts public DateTime? JoinTime { get; set; } + + public string Roles => string.Join(',', TrialUserRoleList.Select(t => t.UserTypeShortName)); + public string JoinTimeStr => JoinTime?.ToString("yyyy-MM-dd") ?? string.Empty; + public string RemoveTimeStr => RemoveTime?.ToString("yyyy-MM-dd") ?? string.Empty; + } public class TrialMaintenanceDTO : UserTrialCommand diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 4bc8f2624..bdcd78907 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -50,7 +50,7 @@ namespace IRaCIS.Core.Application.Service IsDeleted = t.IsDeleted, JoinTime = t.JoinTime, RemoveTime = t.RemoveTime, - TrialUserRoleList = t.TrialUserRoleList.Select(t => new UserTypeSelectDto() { UserTypeId = t.UserRole.UserTypeRole.Id, UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName }).ToList(), + TrialUserRoleList = t.TrialUserRoleList.Select(t => new UserTypeSelectDto() { IsDeleted = t.IsDeleted, UserTypeId = t.UserRole.UserTypeRole.Id, UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName }).ToList(), }).ToPagedListAsync(inQuery); From 73912fd875fef06fed64c24f8632012916b86b65 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 25 Feb 2025 10:26:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/DTO/UserModel.cs | 2 ++ IRaCIS.Core.Application/Service/Management/UserService.cs | 1 + .../Service/TrialSiteUser/TrialMaintenanceService.cs | 7 +++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index c69e23526..94228c00b 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -311,6 +311,8 @@ namespace IRaCIS.Application.Contracts public DateTime? BeginLastChangePassWordTime { get; set; } public DateTime? EndLastChangePassWordTime { get; set; } + + public UserCeateSource? UserCeateSource { get; set; } } public class UserRoleInfoDTO diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 6c84df065..f0fc68b48 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -514,6 +514,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState) .WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser) .WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun) + .WhereIf(inQuery.UserCeateSource != null, t => t.UserCeateSource == inQuery.UserCeateSource) .ProjectTo(_mapper.ConfigurationProvider); return await userQueryable.ToPagedListAsync(inQuery); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index bdcd78907..d7df6cdd4 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.Service } [HttpPost] - public async Task> GetUserJoinedTrialList(IdentityUserJoinedTrialQuery inQuery) + public async Task>> GetUserJoinedTrialList(IdentityUserJoinedTrialQuery inQuery) { var list = await _trialIdentityUserRepository.Where(t => t.IdentityUserId == inQuery.IdentityUserId, false, true) .WhereIf(!string.IsNullOrEmpty(inQuery.TrialCode), o => o.Trial.TrialCode.Contains(inQuery.TrialCode)) @@ -54,7 +54,10 @@ namespace IRaCIS.Core.Application.Service }).ToPagedListAsync(inQuery); - return list; + var info = await _trialIdentityUserRepository.Where(t => t.IdentityUserId == inQuery.IdentityUserId).Select(t => + new { t.IdentityUser.CreateTime, t.IdentityUser.UserCeateSource, t.Trial.ResearchProgramNo, t.Trial.TrialCode }).FirstOrDefaultAsync(); + + return ResponseOutput.Ok(list, info); } #region 多账户调整已修改