修改项目下拉查询
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
409b76df26
commit
977adf3153
|
@ -13,6 +13,7 @@ using Microsoft.Extensions.Options;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
using ZiggyCreatures.Caching.Fusion;
|
using ZiggyCreatures.Caching.Fusion;
|
||||||
|
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -105,21 +106,41 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//过滤废除的项目
|
//过滤废除的项目
|
||||||
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
||||||
{
|
{
|
||||||
|
// SuperAdmin Admin OP
|
||||||
List<int> sap = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP };
|
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 };
|
// pm
|
||||||
|
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
|
||||||
|
|
||||||
|
// QA EA
|
||||||
|
List<int> qAEq= new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
|
||||||
|
|
||||||
|
List<int> other = new List<int>() { };
|
||||||
|
|
||||||
|
other.AddRange(sap);
|
||||||
|
other.AddRange(pm);
|
||||||
|
other.AddRange(qAEq);
|
||||||
|
|
||||||
|
List<string> trialState = new List<string>() { StaticData.TrialState.TrialOngoing, StaticData.TrialState.TrialCompleted, StaticData.TrialState.TrialStopped };
|
||||||
return await _trialRepository.AsQueryable()
|
return await _trialRepository.AsQueryable()
|
||||||
|
|
||||||
//SuperAdmin Admin OP
|
//SuperAdmin Admin OP
|
||||||
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=> x.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=> trialState.Contains(x.TrialStatusStr))
|
||||||
|
|
||||||
// pm
|
// pm
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt== (int)UserTypeEnum.ProjectManager,t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
.WhereIf(pm.Contains(_userInfo.UserTypeEnumInt),t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
&& t.IsDeleted == false)
|
&& t.IsDeleted == false)
|
||||||
|
|
||||||
|
|
||||||
|
// QA EA
|
||||||
|
.WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
|
&& t.IsDeleted == false && trialState.Contains(t.TrialStatusStr))
|
||||||
|
|
||||||
|
|
||||||
// other
|
// other
|
||||||
.WhereIf(!sapp.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
.WhereIf(!other.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
&& t.IsDeleted == false&& t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
&& t.IsDeleted == false&& t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||||
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
Loading…
Reference in New Issue