修改项目下拉列表
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2025-03-27 10:55:45 +08:00
parent 2f57238f66
commit b25dec68cb
2 changed files with 19 additions and 6 deletions
@@ -105,11 +105,15 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect()
{
List<int> sap = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP };
List<int> sapp = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP, (int)UserTypeEnum.ProjectManager };
return await _trialRepository.AsQueryable()
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP,
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && t.IsDeleted == false)
.Where(t=>t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))
&& (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager))
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=>x.TrialStatusStr != StaticData.TrialState.TrialStopped)
.WhereIf(_userInfo.UserTypeEnumInt== (int)UserTypeEnum.ProjectManager,t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.WhereIf(!sapp.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))&& t.TrialStatusStr != StaticData.TrialState.TrialStopped)
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
}