fix(service): 修复系统管理员只能查看1级代理提现申请的逻辑
This commit is contained in:
@@ -90,8 +90,20 @@ public class KeyboardTenantWithdrawOrderServiceImpl implements KeyboardTenantWit
|
||||
Long currentTenantId = TenantContextHolder.getTenantId();
|
||||
if (currentTenantId != null) {
|
||||
TenantDO currentTenant = tenantMapper.selectById(currentTenantId);
|
||||
if (currentTenant != null && currentTenant.getTenantLevel() != null
|
||||
&& currentTenant.getTenantLevel() != 0) {
|
||||
if (currentTenant != null && currentTenant.getTenantLevel() != null) {
|
||||
if (currentTenant.getTenantLevel() == 0) {
|
||||
// 系统管理员:只能查看1级代理的提现申请
|
||||
List<TenantDO> firstLevelAgents = tenantMapper.selectList(
|
||||
new LambdaQueryWrapper<TenantDO>().eq(TenantDO::getTenantLevel, 1));
|
||||
List<Long> firstLevelAgentIds = firstLevelAgents.stream()
|
||||
.map(TenantDO::getId)
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(firstLevelAgentIds)) {
|
||||
// 没有1级代理,返回空结果
|
||||
return PageResult.empty(0L);
|
||||
}
|
||||
pageReqVO.setTenantIds(firstLevelAgentIds);
|
||||
} else {
|
||||
// 非系统管理员:只能查看直属下级租户的提现申请
|
||||
List<TenantDO> subordinateTenants = tenantMapper.selectList(
|
||||
new LambdaQueryWrapper<TenantDO>().eq(TenantDO::getParentId, currentTenantId));
|
||||
@@ -105,6 +117,7 @@ public class KeyboardTenantWithdrawOrderServiceImpl implements KeyboardTenantWit
|
||||
pageReqVO.setTenantIds(subordinateTenantIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 分页查询租户提现订单数据
|
||||
PageResult<KeyboardTenantWithdrawOrderDO> pageResult = tenantWithdrawOrderMapper.selectPage(pageReqVO);
|
||||
|
||||
Reference in New Issue
Block a user