diff --git a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java index 9608f932e..227d2ddbe 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java @@ -32,7 +32,6 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; import weaver.wechat.util.Utils; @@ -211,44 +210,44 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); } - /** - * 根据权限范围过滤 - * - * @param taxDeclarationPO - * @param taxDeclarationEmployeeDTOS - * @return - */ - private List filterByAuthority(TaxDeclarationPO taxDeclarationPO, List taxDeclarationEmployeeDTOS) { - long employeeId = user.getUID(); - if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) { - return Collections.emptyList(); - } - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief(employeeId); - if (BooleanUtils.isFalse(openDevolution) || isChief) { - return taxDeclarationEmployeeDTOS; - } - // 查询权限范围内的人员 - List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); - Set simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId()); - // 查询权限范围内的外部人员 -// List extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey); -// Set extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId()); - // 根据权限范围过滤 - return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> { - if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()) - && simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { - return true; - } -// if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) -// && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { -// return true; -// } - return false; - }).collect(Collectors.toList()); - } + // /** + // * 根据权限范围过滤 + // * + // * @param taxDeclarationPO + // * @param taxDeclarationEmployeeDTOS + // * @return + // */ +// private List filterByAuthority(TaxDeclarationPO taxDeclarationPO, List taxDeclarationEmployeeDTOS) { +// long employeeId = user.getUID(); +// if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) { +// return Collections.emptyList(); +// } +// // 判断是否开启了分权 +// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); +// // 是否是总管理员 +// Boolean isChief = getTaxAgentService(user).isChief(employeeId); +// if (BooleanUtils.isFalse(openDevolution) || isChief) { +// return taxDeclarationEmployeeDTOS; +// } +// // 查询权限范围内的人员 +// List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); +// Set simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId()); +// // 查询权限范围内的外部人员 +// // List extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey); +// // Set extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId()); +// // 根据权限范围过滤 +// return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> { +// if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()) +// && simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { +// return true; +// } +// // if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) +// // && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { +// // return true; +// // } +// return false; +// }).collect(Collectors.toList()); +// } @Override