权限改造

This commit is contained in:
钱涛 2025-02-17 09:49:01 +08:00
parent 05690a81fa
commit 22077f431e
1 changed files with 3 additions and 17 deletions

View File

@ -313,21 +313,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
@Override
public Collection<TaxAgentPO> listAllTaxAgentsAsAdmin(Long employeeId) {
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
// 是否开启分权
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
if (!isOpenDevolution) {
return taxAgents;
}
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
List<Long> enableTaxAgentIds = Lists.newArrayList();
// 1.判断自己是否是管理员 如果是管理员就是能够查看所属个税扣缴义务人
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds);
// 是管理员的列表
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().filter(f -> f.getEmployeeId().equals(employeeId)).map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
enableTaxAgentIds.addAll(adminTaxAgentIds);
return taxAgents.stream().filter(f -> enableTaxAgentIds.contains(f.getId())).collect(Collectors.toList());
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
return listAuth(param);
}
@Override
@ -493,8 +481,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
}
// 删除管理员
getTaxAgentAdminService(user).deleteByTaxAgentIds(ids);
// 删除分管理员和对应管理范围
// todo taxAgentSubAdminService.deleteByTaxAgentIds(ids);
// 删除人员范围
getTaxAgentManageRangeService(user).deleteByTaxAgentIds(ids);