fix(Bug修复): 开通工作台时未保留当前用户导致开通后跳403页面

开通工作台时需保留当前操作用户
This commit is contained in:
OTTO 2024-09-09 14:54:22 +08:00
parent 9a7a4f5b26
commit 421b42b36a
1 changed files with 4 additions and 0 deletions

View File

@ -184,6 +184,10 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
if (pmsEnterpriseMapper.selectPmsEnterpriseByGitlinkOrgId(gitlinkOrgId) != null) {
throw new ServiceException("该组织已开通组织工作台,请勿重复开通");
}
boolean isContainCurrentUser = gitLinkUserToEnterpriseInputVoList.stream().anyMatch(x -> SecurityUtils.getUserId().equals(x.getUserId()));
if (!isContainCurrentUser) {
throw new ServiceException("开通组织工作台需保留当前操作用户");
}
checkGitlinkUserToEnterpriseVoList(gitLinkUserToEnterpriseInputVoList);
PmsEnterprise pmsEnterprise = getPmsEnterpriseByGitlinkOrgId(gitlinkOrgId);
return createEnterprise(pmsEnterprise, gitLinkUserToEnterpriseInputVoList);