|
|
|
@ -47,7 +47,7 @@ public class RightQueryServiceImpl implements RightQueryService { |
|
|
|
@Override |
|
|
|
public List<UserListRightByOperatorVo> listRightByOperator(UserListRightByOperatorQueryParam queryParam) { |
|
|
|
List<UserListRightByOperatorVo> operatorVolist = new ArrayList<>(); |
|
|
|
List<Right> allRightList = listEnableRightBy(queryParam.getQueryUserId(), queryParam.getMiId(), RightTypeEnum.get(queryParam.getType())); |
|
|
|
List<Right> allRightList = listAllRightBy(queryParam.getQueryUserId(), queryParam.getMiId(), RightTypeEnum.get(queryParam.getType())); |
|
|
|
if (CollUtil.isNotEmpty(allRightList)) { |
|
|
|
for (Right right : allRightList) { |
|
|
|
UserListRightByOperatorVo operatorVo = transformOperatorRight(right); |
|
|
|
@ -206,6 +206,26 @@ public class RightQueryServiceImpl implements RightQueryService { |
|
|
|
return allRightList; |
|
|
|
} |
|
|
|
|
|
|
|
private List<Right> listAllRightBy(Long userId, Long miId, RightTypeEnum type) { |
|
|
|
LambdaQueryWrapper<Right> rightWrapper = new LambdaQueryWrapper<>(); |
|
|
|
rightWrapper.eq(Right::getUserId, userId); |
|
|
|
rightWrapper.eq(Right::getMiId, miId); |
|
|
|
if (Objects.nonNull(type)) { |
|
|
|
rightWrapper.eq(Right::getType, type); |
|
|
|
} |
|
|
|
rightWrapper.orderByAsc(Right::getEndTime); |
|
|
|
List<Right> allRightList = rightDao.selectList(rightWrapper); |
|
|
|
if (CollUtil.isNotEmpty(allRightList)) { |
|
|
|
List<Long> rightIdList = allRightList.stream().map(Right::getId).collect(Collectors.toList()); |
|
|
|
List<RightTerm> allRightTermList = rightTermDao.selectList(new LambdaQueryWrapper<RightTerm>() |
|
|
|
.in(RightTerm::getRightId, rightIdList)); |
|
|
|
Map<Long, List<RightTerm>> allRightTermMap = allRightTermList.stream().collect(Collectors.groupingBy(RightTerm::getRightId)); |
|
|
|
allRightList.forEach(right -> right.setRightTermList(allRightTermMap.get(right.getId()))); |
|
|
|
} |
|
|
|
return allRightList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean checkEnable(Right right) { |
|
|
|
//1.判断enable |
|
|
|
|