修改项目下拉查询
parent
2c3483fa4e
commit
721826e346
|
|
@ -101,9 +101,48 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//过滤废除的项目
|
//过滤废除的项目
|
||||||
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
||||||
{
|
{
|
||||||
return await _trialRepository.AsQueryable()
|
// SuperAdmin Admin OP OA
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId) && t.IsDeleted == false)
|
List<int> sap = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP, (int)UserTypeEnum.OA };
|
||||||
|
|
||||||
|
// pm
|
||||||
|
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
|
||||||
|
|
||||||
|
// QA EA
|
||||||
|
List<int> qAEq = new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
|
||||||
|
|
||||||
|
// GA
|
||||||
|
List<int> ga = new List<int>() { (int)UserTypeEnum.GA };
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
|
//SuperAdmin Admin OP
|
||||||
|
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt), x => trialState.Contains(x.TrialStatusStr))
|
||||||
|
|
||||||
|
// pm
|
||||||
|
.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.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
|
||||||
|
.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.IsDeleted == false && t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||||
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
||||||
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
|
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<TrialIdentityUser> TrialIdentityUserList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TaskConsistentRule> TaskConsistentRuleList { get; set; }
|
public List<TaskConsistentRule> TaskConsistentRuleList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue