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

Uat_IRC_Net8
he 2025-03-27 10:55:45 +08:00
parent 2f57238f66
commit b25dec68cb
2 changed files with 19 additions and 6 deletions

View File

@ -961,6 +961,10 @@ namespace IRaCIS.Core.Application.Service
{ {
question.RelevanceId = copyNewQuestionList.Where(y => x.RelevanceId == y.OriginalId).Select(y => y.Id).FirstOrDefault(); question.RelevanceId = copyNewQuestionList.Where(y => x.RelevanceId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
} }
if (question.GroupId != null)
{
question.GroupId = copyNewQuestionList.Where(y => x.GroupId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddDatas.Add(question); needAddDatas.Add(question);
}; };
@ -977,7 +981,8 @@ namespace IRaCIS.Core.Application.Service
var tableQuestion = x.Clone(); var tableQuestion = x.Clone();
tableQuestion.SystemCriterionId = inDto.NewSystemCriterionId; tableQuestion.SystemCriterionId = inDto.NewSystemCriterionId;
tableQuestion.Id = NewId.NextGuid(); tableQuestion.Id = NewId.NextGuid();
if (tableQuestion.ParentId != null) tableQuestion.ReadingQuestionId = copyNewQuestionList.Where(y => x.ReadingQuestionId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
if (tableQuestion.ParentId != null)
{ {
tableQuestion.ParentId = copeNewSystemTableQuestionList.Where(y => x.ParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault(); tableQuestion.ParentId = copeNewSystemTableQuestionList.Where(y => x.ParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
} }
@ -989,7 +994,11 @@ namespace IRaCIS.Core.Application.Service
{ {
tableQuestion.DependParentId = copeNewSystemTableQuestionList.Where(y => x.DependParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault(); tableQuestion.DependParentId = copeNewSystemTableQuestionList.Where(y => x.DependParentId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
} }
needAddTableDatas.Add(tableQuestion); if (tableQuestion.ClassifyTableQuestionId != null)
{
tableQuestion.ClassifyTableQuestionId = copeNewSystemTableQuestionList.Where(y => x.ClassifyTableQuestionId == y.OriginalId).Select(y => y.Id).FirstOrDefault();
}
needAddTableDatas.Add(tableQuestion);
} }
await _readingTableQuestionSystemRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId); await _readingTableQuestionSystemRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.NewSystemCriterionId);
await _readingTableQuestionSystemRepository.AddRangeAsync(needAddTableDatas); await _readingTableQuestionSystemRepository.AddRangeAsync(needAddTableDatas);

View File

@ -105,11 +105,15 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目 //过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect() 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() return await _trialRepository.AsQueryable()
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, .WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=>x.TrialStatusStr != StaticData.TrialState.TrialStopped)
t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && t.IsDeleted == false) .WhereIf(_userInfo.UserTypeEnumInt== (int)UserTypeEnum.ProjectManager,t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
.Where(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)
&& (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager))
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync(); .ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
} }