From ac9d2767df083c18e444d78b4d5918130d2e2c27 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Sun, 8 Oct 2023 11:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 2 +- .../Service/Management/UserTypeService.cs | 6 +++--- .../Service/Stat/StatisticsService.cs | 2 +- .../Service/TrialSiteUser/PersonalWorkstation.cs | 16 ++++++++-------- .../TrialSiteUser/TrialMaintenanceService.cs | 4 ++-- .../Service/TrialSiteUser/TrialService.cs | 6 +++--- .../Service/TrialSiteUser/_MapConfig.cs | 2 +- IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs | 2 +- IRaCIS.Core.Domain.Share/User/UserType.cs | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index b2227f0..ddf2d3a 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -461,7 +461,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetUserList(UserListQueryDTO param) { - var userQueryable = _userRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) + var userQueryable = _userRepository.Where(x => x.UserTypeEnum != UserTypeEnum.NormalAdmin && x.UserTypeEnum!=UserTypeEnum.SuperAdmin) .WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.UserName.Contains(param.UserName) ) .WhereIf(!string.IsNullOrWhiteSpace(param.RealName), t => t.FullName.Contains(param.RealName)) .WhereIf(!string.IsNullOrWhiteSpace(param.Phone), t => t.Phone.Contains(param.Phone)) diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index 6509988..83ada3a 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -112,7 +112,7 @@ namespace IRaCIS.Core.Application.Contracts userTypeEnums = new List() { UserTypeEnum.IndependentReviewer, UserTypeEnum.ClinicalResearchCoordinator }; - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin) { userTypeEnums.Add(UserTypeEnum.ProjectManager); } @@ -140,7 +140,7 @@ namespace IRaCIS.Core.Application.Contracts - var query = userTypeServiceRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) + var query = userTypeServiceRepository.Where(x => x.UserTypeEnum != UserTypeEnum.NormalAdmin) .WhereIf(userTypeSelectEnum != UserTypeSelectEnum.None, t => userTypeEnums.Contains(t.UserTypeEnum)) .OrderBy(t => t.Order).ProjectTo(_mapper.ConfigurationProvider); @@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Contracts /// public async Task> GetTrialUserTypeList() { - var query = userTypeServiceRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) + var query = userTypeServiceRepository.Where(x => x.UserTypeEnum != UserTypeEnum.NormalAdmin) //.Where(t => t.Type == UserTypeGroup.TrialUser) .OrderBy(t => t.Order).ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs b/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs index c13ae83..5de5952 100644 --- a/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs +++ b/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs @@ -62,7 +62,7 @@ namespace IRaCIS.Application.Services workloadLambda = workloadLambda.And(x => x.WorkTime >= bDate && x.WorkTime < eDate); Expression> trialLambda = x => true; - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) //超级管理员按照条件查询所有 + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin) //超级管理员按照条件查询所有 { if (param.CroId != null) { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index d841dd3..9f507da 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -33,17 +33,17 @@ namespace IRaCIS.Core.Application return new PersonalStataDTO() { //正参与的数量 - TrialCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + TrialCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? await _trialRepository.CountAsync() : await _trialUserRepository.Where(t => t.UserId == _userInfo.Id).CountAsync(), - DeletedCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + DeletedCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? await _trialRepository.AsQueryable(true).CountAsync(t => t.IsDeleted) : await _trialUserRepository.AsQueryable(true).Where(t => t.UserId == _userInfo.Id && t.IsDeleted) .CountAsync(), - TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) @@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application .SelectMany(t => t.NeedConfirmedUserTypeList) .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), - HaveSignedTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + HaveSignedTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 //废除了 已经签署了也要算进去 : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) @@ -61,7 +61,7 @@ namespace IRaCIS.Core.Application .SelectMany(t => t.TrialDocConfirmedUserList) .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime !=null), - TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 : await _systemDocumentRepository .Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime !=null))) @@ -69,7 +69,7 @@ namespace IRaCIS.Core.Application .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), - HaveSignedSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + HaveSignedSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 : await _systemDocumentRepository .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) @@ -84,12 +84,12 @@ namespace IRaCIS.Core.Application :0, - TotalSystemNoticeCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + TotalSystemNoticeCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0:await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum== Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished) .CountAsync(), - NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t=>t.CreateUserId==_userInfo.Id)) .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index a764c1c..2e37efc 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -110,14 +110,14 @@ namespace IRaCIS.Application.Services var trialType = _trialRepository.Where(t => t.Id == trialUserQuery.TrialId).Select(t => t.TrialType).FirstOrDefault(); var userTypeEnums = new List() { UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW }; - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.NormalAdmin) { userTypeEnums.Add(UserTypeEnum.ProjectManager); } //之前已经选择的用户 不放在列表中,现在又要改回去 废弃 - var query = _repository.Where(t => t.UserTypeEnum != UserTypeEnum.SuperAdmin) + var query = _repository.Where(t => t.UserTypeEnum != UserTypeEnum.NormalAdmin) ////正式或者培训的项目 不能允许测试用户(必须正式用户) 同时必须是内部的用户 //.WhereIf(trialType == TrialType.OfficialTrial || trialType == TrialType.Training, t => t.IsTestUser == false && t.IsZhiZhun) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index b2a97d4..486a809 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -70,7 +70,7 @@ namespace IRaCIS.Application.Services .WhereIf(multiModalityIdSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Modality) == multiModalityIdSelectCount) .WhereIf(multiCriteriaSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Criterion) == multiCriteriaSelectCount) .WhereIf(multiReviewTypeSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.ReviewType) == multiReviewTypeSelectCount) - .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.NormalAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false) .ProjectTo(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id }); return await query.ToPagedListAsync(searchParam.PageIndex, searchParam.PageSize, string.IsNullOrWhiteSpace(searchParam.SortField) ? "CreateTime" : searchParam.SortField, searchParam.Asc); @@ -82,7 +82,7 @@ namespace IRaCIS.Application.Services public async Task> GetTrialSelect() { return await _trialRepository.AsQueryable().IgnoreQueryFilters() - .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.NormalAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); } @@ -693,7 +693,7 @@ namespace IRaCIS.Application.Services .WhereIf(searchModel.Expedited != null, o => o.Expedited == searchModel.Expedited) .WhereIf(!string.IsNullOrEmpty(searchModel.Code), o => o.TrialCode.Contains(searchModel.Code)) .WhereIf(!string.IsNullOrWhiteSpace(searchModel.Indication), o => o.Indication.Contains(searchModel.Indication)) - .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.NormalAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .ProjectTo(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id }); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index 55b688e..7c12df2 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -296,7 +296,7 @@ namespace IRaCIS.Core.Application.Service var userTypeId = Guid.Empty; CreateMap() .ForMember(t => t.WaitSignCount, u => - u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0 + u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.NormalAdmin ? 0 : c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == userTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == userId && t.ConfirmTime!=null)).Count()) ); diff --git a/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs b/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs index 522c39f..9972887 100644 --- a/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs +++ b/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs @@ -148,7 +148,7 @@ namespace IRaCIS.Core.Domain.Share if (userType != null && !string.IsNullOrEmpty(userType.Value)) { - return int.Parse(userType.Value) == (int)UserTypeEnum.SuperAdmin; + return int.Parse(userType.Value) == (int)UserTypeEnum.NormalAdmin; } return false; } diff --git a/IRaCIS.Core.Domain.Share/User/UserType.cs b/IRaCIS.Core.Domain.Share/User/UserType.cs index a32ac6f..2259733 100644 --- a/IRaCIS.Core.Domain.Share/User/UserType.cs +++ b/IRaCIS.Core.Domain.Share/User/UserType.cs @@ -26,7 +26,7 @@ Dashboard = 6, // 超级管理员用户类型,用于取代 SuperAdmin字段 数据库不内置这个用户类型和角色的配置,因为只允许有一个 - SuperAdmin=8, + NormalAdmin=8, @@ -63,7 +63,7 @@ ShareImage = 125, - + SuperAdmin=99, Undefined=0