优化代码

pull/61/MERGE
awenes 2023-09-28 20:50:20 +08:00
parent 8699bcfccc
commit 2efef4825d
3 changed files with 5 additions and 7 deletions

View File

@ -22,8 +22,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import cn.topiam.employee.common.entity.app.AppEntity;
import cn.topiam.employee.common.repository.app.impl.mapper.AppEntityMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
@ -171,10 +169,10 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto
List<Object> list = Lists.newArrayList();
//当前用户加入的用户组Id
List<Long> groupIdList = userGroupMemberRepository.findByUserId(userId).stream()
.map(UserGroupMemberEntity::getGroupId).toList();
.map(UserGroupMemberEntity::getGroupId).toList();
//当前用户加入的组织id
List<String> orgId = organizationMemberRepository.findAllByUserId(userId).stream()
.map(OrganizationMemberEntity::getOrgId).toList();
.map(OrganizationMemberEntity::getOrgId).toList();
list.addAll(groupIdList);
list.addAll(orgId);
list.add(userId);

View File

@ -159,10 +159,10 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized {
List<Object> list = Lists.newArrayList();
//当前用户加入的用户组Id
List<Long> groupIdList = userGroupMemberRepository.findByUserId(userId).stream()
.map(UserGroupMemberEntity::getGroupId).toList();
.map(UserGroupMemberEntity::getGroupId).toList();
//当前用户加入的组织id
List<String> orgId = organizationMemberRepository.findAllByUserId(userId).stream()
.map(OrganizationMemberEntity::getOrgId).toList();
.map(OrganizationMemberEntity::getOrgId).toList();
list.addAll(groupIdList);
list.addAll(orgId);
list.add(userId);

View File

@ -256,7 +256,7 @@ public class AppServiceImpl implements AppService {
private final AppConverter appConverter;
/**
* AppGroupAssociationRepositorys
* AppGroupAssociationRepository
*/
private final AppGroupAssociationRepository appGroupAssociationRepository;
}